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

security hole /boot and /boot/loader/random-seed #527

Closed
i-am-logger opened this issue Feb 2, 2024 · 4 comments · Fixed by #808
Closed

security hole /boot and /boot/loader/random-seed #527

i-am-logger opened this issue Feb 2, 2024 · 4 comments · Fixed by #808
Labels
documentation Issue that would be fixed by proper documentation

Comments

@i-am-logger
Copy link

I'm using disko to setup the partitions of my system via flake.

started to get these warnings recently:

image

the proposed solution without disko is

  fileSystems."/boot" = {
    options = [ "umask=0077" ];
  };

though not sure how to set it with disko

@phaer
Copy link
Member

phaer commented Feb 2, 2024

though not sure how to set it with disko

Exactly the same (if your disko config contains a /boot). Disko does configure the filesystems attribute, but those settings get merged with your own ones via the nixos module system

@Lassulus
Copy link
Collaborator

Lassulus commented Feb 2, 2024

...
partitions = {
  boot = {
    type = "EF00";
    size = "500M";
	content = {
      type = "filesystem";
      format = "vfat";
      mountOptions = [ "umask=0077" ];
      mountpoint = "/boot";
    };
  };
};

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixos-install-with-custom-flake-results-in-boot-being-world-accessible/34555/23

trueNAHO added a commit to trueNAHO/os that referenced this issue Feb 19, 2024
Prevent the random seed file from being world readable to avoid the
following installation warning:

> Mount point '/boot' which backs the random seed file is world
> accessible, which is a security hole!

Related:

- https://discourse.nixos.org/t/34555
- https://discourse.nixos.org/t/37636
- nix-community/disko#527
iFreilicht added a commit that referenced this issue Oct 1, 2024
The alternative would be to do this automatically if format=="vfat" and
mountpoint=="/boot", but it's better to be upfront about this.

Fixes #527
@iFreilicht iFreilicht added the documentation Issue that would be fixed by proper documentation label Oct 1, 2024
iFreilicht added a commit that referenced this issue Oct 1, 2024
The alternative would be to do this automatically if format=="vfat" and
mountpoint=="/boot", but it's better to be upfront about this.

Fixes #527
@mergify mergify bot closed this as completed in #808 Oct 2, 2024
mergify bot pushed a commit that referenced this issue Oct 2, 2024
The alternative would be to do this automatically if format=="vfat" and
mountpoint=="/boot", but it's better to be upfront about this.

Fixes #527
@iFreilicht
Copy link
Contributor

Thank you for pointing this out! All the examples and documentation reflect this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue that would be fixed by proper documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants