rancher / elemental-toolkit

:snowflake: The toolkit to build, ship and maintain cloud-init driven Linux derivatives based on container images
https://rancher.github.io/elemental-toolkit/docs/
Apache License 2.0
288 stars 49 forks source link

SELinux relabel on boot #2069

Closed frelon closed 3 months ago

frelon commented 3 months ago

This commit introduces a new command 'elemental relabel' for relabeling files and directories.

The command is invoked during initramfs stage in the new optional 'selinux' feature.

In essence it writes all ephemeral and persistent directories to /run/systemd/relabel-extra.d/elemental.layout and then runs setfiles in those directories in order to circumvent a bug with overlayfs and selinux copy-up on xattrs.