-
Notifications
You must be signed in to change notification settings - Fork 246
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
selinux: perform relabeling from initrd #846
Conversation
Upstream patch was just merged: https://lore.kernel.org/selinux/20190912133007.27545-1-jlebon@redhat.com/T/#m5f950ca9fc3ed374cb793fc9aed0435602b1b6ad. 🎉 It should be in the 5.5 release. |
d8772fb
to
af99649
Compare
OK rebased this! Since the kernel in FCOS today already supports this, and we have the Still chasing down some bugs and doing some more testing, but works pretty well overall! |
af99649
to
72e876f
Compare
OK, so this is failing on:
Where is |
@jlebon correct, it's built from |
72e876f
to
aa19dad
Compare
OK, reworked this now! The major improvement is that instead of having our own relabeling code, we just use |
This is required by the new relabeling code in Ignition: coreos/ignition#846 (This is another good example of why merging this repo into coreos/ignition would be nicer I think.)
Requires: coreos/ignition-dracut#138 |
That said, there's a higher-level issue for FCOS/RHCOS here: there are other things created from the initramfs that also need to be relabeled. The few things I can think of right now are:
(And I'm sure there are others I'm forgetting.) I think I'll add a tiny helper script to make it easier for those services to invoke |
This is required by the new relabeling code in Ignition: coreos/ignition#846 (This is another good example of why merging this repo into coreos/ignition would be nicer I think.)
aa19dad
to
1c28c5e
Compare
Now that we can relabel from the initrd, we should be able to categorically resolve all SELinux and Ignition issues. Here, we drop the hacky `ignition-relabel.service` and relabel all the files we need to on the spot! Requires: https://lore.kernel.org/selinux/20190819193032.848-1-jlebon@redhat.com/ Closes: coreos#635
Prep for next patch.
This is the final piece in the SELinux + Ignition saga: we need to make sure that both the mount point we create (and any leadings we created too), as well as the root of the filesystem we mount are labeled.
1c28c5e
to
381132f
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.
LGTM, this will break relabeling on anyone using Ignition v2/spec3 that doesn't have the patch, but I don't think anyone is. Plus the patch will make it into their kernels eventually. Maybe add a note in the operator notes section on SELInux?
We now support SELinux natively! Just make a note of this, and point at the kernel patch needed for this to work.
Good idea, done! |
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.
🚢 🇮🇹
Green checkmarks = merging! (Though we should rework CI on this repo soon so it actually runs on FCOS.) |
Now that we can relabel from the initrd, we should be able to
categorically resolve all SELinux and Ignition issues.
Here, we drop the hacky
ignition-relabel.service
and relabel all thefiles we need to on the spot!
Requires: https://lore.kernel.org/selinux/20190819193032.848-1-jlebon@redhat.com/
Closes: #635