Skip to content

πŸ”‘ darkone.security.kernel-params

Dynamic kernel configuration: boot parameters and sysctls (R8–R14). (wip)

Rules applicable without recompiling the kernel. Covers memory options (R8), system sysctls (R9), disabling module loading (R10), Yama/ptrace (R11), IPv4 network sysctls (R12), IPv6 disabling (R13), and filesystem sysctls (R14).

  • enable bool Enable ANSSI dynamic kernel parameters (R8–R14).
  • restrictUserns bool R9: forbid unprivileged user namespaces (user.max_user_namespaces). Breaks Flatpak, bubblewrap and rootless Podman, so it stays opt-in and belongs on servers that run none of them.
  • disableSmt bool R8: turn hyperthreading off. Three parameters carry it; false falls each back to its SMT-preserving form and leaves the other fourteen alone. Note l1tf=full drops SMT even without force β€” it only leaves the sysfs knob behind β€” so the fallback there is flush.
  • memoryDebug bool R8: the allocator extras β€” slub_debug=FZP, page_poison=on and slab_nomerge=yes. None of the three is in the ANSSI R8 list, and page_poison displaces init_on_alloc/init_on_free, which are: the kernel says so at boot, and honours the debug facility instead. Turning it off restores the specified wipe and gives back 7% of a compile (95s to 88s, ms-a2, SMT on).
  • disableIpv6 bool R13: disable IPv6 entirely. Off by default β€” ANSSI itself prefers hardening IPv6 over dropping it, and a public host generally needs it.
darkone.security.kernel-params = {
enable = false;
restrictUserns = false;
disableSmt = true;
memoryDebug = true;
disableIpv6 = false;
};

Source: modules/security/kernel-params.nixΒ πŸ‘•