1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 15:45:53 +01:00

Use a lot more systemd hardening features

Just on general principle.  In particular the combination
of a readonly `/usr` and `WorkingDirectory=/usr`
will give us a consistent clean error if we somehow accidentally
write to the current working directory.
This commit is contained in:
Colin Walters
2020-10-06 09:20:22 -04:00
committed by OpenShift Merge Robot
parent ad52f02935
commit b232b93ea0

View File

@@ -11,7 +11,17 @@ StartLimitBurst=10
Type=notify
Environment=BOOTUPD_VERBOSITY="-v"
ExecStart=/usr/libexec/bootupd daemon $BOOTUPD_VERBOSITY
# On general principle
# This way our working directory isn't writable by default.
WorkingDirectory=/usr
# Various hardening flags just on general principle. We need
# to run as root, but let's avoid accidental damage.
ProtectHome=yes
ReadOnlyPaths=/usr
PrivateTmp=yes
PrivateNetwork=yes
ProtectClock=yes
ProtectHostname=yes
ProtectControlGroups=yes
RestrictSUIDSGID=yes
# So we can remount /boot writable
MountFlags=slave