Skip to content

🔑 darkone.security.filesystem

Partitioning, file tree, and file permissions (R28–R29, R50–R57). (wip)

Covers secure mount options (R28), restriction of /boot (R29), permissions of sensitive files (R50), passwords kept out of the store (R51), sockets (R52), orphan files (R53), sticky bit (R54), per-user temporary directories (R55), and setuid (R56, R57).

  • enable bool Enable ANSSI filesystem hardening (R28–R29, R50–R57).
  • allowedSetuid listOf str Allowlist of tolerated setuid/setgid binaries (R56, R57).
  • tmpfs bool Whether R28 owns /tmp as a hardened tmpfs sized on boot.tmp.tmpfsSize. Set to false to leave /tmp on the filesystem it already lives on — a host keeping several GB of persistent scratch there loses both the data and the RAM otherwise.
  • tmpNoexec bool Whether the R28 /tmp carries noexec. noexec blocks direct execution and dlopen, so it breaks any runtime unpacking native libraries there (Bun, Electron, agent tooling) and anything compiling then running in TMPDIR. Only meaningful when tmpfs is true.
  • extraMountHardening listOf str Mount points to harden with nosuid,nodev,noexec (R28). Each listed path MUST be a separate partition declared elsewhere (hardware- configuration / disko); the options are merged into its existing fileSystems entry. An explicit list (rather than a global flag) avoids guessing the layout and never creates phantom mounts. Do not list /home if users run scripts there — noexec would break them.
darkone.security.filesystem = {
enable = false;
allowedSetuid = [ ];
tmpfs = true;
tmpNoexec = true;
extraMountHardening = [ ];
};

Source: modules/security/filesystem.nix 🡕