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
BZ 1956836: overlay: Add rhcos-usrlocal-selinux-fixup.service #551
BZ 1956836: overlay: Add rhcos-usrlocal-selinux-fixup.service #551
Conversation
dc66f57
to
ca53463
Compare
|
Hmm, I think we need this and also temporarily carry https://src.fedoraproject.org/rpms/selinux-policy/pull-request/24 until it makes it into RHEL8. Something like: diff --git a/manifest.yaml b/manifest.yaml
index 4205ec4..30d74f9 100644
--- a/manifest.yaml
+++ b/manifest.yaml
@@ -163,6 +163,18 @@ postprocess:
# NB: we don't use -f here so we break when this is no longer needed
rm -v /etc/iscsi/initiatorname.iscsi
+ # Carry https://src.fedoraproject.org/rpms/selinux-policy/pull-request/24
+ # until it gets into RHEL8. Tracked at https://bugzilla.redhat.com/show_bug.cgi?id=1943381.
+ - |
+ #!/usr/bin/env bash
+ set -xeuo pipefail
+
+ f=/etc/selinux/targeted/contexts/files/file_contexts.subs_dist
+ if ! grep /var/usrlocal $f; then
+ echo "# https://src.fedoraproject.org/rpms/selinux-policy/pull-request/24" >> $f
+ echo "/var/usrlocal /usr/local" >> $f
+ fi
+
etc-group-members:
- wheel
- sudo? This should also allow you to simplify the systemd service to just do |
To fix the (SELinux) user part too with |
|
OK wow I had thought Mmmm. Locally changing policy feels riskier than just having this service run every time. |
ca53463
to
4b53424
Compare
|
OK reworked to always restorecon |
|
The unit test doesn't cover actually injecting binaries via Ignition right now, but I extensively tested this manually too. |
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.
Minor comments, but LGTM generally!
overlay.d/05rhcos/usr/lib/systemd/system/rhcos-usrlocal-selinux-fixup.service
Outdated
Show resolved
Hide resolved
ae96e53
to
d0f2b98
Compare
|
Squashed the suggestions (thanks!) and updated |
I had a similar issue earlier: coreos/ignition#1156 |
tests/kola/misc-ro/misc-ro.sh
Outdated
| @@ -133,6 +133,21 @@ echo "ok iSCSI initiator name" | |||
| systemctl is-enabled logrotate.timer | |||
| echo "ok logrotate" | |||
|
|
|||
| <<<<<<< HEAD | |||
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.
Looks like a broken merge 🙂
A fix is inbound for policy, but we really should fixup existing systems in place.
d0f2b98
to
fb007ee
Compare
Hmm, something to do with the recent repo changes I suppose? /cc @travier |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/hold |
|
/retest |
|
Blocked by openshift/release#18691 🙁 |
|
Should be good to go now but maybe a full retest would be best |
|
/retest |
|
/unhold |
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1956836 Unfortunately right now, executing `bash` skips a domain transition (see fedora-selinux/selinux-policy#778) so the way we're sourcing the script means we stay in `initrc_t` and end up triggering a SELinux policy denial. (BTW this denial turns out to just delay the successful exit of the script, which will then end up just delaying kubelet start. it's otherwise harmless, but we also don't want SELinux policy denials in our product by default) Fix this in two ways: - First, just move the thing to `/usr/local/bin` to avoid issues with labeling of `/usr/local/sbin` that were fixed in openshift/os#551 - Second, rework it to be executed directly While we're here: - Clean the confusing+outdated comment about being a NM dispatcher - Drop the `logger` bit which was only necessary as a NM dispatcher; since we're *always* running under systemd, this makes `journalctl -u node-valid-hostname` actually show the script output. - Make it crystal clear that the "truncate hostname" is only run in GCP. - Fix various typos - Use the more precise term "non-localhost" in various places instead of the more ambiguous terms "real"/"valid"
A fix is inbound for policy, but we really should fixup existing
systems in place.