This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 33. Restricting Application Capabilities Using Seccomp
33.1. Overview 링크 복사링크가 클립보드에 복사되었습니다!
Seccomp (secure computing mode) is used to restrict the set of system calls applications can make, allowing cluster administrators greater control over the security of workloads running in OpenShift Container Platform.
Seccomp support is achieved via two annotations in the pod configuration:
- seccomp.security.alpha.kubernetes.io/pod: profile applies to all containers in the pod that do not override
- container.seccomp.security.alpha.kubernetes.io/<container_name>: container-specific profile override
Containers are run with unconfined seccomp settings by default.
For detailed design information, refer to the seccomp design document.
33.2. Enabling Seccomp 링크 복사링크가 클립보드에 복사되었습니다!
Seccomp is a feature of the Linux kernel. To ensure seccomp is enabled on your system, run:
cat /boot/config-`uname -r` | grep CONFIG_SECCOMP= CONFIG_SECCOMP=y
$ cat /boot/config-`uname -r` | grep CONFIG_SECCOMP=
CONFIG_SECCOMP=y
33.3. Configuring OpenShift Container Platform for Seccomp 링크 복사링크가 클립보드에 복사되었습니다!
A seccomp profile is a json file providing syscalls and the appropriate action to take when a syscall is invoked.
Create the seccomp profile.
The default profile is sufficient in many cases, but the cluster administrator must define the security constraints of an individual system.
To create your own custom profile, create a file on every node in the
seccomp-profile-root
directory.If you are using the default docker/default profile, you do not need to create one.
Configure your nodes to use the seccomp-profile-root directory to store your profiles using the kubeletArguments in the appropriate node configuration map:
kubeletArguments: seccomp-profile-root: - "/your/path"
kubeletArguments: seccomp-profile-root: - "/your/path"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the node service to apply the changes:
systemctl restart atomic-openshift-node
# systemctl restart atomic-openshift-node
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In order to control which profiles may be used, and to set the default profile, configure your SCC via the seccompProfiles field. The first profile will be used as a default.
The allowable formats of the seccompProfiles field include:
- docker/default: the default profile for the container runtime (no profile required)
- unconfined: unconfined profile, and disables seccomp
localhost/<profile-name>: the profile installed to the node’s local seccomp profile root
For example, if you are using the default docker/default profile, configure your SCC with:
seccompProfiles: - docker/default
seccompProfiles: - docker/default
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
33.4. Configuring OpenShift Container Platform for a Custom Seccomp Profile 링크 복사링크가 클립보드에 복사되었습니다!
To ensure pods in your cluster run with a custom profile:
- Create the seccomp profile in seccomp-profile-root.
Configure seccomp-profile-root:
kubeletArguments: seccomp-profile-root: - "/your/path"
kubeletArguments: seccomp-profile-root: - "/your/path"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the node service to apply the changes:
systemctl restart atomic-openshift-node
# systemctl restart atomic-openshift-node
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure your SCC:
seccompProfiles: - localhost/<profile-name>
seccompProfiles: - localhost/<profile-name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow