-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
overlay/mounts: Mount /boot and /boot/efi ro,nodev,nosuid
Ironically ostree has had support for a `ro` boot for a long time, and only more recently did we land the [sysroot readonly](coreos/coreos-assembler#736). But we never actually went and made `/boot` `ro` for FCOS, so let's do it now. This was actually motivated by someone wanting to "security harden" RHCOS running through a checklist saying certain mounts should be `nodev`. Let's add `nosuid` while we're here.
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
#!/bin/bash | ||
exec systemctl is-enabled logrotate.service | ||
systemctl is-enabled logrotate.service | ||
|
||
validate_not_writable_mount() { | ||
local mnt=$1 | ||
shift | ||
findmnt "${mnt}" -o OPTIONS | grep -q ro | ||
if test -w "${mnt}"; then | ||
echo "writable ${mnt}" | ||
exit 1 | ||
fi | ||
} | ||
|
||
validate_not_writable_mount /boot | ||
if test -d /boot/efi; then | ||
validate_not_writable_mount /boot/efi | ||
fi |