Skip to content

⚙ darkone.system.security

ANSSI BP-028 v2.0 (GNU/Linux) system hardening. (wip)

Recommended module, enabled in certain host profiles or manually depending on needs. Progressively applies ANSSI recommendations according to the chosen level and machine category. Each host profile defines its level and category:

darkone.system.security = {
level = "intermediary"; # minimal | intermediary | reinforced | high
category = "server"; # base | client | server
};

Rules incompatible with the environment are excluded by tag:

darkone.system.security.excludes = [ "needs-jit" "needs-hibernation" ];

A specific rule can be bypassed with a mandatory rationale:

darkone.system.security.exceptions = {
R9.rationale = "Docker rootless required during development.";
};
  • enable bool Enable the ANSSI BP-028 v2.0 hardening module.
  • level enum [ "minimal" "intermediary" "reinforced" "high" ] Targeted ANSSI hardening level.
  • category enum [ "base" "client" "server" ] Machine category that selects rule subsets.
  • excludes listOf str Tags that disable entire rule groups.
  • exceptions attrs Per-rule exceptions with mandatory rationale. Merged with the structural SELinux exceptions (R46–R49).
  • adminMailbox str Administrator email address (sudo R39, MTA aliases R75).
  • useHardenedKernel bool Use linuxPackages_hardened (R60, C1) instead of the default kernel.
  • allowedActiveUsers listOf str Human accounts allowed to authenticate (R30). Defaults to every user declared in config.yaml (host.users) plus the framework deploy account nix. Disabled accounts (no password credential) and service accounts (not normal users) need not be listed.
darkone.system.security = {
enable = false;
level = "minimal";
category = "base";
excludes = [ ];
exceptions = { };
adminMailbox = "admin@exemple.fr";
useHardenedKernel = false;
allowedActiveUsers = [ ];
};

Source: modules/system/security.nix 🡕