Skip to content

Commit

Permalink
Adds a systemd unit to load custom SELinux rules in SCOS
Browse files Browse the repository at this point in the history
This commit implements a systemd unit to apply custom SELinux modules in SCOS shipped as CILs in the read-only /usr/lib/okd/selinux/ folder.

Refers openshift#1555
  • Loading branch information
aleskandro committed Jul 18, 2024
1 parent 0ef712a commit a19f1b3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable okd-selinux.service
12 changes: 12 additions & 0 deletions overlay.d/50scos/usr/lib/systemd/system/okd-selinux.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Apply custom SELinux policies in /usr/lib/okd/selinux/*.cil
Documentation=
Before=network-pre.target

[Service]
Type=oneshot
ExecStart=/usr/bin/find /usr/lib/okd/selinux -type f -name '*.cil' -exec /usr/sbin/semodule -i {} \;
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions overrides-c9s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
# - c9s-appstream-mirror

#packages:

ostree-layers:
- overlay/50scos

0 comments on commit a19f1b3

Please sign in to comment.