-
Notifications
You must be signed in to change notification settings - Fork 53
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
Enable SELinux for tumbleweed and green #2052
Enable SELinux for tumbleweed and green #2052
Conversation
b64d099
to
817021c
Compare
pkg/features/embedded/cloud-config-defaults/system/oem/04_accounting.yaml
Outdated
Show resolved
Hide resolved
817021c
to
3dcc2d3
Compare
@davidcassany FYI on Tumbleweed a |
6588e72
to
40a71de
Compare
56debcf
to
b748a92
Compare
Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
54a4fa4
to
67b94f9
Compare
Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
67b94f9
to
2fb783e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, this should be enough to start experimenting with selinux in the cluster provisioning!
contextFile := filepath.Join(rootDir, cnst.SELinuxTargetedContextFile) | ||
contextExists, _ := utils.Exists(c.Fs, contextFile) | ||
|
||
if err == nil && contextExists && c.Runner.CommandExists("setfiles") { | ||
if contextExists && c.Runner.CommandExists("setfiles") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should check that rootDir is RW as well? might be enough to get the recovery test green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is RW... disable selinux and the test will pass, I believe the snapper error msg is just misleading, it could not write due to some denial, but not because of being RO.
This PR uses SELinux in enforce mode for the active/passive systems and in permissive mode for recovery and ISO systems.
The elemental labelling code changed slightly, basically the change is that now it is also executed as part of the close transaction step once the new root is already rsynced. In addition it also tries to label from the outer system any eventual mountpoint that was labeled in a chroot env (
/dev
,/proc
,/sys
, etc.).Current unsolved issues:
In github actions the host has SELinux enabled and relabeling the new root within a container turns to fail (see build disk and build iso logs in GH)... as a consequence the disk and iso images are not properly labeled, hence they are not really usabled in enforce mode. This does not happen in a host without the
container-selinux
policy module. This has impact on our capability to build ISOs and Disks inside a k8s cluster using unprivileged pods.Running upgrades from the recovery system (
elemental upgrade
command) is not functional if the target is in btrfs. There seams to be an issue with selinux labels when mounting the.snapshots
subvolume preventing snapper to properly operate. One option would be to rethink the btrfs snapshotter env in recovery mode, instead of mounting.snapshots
in<some/root>/.snapshots
just use/.snapshots
so any eventual relabel is done with the appropriate path.Fixes #2054
Signed-off-by: David Cassany [email protected]