By default, iSulad starts common containers that are suitable for starting common processes. However, common containers have only the default permissions defined by capabilities in the /etc/default/isulad/config.json directory. To perform privileged operations (such as use devices in the /sys directory), a privileged container is required. By using this feature, user root in the container has root permissions of the host. Otherwise, user root in the container has only common user permissions of the host.
Privileged containers provide all functions for containers and remove all restrictions enforced by the device cgroup controller. A privileged container has the following features:
Secomp does not block any system call.
The /sys and /proc directories are writable.
All devices on the host can be accessed in the container.
All system capabilities will be enabled.
Default capabilities of a common container are as follows:
Modifies the process capabilities.
Allows using the system call mknod() to create special files.
Writes records to kernel auditing logs.
Modifies UIDs and GIDs of files. For details, see the chown(2).
Uses RAW and PACKET sockets and binds any IP address to the transparent proxy.
Ignores the discretionary access control (DAC) restrictions on files.
Ignores the restriction that the file owner ID must be the same as the process user ID.
Allows setting setuid bits of files.
Allows sending signals to processes that do not belong to itself.
Allows the change of the process group ID.
Allows the change of the process user ID.
Allows bounding to a port whose number is smaller than 1024.
Allows using the system call chroot().
Allows transferring and deleting capabilities to other processes.
When a privileged container is enabled, the following capabilities are added:
Loads and unloads kernel modules.
Allows direct access to /devport, /dev/mem, /dev/kmem, and original block devices.
Allows the process BSD audit.
Allows executing system management tasks, such as loading or unloading file systems and setting disk quotas.
Allows increasing the priority and setting the priorities of other processes.
Ignores resource restrictions.
Allows changing the system clock.
Allows configuring TTY devices.
Enables and disables kernel auditing, modifies audit filter rules, and extracts audit status and filtering rules.
Overrides the mandatory access control (MAC), which is implemented for the Smack Linux Security Module (LSM).
Allows MAC configuration or status change, which is implemented for Smack LSM.
Allows executing network management tasks.
Performs the privileged syslog(2) operation.
Ignores the DAC access restrictions on file reading and catalog search.
Allows modifying the IMMUTABLE and APPEND attributes of a file.
Allows network broadcast and multicast access.
Allows locking shared memory segments.
Ignores the IPC ownership check.
Allows tracing any process.
Allows restarting the OS.
Allows modifying the FL_LEASE flag of a file lock.
Triggers the function of waking up the system, for example, sets the CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM timers.
Allows blocking system suspension.
iSulad runs the --privileged command to enable the privilege mode for containers. Do not add privileges to containers unless necessary. Comply with the principle of least privilege to reduce security risks.
isula run --rm -it --privileged busybox