Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Add support for apparmor/selinux #1966

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

thaJeztah
Copy link
Member

this forward-ports this change to master from the v0.8 release branch (change was included in docker 20.10.3)

Set's an apparmor profile on the OCI spec if one is configred on the worker.
Adds selinux labels to containers (only added if selinux is enabled on the system).

This assumes that the specified apparmor profile is already loaded on the system and does not try to load it or even check if it is loaded.

SELinux support requires the selinux build tag to be added. Likewise, runc would require both the apparmor and selinux build tags.

Signed-off-by: Brian Goff cpuguy83@gmail.com

Vendored go-selinux to v1.8.0
Fixed tests

Signed-off-by: Tibor Vass tibor@docker.com
(cherry picked from commit 68bb095)
Signed-off-by: Sebastiaan van Stijn github@gone.nl

Set's an apparmor profile on the OCI spec if one is configred on the
worker.
Adds selinux labels to containers (only added if selinux is enabled on
the system).

This assumes that the specified apparmor profile is already loaded on
the system and does not try to load it or even check if it is loaded.

SELinux support requires the `selinux` build tag to be added.
Likewise, `runc` would require both the `apparmor` and `selinux` build
tags.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Vendored go-selinux to v1.8.0
Fixed tests

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 68bb095)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

@cpuguy83 @tiborvass PTAL

@tonistiigi tonistiigi merged commit 58038e6 into moby:master Feb 5, 2021
@thaJeztah thaJeztah deleted the master_apparmor branch February 5, 2021 17:34
@AkihiroSuda
Copy link
Member

SELinux support seems pretty immature, I suggest making SELinux opt-in

@cpuguy83
Copy link
Member

SGTM

I quite possibly only tested selinux via Docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants