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

turn arbitrary SELinux booleans on or off at boot #291

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions overlay.d/05core/usr/lib/systemd/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This service is currently specific to CoreOS distros,
# but we may want to add it to the base OS in the future.
# The idea here is to allow users to set SELinux booleans
# without having to modify the on-disk policy, by enabling
# the appropriate systemd service via Ignition
[Unit]
Description=Turn OFF SELinux boolean %I
# We want to run quite early, in particular before anything
# that may require any access permitted by the boolean;
# it may make sense to do this in the initramfs too.
DefaultDependencies=no
After=local-fs.target
Conflicts=setsebool-on@%i.service

[Service]
ExecStart=/usr/sbin/setsebool %i off
Type=oneshot
RemainAfterExit=yes
ExecStop=/usr/sbin/setsebool %i on

[Install]
WantedBy=sysinit.target
22 changes: 22 additions & 0 deletions overlay.d/05core/usr/lib/systemd/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This service is currently specific to CoreOS distros,
# but we may want to add it to the base OS in the future.
# The idea here is to allow users to set SELinux booleans
# without having to modify the on-disk policy, by enabling
# the appropriate systemd service via Ignition
[Unit]
Description=Turn ON SELinux boolean %I
# We want to run quite early, in particular before anything
# that may require any access permitted by the boolean;
# it may make sense to do this in the initramfs too.
DefaultDependencies=no
After=local-fs.target
Conflicts=setsebool-off@%i.service

[Service]
ExecStart=/usr/sbin/setsebool %i on
Type=oneshot
RemainAfterExit=yes
ExecStop=/usr/sbin/setsebool %i off

[Install]
WantedBy=sysinit.target