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

Mount /boot as RO by default #652

Closed
travier opened this issue Oct 22, 2020 · 7 comments
Closed

Mount /boot as RO by default #652

travier opened this issue Oct 22, 2020 · 7 comments
Assignees
Labels
jira for syncing to jira kind/enhancement

Comments

@travier
Copy link
Member

travier commented Oct 22, 2020

From coreos/fedora-coreos-config#659:

ostree has had support for leaving /boot mounted read-only for a long time: ostreedev/ostree#1767 (And then later extended to /sysroot)

Particularly for CoreOS, only a few things should be touching /boot, and we control all of them. Those projects should create a new mount namespace and remount these partitions writable just while they need it.

The main thing we're accomplishing here is making the system more resilient against accidental damage from a sysadmin
root shell as well as configuration management tools like Puppet/Ansible. None of those should be directly manipulating
files on these partitions, they should go through the API of one of our projects (e.g. rpm-ostree kargs, bootupctl) etc.

While we're here, also andd nodev,nosuid because some OS hardening scanners like to see this. IMO it's of minimal value, but hey, might as well.

From coreos/fedora-coreos-config#407:
> Nothing in the OS touches the ESP by default, so there's no reason to mount it by default, particularly writable. This is good for avoiding wear&tear on the filesystem, but I am specifically doing this as preparation for potentially removing the ESP from AWS images, because AWS ImportImage chokes on its presence: openshift/os#396

See also: coreos/fedora-coreos-config#356

@travier travier added the jira for syncing to jira label Oct 22, 2020
@jlebon
Copy link
Member

jlebon commented Oct 22, 2020

Note this likely has ramifications for kdump as well because it needs to be able to drop the generated initrd in /boot (or maybe this is motivation enough to clean this up and get it to not save into /boot :) ).

@travier
Copy link
Member Author

travier commented Oct 22, 2020

Yes, this is definitely related. kdump support does not requires that the generated initrd lives in /boot so this will indeed require some (should be small) configuration changes.

@travier
Copy link
Member Author

travier commented Dec 7, 2020

Refocusing this issue on /boot RO only. /boot/efi split in #694.

@travier travier changed the title Mount /boot as RO and do not mount /boot/efi Mount /boot as RO Dec 7, 2020
@travier travier changed the title Mount /boot as RO Mount /boot as RO by default Dec 7, 2020
@kelvinfan001
Copy link
Member

I believe FCOS should be ready to mount /boot read-only now that we've addressed everything that needs write access to /boot.

Now just waiting for a new release of bootupd that includes the necessary changes to deal with a read-only /boot before we can merge coreos/fedora-coreos-config#659

@travier travier added the meeting topics for meetings label Dec 9, 2020
@dustymabe
Copy link
Member

We discussed this at the community meeting today.

Mostly information passing that this is coming soon. No real objections to moving forward. It was pointed out that it might be good for the tools that are remounting /boot/ RW in order to operate in it be able to tell the different between the device being mounted RO by policy or it being mounted RO because of drive corruption.

@dustymabe dustymabe removed the meeting topics for meetings label Dec 9, 2020
@travier travier changed the title Mount /boot as RO by default Mount /boot (and /boot/efi) as RO by default Dec 18, 2020
@kelvinfan001
Copy link
Member

coreos/fedora-coreos-config#794 removes the EFI mount. Changing the scope to only /boot.

@kelvinfan001 kelvinfan001 changed the title Mount /boot (and /boot/efi) as RO by default Mount /boot as RO by default Jan 5, 2021
@kelvinfan001
Copy link
Member

coreos/fedora-coreos-config#659 has merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira kind/enhancement
Projects
None yet
Development

No branches or pull requests

4 participants