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

tmpfiles.d/baselayout-etc.conf: Only relabel a minimal set of files #28

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Mar 6, 2023

For now, the systemd-tmpfiles Z rule for SELinux relabeling seems to cause unnecessary upcopies in the /etc overlay.
Restrict the set of files we relabel to the ones created unlabeled by flatcar-tmpfiles.

How to use

Bugfix for #24 hopefully before branching the new Alpha

Testing done

Manual test with

sudo unshare -m
umount /etc
rm -rf /etc/*
mkdir /etc/tmpfiles.d
cat > /etc/tmpfiles.d/baselayout-etc.conf  # and pasting the below (end with ctrl D)
d   /etc                              -   -   -   -   -
Z   /etc/passwd                       -   -   -   -   -
Z   /etc/shadow                       -   -   -   -   -
Z   /etc/group                        -   -   -   -   -
Z   /etc/gshadow                      -   -   -   -   -

Then I rebooted and the upcopies were not coming back and files like /etc/passwd got labeled with system_u:object_r:etc_t:s0

CI started

For now, the systemd-tmpfiles Z rule for SELinux relabeling seems to
cause unnecessary upcopies in the /etc overlay.
Restrict the set of files we relabel to the ones created unlabeled by
flatcar-tmpfiles.
@pothos pothos requested a review from a team March 6, 2023 12:35
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Mar 6, 2023
This pulls in
flatcar/baselayout#28 to fix a regression in
flatcar/baselayout#24 due to how
systemd-tmpfiles' Z rule seems to cause unnecessary changes in files.
@pothos pothos merged commit 9082621 into flatcar-master Mar 6, 2023
@pothos pothos deleted the kai/restrict-relabeling branch March 6, 2023 12:53
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Mar 6, 2023
This pulls in
flatcar/baselayout#28 to fix a regression in
flatcar/baselayout#24 due to how
systemd-tmpfiles' Z rule seems to cause unnecessary changes in files.
t-lo pushed a commit to flatcar/scripts that referenced this pull request Apr 17, 2023
This pulls in
flatcar/baselayout#28 to fix a regression in
flatcar/baselayout#24 due to how
systemd-tmpfiles' Z rule seems to cause unnecessary changes in files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants