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

Relabel presistent paths only at first boot #2080

Merged
merged 2 commits into from
May 15, 2024

Conversation

davidcassany
Copy link
Contributor

@davidcassany davidcassany commented May 14, 2024

With this commit any RW paths gets a marker file added .relabelled to acknowledge this path got relabelled. At relabelling time if this marker file is found the path is omitted at relabelling stage. The idea is to only relabel persistent paths at first boot. This prevents relabelling persistent paths on each boot and gives the opportunity to select which paths to relabel by removing the markers.

Related to rancher/elemental#1417

Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany davidcassany requested a review from a team as a code owner May 14, 2024 15:25
@davidcassany
Copy link
Contributor Author

This is slightly inspired by https://github.com/openSUSE/microos-tools/blob/master/selinux/98selinux-microos/selinux-microos-relabel.sh

I am even wondering if we should expand mount.selinux-relabel config option and instead of making it a boolean, define it as a string and except values like no|once|always or something similar. @frelon what you think?

Signed-off-by: David Cassany <dcassany@suse.com>
Copy link
Contributor

@frelon frelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I was also thinking about putting this in the install-state yaml, but this will probably be more robust!

@davidcassany davidcassany merged commit 3f96b5e into rancher:main May 15, 2024
16 of 17 checks passed
@davidcassany davidcassany deleted the relabel_only_once branch May 15, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants