nix-mineral Options
nix-mineral.enable Link copied!
booleanWhether to enable the nix-mineral module.
falsetrue<nix-mineral/nix-mineral.nix>nix-mineral.extras.entropy.extra-latent-entropy Link copied!
booleanGather more entropy on boot.
Note
Only works with the linux_hardened patchset, which is currently ill advised due to inconsistent updates in nixpkgs. This does nothing if using another kernel. Also slows down boot time by a bit.
falsetruenix-mineral.extras.kernel.warn-panic Link copied!
booleanBe extra paranoid of potential kernel exploitation by inducing kernel panics on kernel warns and above.
Warning
This will cause massive instability in the event of any bugs in the kernel.
falsetrue<nix-mineral/extras/kernel/warn-panic.nix>nix-mineral.extras.misc.apparmor Link copied!
booleanUse an opinionated AppArmor configuration.
Note
This is currently absolutely useless except for compliance, because there are no currently functioning AppArmor profiles! This option exists only for reference sake, once AppArmor is properly fixed to work on NixOS.
falsetrue<nix-mineral/extras/misc/apparmor.nix>nix-mineral.extras.misc.doas-sudo-wrapper Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
This option does not fit the project's current vision. The doas port in NixOS is unmaintained and not recommended for production use.
Creates a wrapper for doas to simulate sudo, with nano to utilize rnano as editor for editing as root.
nulltrue<nix-mineral/extras/misc/doas-sudo-wrapper.nix>nix-mineral.extras.misc.replace-sudo-with-doas Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
This option does not fit the project's current vision. The doas port in NixOS is unmaintained and not recommended for production use.
Replace sudo with doas.
doas has a lower attack surface, but is less audited.
nulltrue<nix-mineral/extras/misc/replace-sudo-with-doas.nix>nix-mineral.extras.misc.ssh-hardening Link copied!
booleanUse an opinionated SSH hardening config. Complies with ssh-audit.
Read what everything does first, or else you might get locked out.
This, for example, prevents root login AND password based login.
falsetrue<nix-mineral/extras/misc/ssh-hardening.nix>nix-mineral.extras.misc.usbguard.enable Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Enable USBGuard, a tool to restrict USB devices.
disable to avoid hassle with handling USB devices at all.
nulltrue<nix-mineral/extras/misc/usbguard.nix>nix-mineral.extras.misc.usbguard.gnome-integration Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Enable USBGuard dbus daemon and add polkit rules to integrate USBGuard with GNOME Shell.
If you use GNOME, this means that USBGuard automatically allows all newly connected devices while unlocked, and blacklists all newly connected devices while locked. This is obviously very convenient, and is similar behavior to handling USB as ChromeOS and GrapheneOS.
nulltrue<nix-mineral/extras/misc/usbguard.nix>nix-mineral.extras.misc.usbguard.whitelist-at-boot Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Automatically allow all connected devices at boot in USBGuard.
If false, USB devices will be blocked until USBGuard is configured.
Note
For laptop users, inbuilt speakers and bluetooth cards may be disabled by USBGuard by default, so whitelisting them manually or enabling this may solve that.
nulltrue<nix-mineral/extras/misc/usbguard.nix>nix-mineral.extras.network.tcp-window-scaling Link copied!
booleanDisable TCP window scaling.
Warning
If false, may help mitigate TCP reset DoS attacks, but
may also harm network performance when at high latencies.
truefalse<nix-mineral/extras/network/tcp-window-scaling.nix>nix-mineral.extras.system.hardened-malloc Link copied!
booleanUse hardened-malloc as default memory allocator for all processes.
Warning
DO NOT USE THIS OPTION ON ANY PRODUCTION SYSTEM! FOR TESTING PURPOSES ONLY!
falsetrue<nix-mineral/extras/system/hardened-malloc.nix>nix-mineral.extras.system.lock-root Link copied!
booleanLock the root account.
Note
Requires another method of privilege escalation, i.e sudo or doas, and declarative accounts to work properly.
falsetrue<nix-mineral/extras/system/lock-root.nix>nix-mineral.extras.system.minimize-swapping Link copied!
booleanReduce swappiness to bare minimum.
May reduce risk of writing sensitive information to disk, but hampers zram performance. Also useless if you do not even use a swap file/partition, i.e zram only setup.
falsetrue<nix-mineral/extras/system/minimize-swapping.nix>nix-mineral.extras.system.secure-chrony Link copied!
booleanReplace systemd-timesyncd with chrony for NTP, and configure chrony for NTS and to use the seccomp filter for security.
falsetrue<nix-mineral/extras/system/secure-chrony.nix>nix-mineral.extras.system.unprivileged-userns Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
This option DOES NOT work on the upstream NixOS kernel. Setting this does nothing because the requisite sysctl does not exist.
Enable or disable unprivileged user namespaces.
It has been the cause of many privilege escalation vulnerabilities,
but can cause breakage. If false, this may break some applications
that rely on user namespaces.
nulltrue<nix-mineral/extras/system/unprivileged-userns.nix>nix-mineral.extras.system.zram Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Enable zram so that memory is more likely to be compressed instead of written to disk, which may include sensitive information.
Improves storage lifespan and overall performance when swapping as a side effect.
Note
Not enabled by default due to interfering with zswap. Additionally, the task of limiting swapping of sensitive data depends highly on the user's individual swapping setup which can't be reliably inferred.
nulltrue<nix-mineral/extras/system/zram.nix>nix-mineral.extras.tmpfiles.etc-nixos Link copied!
booleanSet to true to recursively make all files in /etc/nixos owned and readable
only by root.
/etc/nixos is not owned by root by default, which can be hazardous as
files that are included in the rebuild may be editable by unprivileged
users.
Note
This may have unintended side effects if user state is intentionally
stored in /etc/nixos, and is therefore no longer enabled by default.
falsetrue<nix-mineral/extras/tmpfiles/etc-nixos.nix>nix-mineral.extras.tmpfiles.home Link copied!
booleanSet to true to recursively restrict permissions of /home/$USER so that
only the owner of the directory can access it (the user).
Note
Existing user masks are left untouched. The "~" option provides bitwise masking, so that the permissions are only changed if it the existing value is greater than the masked value.
E.G, a file with the permissions denoted "0644" changes to "0600," because the user permission mask "6" is less than "7" but the "4" for the group and world file mode masks are more than "0"
This may have side effects like obliterating existing executable access mask bits for groups and world.
Warning
This may also have unintended side effects, e.g, root owned files being unreadable if somehow created in a user home directory.
Warning
This may cause recursion/boot speed problems. See:
falsetrue<nix-mineral/extras/tmpfiles/home.nix>nix-mineral.filesystems.enable Link copied!
booleanEnable the filesystem hardening utility from nix-mineral.
truefalse<nix-mineral/nix-mineral.nix>nix-mineral.filesystems.normal Link copied!
attribute set of (submodule)Filesystem hardening.
Sets the device option as <name>,
and the options: "bind", "nosuid", "noexec", "nodev" by default.
Warning
The default filesystem hardening settings make necessary assumptions
about partition layout. That is, that / is one partition, and
/boot or /boot/EFI is another partition.
If using a more exotic partition layout, you may need to account for
this and adjust nix-mineral.filesystems.normal.$/foo/bar/.options."bind"
accordingly, or face potential evaluation issues.
Bind mounts are necessary when a directory is on a shared partition.
Bind mounts must be EXPLICITLY DISABLED when a directory gets its own, dedicated partition, OR when using separate btrfs subvolumes,
Failure to assign bind mounts accordingly may result in failures of the stage 2 activation due to mounts not working as intended.
{ }<nix-mineral/filesystems/normal.nix>nix-mineral.filesystems.normal.<name>.device Link copied!
null or stringLocation of the device.
"‹name›""/dev/sda"<nix-mineral/filesystems/normal.nix>nix-mineral.filesystems.normal.<name>.enable Link copied!
booleanWhether to enable the filesystem mount.
falsetrue<nix-mineral/filesystems/normal.nix>nix-mineral.filesystems.normal.<name>.fsType Link copied!
null or stringFilesystem type of the device. This value must not be null.
"auto""ext4"<nix-mineral/filesystems/normal.nix>nix-mineral.filesystems.normal.<name>.options Link copied!
attribute set of (boolean or signed integer or string)Options used to mount the file system.
If the value is false, the option is disabled.
If the value is an integer or a string, it is passed as "name=value".
Note
The "noexec" mount option is trivially bypassable through the use
of interpreters, such as python3 that are located in the filesystem,
including in the /nix/store which is world readable.
"noexec" should not be relied upon to fully prevent unwanted code
execution without assuring that interpreters are made unavailable,
such as through the use of a sandbox to prevent unrestricted access
to the /nix/store and other program directories except where absolutely
necessary, and to drop permissions to reduce the potential impact of code
execution within said sandbox.
Where this is not the case, this should only be considered as a highly fragile effort against extremely primitive attacks and accidental damage.
See: https://www.chromium.org/chromium-os/developer-library/guides/security/noexec-shell-scripts/
{
bind = true;
nodev = true;
noexec = true;
nosuid = true;
}{
bind = false;
nodev = false;
noexec = false;
nosuid = false;
}<nix-mineral/filesystems/normal.nix>nix-mineral.filesystems.special Link copied!
attribute set of (submodule)Special Filesystem hardening.
Sets the option "noexec" by default.
{ }<nix-mineral/filesystems/special.nix>nix-mineral.filesystems.special.<name>.device Link copied!
null or stringLocation of the device.
null"/dev/sda"<nix-mineral/filesystems/special.nix>nix-mineral.filesystems.special.<name>.enable Link copied!
booleanWhether to enable the filesystem mount.
falsetrue<nix-mineral/filesystems/special.nix>nix-mineral.filesystems.special.<name>.options Link copied!
attribute set of (boolean or signed integer or string)Options used to mount the file system.
If the value is false, the option is disabled.
If the value is an integer or a string, it is passed as "name=value".
{
noexec = true;
}{
hidepid = 4;
noexec = false;
}<nix-mineral/filesystems/special.nix>nix-mineral.kernel-modules.blacklist Link copied!
open submodule of attribute set of booleanBlacklist kernel modules to prevent them from being loaded automatically at boot, but it can still be loaded afterwards.
{ }{
example-blacklisted-module = true;
}<nix-mineral/kernel-modules/blacklist.nix>nix-mineral.kernel-modules.disable Link copied!
open submodule of attribute set of booleanDisable kernel modules to prevent them from being loaded at all.
Note
This method does not register as a regular blacklist, this might cause issues with kernel module auditing e.g using Lynis. If so, you'll need to generate a whitelist.
{ }{
example-disabled-module = true;
}<nix-mineral/kernel-modules/disable.nix>nix-mineral.kernel-modules.disable.algif-related Link copied!
booleanAlgif related kernel modules.
The existence of AF_ALG has been criticized for a long time, and has been the source of multiple vulnerabilities such as CVE-2026-31431.
With the exception of iwd, AF_ALG is practically only used in some unspecified rare and bespoke applications meant for embedded systems, so normally you can disable this without any consequences.
By default, this will prevent AF_ALG related kernel modules from loading if iwd is not enabled.
!networking.wireless.iwd.enabletrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.automotive-related Link copied!
booleanDisable kernel modules related to automotive/industrial.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.bluetooth-related Link copied!
booleanDisable kernel modules related to bluetooth-related.
falsetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.cdrom-related Link copied!
booleanDisable kernel modules related to cdrom.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.dvb-and-tv-receivers Link copied!
booleanDisable kernel modules related to DVB and TV receivers.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.esp4-and-esp6 Link copied!
booleanDisable kernel modules related to esp4 and esp6. They provide support for Encapsulating Security Payload, part of IPSec.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.firewire-related Link copied!
booleanDisable kernel modules related to firewire, as it uses DMA which could be used in a DMA attack.
Note
See:
- https://en.wikipedia.org/wiki/DMA_attack
- https://eclypsium.com/research/direct-memory-access-attacks-a-walk-down-memory-lane/
- https://emb3d.mitre.org/threats/TID-107.html
This option disables kernel modules from the
secureblue kernel modules list.
This excludes the modules: thunderbolt and thunderbolt_net.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.gnss-related Link copied!
booleanDisable kernel modules related to GNSS.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.gpib-related Link copied!
booleanDisable kernel modules related to GPIB.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.intelme-related Link copied!
booleanIntel ME related kernel modules.
Disable this to avoid putting trust in the highly privilege ME system, but there are potentially other consequences.
Tip
If you use an AMD system, you can disable this without negative consequence and reduce attack surface.
Note
Intel users should read more about the issue at the below links:
- https://www.kernel.org/doc/html/latest/driver-api/mei/mei.html
- https://en.wikipedia.org/wiki/Intel_Management_Engine#Security_vulnerabilities
- https://www.kicksecure.com/wiki/Out-of-band_Management_Technology#Intel_ME_Disabling_Disadvantages
- https://github.com/Kicksecure/security-misc/pull/236#issuecomment-2229092813
- https://github.com/Kicksecure/security-misc/issues/239
falsetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.ipsec-related Link copied!
booleanDisable kernel modules related to IPSec.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.joystick-drivers Link copied!
booleanDisable kernel modules related to joystick drivers.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.kernel-debugging-related Link copied!
booleanDisable kernel modules related to kernel debugging/development.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.l2tp-related Link copied!
booleanDisable kernel modules related to l2tp (depends on IPSec).
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.legacy-digital-cameras Link copied!
booleanDisable kernel modules related to legacy digital cameras (pre-2010). This often refers to point-and-shoot digital cameras predating USB webcams, e.g. Kodak EZ200, Fujifilm FinePix F402, etc..
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.legacy-interfaces Link copied!
booleanDisable kernel modules related to legacy interfaces.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.radio-tuners Link copied!
booleanDisable kernel modules related to radio tuners.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.rdma-related Link copied!
booleanDisable kernel modules related to RDMA.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.remote-controls Link copied!
booleanDisable kernel modules related to remote controls.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.secureblue-additional Link copied!
booleanDisable additional kernel modules from the secureblue kernel modules list that are not covered by other options.
Note
This option disables kernel modules from the secureblue kernel modules list:
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.thunderbolt-related Link copied!
booleanDisable kernel modules related to thunderbolt, as it uses DMA which could be abused in a DMA attack.
Note
See:
Note
Thunderbolt may be necessary for proper suspend function on modern laptops. If thunderbolt is not enabled, suspend may consume abnormal amounts of power.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.unused-filesystems Link copied!
booleanDisable kernel modules related to commonly unused filesystems.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.unused-network-protocols Link copied!
booleanDisable kernel modules related to commonly unused network protocols.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.disable.xfrm-related Link copied!
booleanDisable kernel modules related to xfrm, another part of IPSec involved in related exploits.
Note
This option disables kernel modules from the secureblue kernel modules list.
truetrue<nix-mineral/kernel-modules/combos/disable.nix>nix-mineral.kernel-modules.enable Link copied!
booleanEnable the kernel module hardening utility from nix-mineral.
Note
Disabling this option will ignore all options related to kernel modules (under nix-mineral.kernel-modules).
If your goal is to disable kernel module loading, you probably want to disable nix-mineral.kernel-modules.load instead.
truefalse<nix-mineral/nix-mineral.nix>nix-mineral.kernel-modules.load Link copied!
booleanAllow loading of kernel modules at runtime (i.e, modules not explicitly defined in boot.kernelModules or on the kernel commandline).
An alternative implementation is available as the upstream NixOS option security.lockKernelModules,
which may/may not reduce breakage by altering the exact moment kernel modules are
locked in the boot process.
Warning
If false, very likely to cause breakage unless you can compile a list of every module
you need and add that to your boot parameters manually.
truefalse<nix-mineral/kernel-modules/load.nix>nix-mineral.preset Link copied!
one of "default", "compatibility", "maximum", "performance" or list of (one of "default", "compatibility", "maximum", "performance")The preset (or presets) to use for the nix-mineral module. (all presets are applied on top of the default preset)
To select multiple presets, provide a list of preset names.
The order of presets matters, the top ones will receive higher priority values, meaning that presets LOWER in the list are prioritized.
See: https://nixos.org/manual/nixos/stable/#sec-option-definitions-setting-priorities
default: only default settings.compatibility: disables or enables settings to aim at compatibility.maximum: enables every optional security setting to have maximum protection.performance: disables or enables settings to aim at performance.
"default"[
"compatibility"
"performance"
]<nix-mineral/presets/default.nix>nix-mineral.settings.debug.coredump Link copied!
booleanEnable core dumps everywhere.
Core dumps contain a programs memory, usually after a crash, which could include sensitive information including encryption keys being written to the disk without any protection.
If false, this disables core dumps using a combination of sysctl, PAM, and
systemd. These are grouped together, because the disablement of
any individual one of these might otherwise make available a bypass.
Note
You might need core dumps when debugging crashing programs.
falsetrue<nix-mineral/settings/debug/coredump.nix>nix-mineral.settings.debug.debugfs Link copied!
booleanEnable/disable the Linux debugfs, which exposes a lot of possibly sensitive information.
falsetrue<nix-mineral/settings/debug/debugfs.nix>nix-mineral.settings.debug.dmesg-restrict Link copied!
booleanOnly allow users with root privileges or CAP_SYSLOG to use dmesg.
truefalse<nix-mineral/settings/debug/dmesg-restrict.nix>nix-mineral.settings.debug.efipstore Link copied!
booleanIf set to false, Disable both the EFI persistent storage feature and Error Record Serialization Table (ERST) support as a form of defense-in-depth.
This prevents the kernel from writing crash logs and other persistent data to the storage backend.
falsetrue<nix-mineral/settings/debug/efipstore.nix>nix-mineral.settings.debug.kptr-restrict Link copied!
booleanDisplay all kernel pointers as 0s regardless of user privileges when printed.
This may interfere with specific diagnostic and performance profiling tools.
truefalse<nix-mineral/settings/debug/kptr-restrict.nix>nix-mineral.settings.debug.panic-reboot Link copied!
booleanForce the system to automatically reboot upon kernel panic instead of freezing.
This helps to mitigate denial of service attacks by automatically recovering and also prevents the capture of information presented by a kernel panic screen which may be useful to an attacker due to leaking memory addresses.
This may inhibit debugging kernel panics, since the immediate reboot prevents immediate analysis of error messages which may be displayed.
truefalse<nix-mineral/settings/debug/panic-reboot.nix>nix-mineral.settings.debug.quiet-boot Link copied!
booleanIf set to true, minimize information displayed during boot to reduce information available to an attacker.
truefalse<nix-mineral/settings/debug/quiet-boot.nix>nix-mineral.settings.debug.restrict-printk Link copied!
booleanSupress kernel messages via printk to only display log level 3 (error) messages or higher, e.g, more severe warnings.
This limits access to debugging information which can be used by an attacker.
truefalse<nix-mineral/settings/debug/restrict-printk.nix>nix-mineral.settings.entropy.aslr Link copied!
booleanEnsure ASLR is enabled. This should normally be the default on modern kernel versions but is set directly for explicitness.
Randomize the locations of the stack, VDSO page, mmap base, as well as randomizing the heap to make it harder to guess the addresses of key locations in memory for the purpose of exploitation.
Should be unlikely to cause breakage according to upstream documentation, unless using "ancient" applications.
Note
Read more about ASLR at the following links:
truefalse<nix-mineral/settings/entropy/aslr.nix>nix-mineral.settings.entropy.aslr-max-bits Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Use the maximum number of bits of entropy to address space layout randomization, a widely used mitigation against memory exploits.
Note
The values used here are currently only valid for x86_64.
Other CPU architectures may require different numbers here, consult upstream documentation as necessary.
nulltrue<nix-mineral/settings/entropy/aslr-max-bits.nix>nix-mineral.settings.entropy.hwrng Link copied!
booleanDisable "trusting" both the CPU's hardware random number generator and any entropy seed passed to the bootloader.
We assume the hardware random number generation could be flawed or buggy, but that the firmware is not actively malicious, since that is outside scope and you'd have bigger problems at that point.
Note
Setting to false may slow down boot times because boot will not proceed until adequate entropy has been acquired, and the process cannot be expedited by the CPU directly.
See:
Note
The use of RDRAND is not disabled by setting this option to false.
Trust, in this context, refers to whether a source is credited as being completely reliable by itself.
RDRAND is still used to supplement /dev/random but refusing to credit it
means that it cannot unblock the use of /dev/random when used alone.
This means that we do not allow RDRAND to be the only entropy source (which would only be the case in very early boot) before allowing cryptographic operations to occur.
Injecting even very bad entropy sources into an otherwise good pool isn't
supposed to be harmful, given that entropy mixing works as expected and
there is at least one other "good" source available. There's a reason why
/dev/random is read-write to world.
See:
- https://privsec.dev/posts/linux/desktop-linux-hardening/#entropy-generation
- https://madaidans-insecurities.github.io/guides/linux-hardening.html#rdrand
- https://github.com/NixOS/nixpkgs/pull/165355
- https://github.com/QubesOS/qubes-issues/issues/6941
- https://cateee.net/lkddb/web-lkddb/RANDOM_TRUST_CPU.html
- https://arxiv.org/abs/2312.03369
falsetrue<nix-mineral/settings/entropy/hwrng.nix>nix-mineral.settings.entropy.jitterentropy Link copied!
booleanEnable jitterentropy with both the daemon and the kernel module to provide additional entropy and compensate for distrusted hardware entropy sources.
Note
Read more about why at:
- https://github.com/smuellerDD/jitterentropy-rngd/issues/27
- https://blogs.oracle.com/linux/post/rngd1
- https://github.com/Kicksecure/security-misc/commit/fe1f1b73a77d11c136cedcdb3efcb57f4c68c6af
- https://github.com/secureblue/secureblue/issues/173
- https://gitlab.alpinelinux.org/alpine/aports/-/work_items/9960
truefalse<nix-mineral/settings/entropy/jitterentropy.nix>nix-mineral.settings.etc.generic-machine-id Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Set machine-id to the Kicksecure machine-id, for privacy reasons.
Warning
This may have unintended consequences if machine-id needs to be unique, e.g for log collection or VM management.
nulltrue<nix-mineral/settings/etc/generic-machine-id.nix>nix-mineral.settings.etc.kicksecure-bluetooth Link copied!
booleanBorrow Kicksecure bluetooth configuration for better bluetooth privacy and security.
Disables bluetooth automatically when not connected to any device.
truefalse<nix-mineral/settings/etc/kicksecure-bluetooth.nix>nix-mineral.settings.etc.kicksecure-gitconfig Link copied!
booleanBorrow Kicksecure gitconfig, disabling git symlinks and enabling fsck by default for better git security.
truefalse<nix-mineral/settings/etc/kicksecure-gitconfig.nix>nix-mineral.settings.etc.kicksecure-issue Link copied!
booleanBorrow Kicksecure banner/issue.
Provides NO exploit resistance whatsoever, only serves as a deterrent to unauthorized access and to comply with Lynis.
There are no assurances that anything stated here is legally valid.
truefalse<nix-mineral/settings/etc/kicksecure-issue.nix>nix-mineral.settings.etc.kicksecure-module-blacklist Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Borrow Kicksecure module blacklist.
"install "foobar" /bin/false" prevents the module from being
loaded at all. "blacklist "foobar" prevents the module from being
loaded automatically at boot, but it can still be loaded afterwards.
Because the "install /bin/false" method does not register as a regular
blacklist, this might cause issues with kernel module auditing e.g
using Lynis. If so, you'll need to generate a whitelist.
Warning
This may have unintended consequences if you require specific drivers, and may cause breakage.
nulltruenix-mineral.settings.etc.no-root-securetty Link copied!
booleanUse an empty /etc/securetty to prevent root login on tty.
Warning
If set to true, logging in as the root user will fail and throw an error: "Login incorrect"
truefalse<nix-mineral/settings/etc/no-root-securetty.nix>nix-mineral.settings.kernel.amd-iommu-force-isolation Link copied!
booleanSet amd_iommu=force_isolation kernel parameter.
If you're not using an AMD CPU, this does nothing and can be safely ignored.
Warning
You may need to set this to false as a workaround for a boot hanging issue on Linux kernel 6.13.
truefalsenix-mineral.settings.kernel.bdev-write-mount Link copied!
booleanIf set to false, prevent runaway privileged processes from writing to block devices to protect against runaway privileged processes causing filesystem corruption and kernel crashes.
falsetrue<nix-mineral/settings/kernel/bdev-write-mount.nix>nix-mineral.settings.kernel.binfmt-misc Link copied!
booleanEnable binfmt_misc.
Set to false to disable binfmt. This option is inert if nothing has registered with binfmt before writing the sysctl.
If /proc/sys/fs/binfmt_misc is an empty directory, that means that
nothing is currently using binfmt_misc. If it is not empty, consider
checking your system for what may be using it and consider if the
requisite functionality is necessary for your usecase.
Warning
If false, breaks applications that register with binfmt, such as
Wine, Java, or AppImages if support is enabled.
See:
Note
For more information, read more at the following links:
falsetrue<nix-mineral/settings/kernel/binfmt-misc.nix>nix-mineral.settings.kernel.busmaster-bit Link copied!
booleanEnable busmaster bit at boot, which may prevent some DMA attacks in the period where there the firmware IOMMU is no longer active and the kernel IOMMU has not yet fully initialized.
Warning
If false, this may prevent systems with low resource OR specific
firmware configurations from booting.
May worsen performance as a side effect.
See:
falsetrue<nix-mineral/settings/kernel/busmaster-bit.nix>nix-mineral.settings.kernel.core-pid Link copied!
booleanEnsure PID is included in core dumps if those are reenabled, otherwise, this does nothing.
If hideproc is enabled, this prevents some substitution attacks designed to obtain sensitive information by predicting PIDs and inducing core dumps.
Otherwise, this is still nice to have for forensic purposes/log analysis, so that sources of core dumps are more obvious.
truefalse<nix-mineral/settings/kernel/core-pid.nix>nix-mineral.settings.kernel.cpu-mitigations Link copied!
one of "smt-off", "smt-on", "unspecified", "off"Apply relevant CPU exploit mitigations, May harm performance.
smt-off: Enable CPU mitigations and disables symmetric multithreading.smt-on: Enable symmetric multithreading and just use default CPU mitigations, to potentially improve performance.unspecified: Do nothing and use NixOS defaults.
Warning
Turning all CPU mitigations off completely is a TERRIBLE idea. Even the most robustly sandboxed and restricted code in the world can instantly rootkit your computer. One web page is all it takes for all your keys to be someone else's: https://leaky.page/
Warning
Simultaneous multithreading has a lesser impact on security compared to disabling all mitigations but still possesses a significant history of vulnerabilities.
See: https://www.mail-archive.com/source-changes@openbsd.org/msg99141.html https://docs.oracle.com/en/operating-systems/oracle-linux/notice-smt/#notice_description https://github.com/advisories/GHSA-3rjg-j575-7f6p https://github.com/bbbrumley/portsmash
Warning
The "off" option is deprecated and instead has the same effect has "unspecified," and is scheduled to be removed in a later release.
"smt-off"<nix-mineral/settings/kernel/cpu-mitigations.nix>nix-mineral.settings.kernel.harden-bpf Link copied!
booleanHarden eBPF against JIT spraying attacks, to reduce the risk of abuse because eBPF allows executing potentially dangerous code in the kernel.
truefalse<nix-mineral/settings/kernel/harden-bpf.nix>nix-mineral.settings.kernel.hardened-usercopy Link copied!
booleanEnsure hardened usercopy checking is enabled at boot, to proactively check
and protect against exploits involving abuse of the copy_to_user() and
copy_from_user() functions in the kernel to read and write memory beyond
intended boundaries.
truefalse<nix-mineral/settings/kernel/hardened-usercopy.nix>nix-mineral.settings.kernel.intel-iommu Link copied!
booleanExplicitly enable intel IOMMU to reduce risk of DMA attacks and other memory abuse.
Note
Does nothing if you don't use an intel processor.
truefalse<nix-mineral/settings/kernel/intel-iommu.nix>nix-mineral.settings.kernel.io-uring Link copied!
booleanSet to false to disable io_uring, as it is the cause of many vulnerabilities, and is disabled on Android + ChromeOS.
This may be desired for specific environments depending on asynchronous I/O for performance, such as enterprise databases or high performance networking; consult upstream documentation on whether io_uring is necessary for your workload.
falsetrue<nix-mineral/settings/kernel/io-uring.nix>nix-mineral.settings.kernel.iommu-passthrough Link copied!
booleanEnable or disable bypassing the IOMMU for direct memory access.
Could increase I/O performance on ARM64 systems, with risk.
If false, forces DMA to go through IOMMU to mitigate some DMA attacks.
falsetrue<nix-mineral/settings/kernel/iommu-passthrough.nix>nix-mineral.settings.kernel.kcfi Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
This option does nothing on the upstream NixOS kernel because it is not compiled with clang CFI. The benefits of kCFI compared to FineIBT are disputed.
If set to true, switch (back) to using kCFI as the default Control Flow Integrity (CFI) implementation as kCFI mandates hash validation at the source making it more difficult to bypass.
This is in contrast to FineIBT which was made the default in kernel 6.2 due to its performance benefits as it only performs hash checks at the destinations.
nulltrue<nix-mineral/settings/kernel/kcfi.nix>nix-mineral.settings.kernel.kexec Link copied!
booleanPrevent replacing the running kernel with kexec for security reasons.
On other distributions, kexec is most notably used for updating the Linux kernel without rebooting, however, NixOS does not support this.
A comprehensive list of usecases is not feasible, but consider consulting the following references as well as upstream documentation where necessary:
falsetrue<nix-mineral/settings/kernel/kexec.nix>nix-mineral.settings.kernel.kfence Link copied!
booleanIf set to true, ensure the kernel "Electric-Fence" sampling-based memory safety errordetect is enabled, if available, to detect heap out-of-bounds access, use-after-free, and invalid-free errors.
truefalse<nix-mineral/settings/kernel/kfence.nix>nix-mineral.settings.kernel.lockdown Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Enable linux kernel lockdown, this blocks loading of unsigned kernel modules and breaks hibernation.
Note
This currently does nothing as the default NixOS kernel config does not enable Linux kernel lockdown as of 16/03/26.
See: https://github.com/NixOS/nixpkgs/blob/baeac6edff1b03f0ecd063b8fe48e9742d0527e7/pkgs/os-specific/linux/kernel/common-config.nix#L830 https://github.com/cynicsketch/nix-mineral/issues/125
If false, you probably want to disable nix-mineral.settings.kernel.only-signed-modules.
nulltrue<nix-mineral/settings/kernel/lockdown.nix>nix-mineral.settings.kernel.only-signed-modules Link copied!
null or booleanWarning
THIS OPTION IS NOW DEPRECATED. INFORMATION BELOW IS RETAINED FOR FUTURE REFERENCE, AND THIS OPTION IS SCHEDULED TO BE REMOVED PENDING THE NEXT RELEASE.
Requires all kernel modules to be signed. This prevents out-of-tree kernel modules from working unless signed.
Note
This currently does nothing as the default NixOS kernel config does not enable Linux kernel lockdown as of 16/03/26.
See: https://github.com/NixOS/nixpkgs/blob/baeac6edff1b03f0ecd063b8fe48e9742d0527e7/pkgs/os-specific/linux/kernel/common-config.nix#L830 https://github.com/cynicsketch/nix-mineral/issues/125
If false, nix-mineral.settings.kernel.lockdown must also be false.
nulltruenix-mineral.settings.kernel.oops-panic Link copied!
booleanIntentionally induce kernel panics on "oops" errors and above, to limit the extent of certain exploits which trigger kernel oopses.
Warning
This might cause stability issues with certain poorly written drivers that aren't malicious. If you experience random kernel panics, consider disabling this.
truefalse<nix-mineral/settings/kernel/oops-panic.nix>nix-mineral.settings.kernel.page-alloc-shuffle Link copied!
booleanMake page allocations less predicatable by randomizing freelists.
Tip
This is one of the few things which IMPROVES performance as a side effect, and there's usually no reason to disable this.
truefalse<nix-mineral/settings/kernel/page-alloc-shuffle.nix>nix-mineral.settings.kernel.perf-subsystem.restrict-access Link copied!
booleanRestrict perf subsystem access to reduce attack surface.
truefalse<nix-mineral/settings/kernel/perf-subsystem.nix>nix-mineral.settings.kernel.perf-subsystem.restrict-usage Link copied!
booleanRestrict perf subsystem usage (activity) to reduce attack surface.
Note
See https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html for more information.
truefalse<nix-mineral/settings/kernel/perf-subsystem.nix>nix-mineral.settings.kernel.pti Link copied!
booleanEnable Page Table Isolation (PTI) to mitigate some KASLR bypasses and the Meltdown CPU vulnerability. It may also tax performance.
Note
While AMD processors and newer Intel processors are not affected by Meltdown, keeping PTI anyways is still helpful as defense in depth against known and unknown side channel attacks upon KASLR.
See:
truefalse<nix-mineral/settings/kernel/pti.nix>nix-mineral.settings.kernel.randomize-kstack-offset Link copied!
booleanRandomize the kernel's stack offset on every syscall, to make attacks relying on predicting the location of the kernel's stack more difficult.
truefalsenix-mineral.settings.kernel.restrict-bpf Link copied!
booleanRestrict eBPF to CAP_BPF in order to prevent abuse by unprivileged users.
truefalse<nix-mineral/settings/kernel/restrict-bpf.nix>nix-mineral.settings.kernel.restrict-line-disciplines Link copied!
booleanRestrict TTY line discipline loading to CAP_SYS_MODULE to prevent unprivileged users from loading insecure line disciplines.
Note
See https://a13xp0p0v.github.io/2017/03/24/CVE-2017-2636.html as an example exploit.
truefalsenix-mineral.settings.kernel.slab-debug Link copied!
booleanSet to true to modify the "slab_debug" boot parameter to enable red zoning and sanity checks to detect memory corruption.
Adds significant overhead to memory allocation.
This option is automatically enabled if the kernel version defined in boot.kernelPackages is at least 6.17, to ensure that pointer hashing can stay enabled.
Warning
Because this is a debugging option, it will disable kernel pointer hashing and leak kernel memory addresses to root unless the "hash_pointers=always" parameter is used, which is only supported on kernel version 6.17 and above. Otherwise, "hash_pointers" is silently ignored.
l.versionAtLeast config.boot.kernelPackages.kernel.version "6.17"false<nix-mineral/settings/kernel/slab-debug.nix>nix-mineral.settings.kernel.slab-merging Link copied!
booleanSet to false to disable slab merging to make it harder to influence the slab cache layout and compartmentalize the damage of certain memory attacks by limiting influence to individual caches.
falsetrue<nix-mineral/settings/kernel/slab-merging.nix>nix-mineral.settings.kernel.strict-iommu Link copied!
booleanEnable and force the IOMMU to be used to reduce the risk of DMA attacks, and strictly invalidate TLBs to prevent abuse of stale data.
truefalse<nix-mineral/settings/kernel/strict-iommu.nix>nix-mineral.settings.kernel.sysrq Link copied!
one of "none", "off", "sak"Control the magic SysRq key functionality of the Linux kernel.
It is a 'magical' key combo you can hit which the kernel will respond to regardless of whatever else it is doing, unless it is completely locked up.
SysRq has been subjected to several vulnerabilities, and should be disabled if it is not neccessary or used.
none: Keep the default configuration of your kernel.off: Disables sysrq completely.sak: Enable SAK (Secure Attention Key).
Note
Some examples of vulnerabilites are detailed below:
Note
SAK prevents keylogging, if used correctly. See:
"off"<nix-mineral/settings/kernel/sysrq.nix>nix-mineral.settings.kernel.tiocsti Link copied!
booleanIf false, disable TIOCSTI because it's used to inject arbitrary
characters and potentially lead to privilege escalation.
Already disabled by default on modern (>=6.2) Linux kernel versions, but included for future reference.
May break outdated screen readers relying on legacy functionality, but because of the above reasoning, this will never be considered for the compatibility preset.
falsetrue<nix-mineral/settings/kernel/tiocsti.nix>nix-mineral.settings.kernel.unprivileged-userfaultfd Link copied!
booleanIf set to false, limit access to userfaultfd() syscall to the CAP_SYS_PTRACE capability.
userfaultfd has been used for use-after-free exploits in the past.
falsetruenix-mineral.settings.kernel.vdso32 Link copied!
booleanIf set to false, disable 32-bit Virtual Dynamic Shared Object (vDSO) mappings as these are a legacy compatibility feature for superseded glibc versions.
falsetrue<nix-mineral/settings/kernel/vdso32.nix>nix-mineral.settings.kernel.vsyscall Link copied!
booleanIf set to false, Disable vsyscalls, which are obsolete and create static memory locations that are easy to exploit.
falsetrue<nix-mineral/settings/kernel/vsyscall.nix>nix-mineral.settings.kernel.zero-alloc Link copied!
booleanZero memory during both allocation and free time to help mitigate use-after-free exploits.
truefalse<nix-mineral/settings/kernel/zero-alloc.nix>nix-mineral.settings.misc.bootloader-editor Link copied!
booleanSet to false to disable bootloader editors, to prevent access to the root shell or otherwise weakening security by tampering with boot parameters.
Note
This currently does nothing if you don't use systemd-boot.
Consider filing a PR if/when similar configuration for other bootloaders can be added unobtrusively.
falsetrue<nix-mineral/settings/misc/bootloader-editor.nix>nix-mineral.settings.misc.dnssec Link copied!
booleanMake DNS connections fail if not using a DNS server supporting DNSSEC.
Note
Currently does nothing if you don't use systemd-resolved.
Consider filing a PR if/when similar configuration for other DNS resolving software can be added unobtrusively.
truefalse<nix-mineral/settings/misc/dnssec.nix>nix-mineral.settings.misc.nix-wheel Link copied!
booleanLimit access to nix commands to users with the "wheel" group ("sudoers").
If false, may be useful for allowing a non-wheel user to, for example, use devshell.
truefalse<nix-mineral/settings/misc/nix-wheel.nix>nix-mineral.settings.network.arp.announce Link copied!
booleanAlways use the best local address for announcing local IP via ARP.
Seems to be most restrictive option.
truefalse<nix-mineral/settings/network/arp.nix>nix-mineral.settings.network.arp.drop-gratuitous Link copied!
booleanDrop Gratuitous ARP frames to prevent ARP poisoning.
This can cause issues when ARP proxies are used in the network.
truefalse<nix-mineral/settings/network/arp.nix>nix-mineral.settings.network.arp.filter Link copied!
booleanEnable ARP filtering in the kernel to prevent the Linux kernel from handling the ARP table globally and mitigate some ARP spoofing and ARP cache poisoning attacks.
truefalse<nix-mineral/settings/network/arp.nix>nix-mineral.settings.network.arp.ignore Link copied!
one of "none", "local", "link"Ignore/don't reply to specific ARP requests to limit scope of ARP spoofing.
This may break certain VM networking configurations if set to 'link,' which can be fixed by setting to 'local' or 'none.'
However, such a regression has been intentionally excluded from the compatibility preset unless new information or usecases are made apparent, given that this issue appears to be isolated to niche setups which NixOS is not known or advisable to be used for.
none: Keep the default configuration of your kernel.local: Reply only if the target IP address is within the local address range configured on the incoming interfacelink: Reply only if the target IP is on the same link.
Note
See:
- https://docs.kernel.org/networking/ip-sysctl.html
- https://github.com/Kicksecure/security-misc/pull/279
- https://github.com/Kicksecure/security-misc/pull/290
- https://github.com/QubesOS/qubes-issues/issues/9990
- https://github.com/mullvad/mullvadvpn-app/blob/main/audits/2024-12-10-X41-D-Sec.md#mllvd-cr-24-03-virtual-ip-address-of-tunnel-device-leaks-to-network-adjacent-participant-severity-medium
- https://github.com/mullvad/mullvadvpn-app/pull/7141
"link"<nix-mineral/settings/network/arp.nix>nix-mineral.settings.network.icmp.cast Link copied!
booleanSet to false to ignore all ICMPv6 and ICMPv4 echo and timestamp requests sent to broadcast/multicast/anycast.
Makes system slightly harder to enumerate on a network.
::: .{note}
Redundant with nix-mineral.settings.network.icmp.ignore-all enabled.
:::
falsetrue<nix-mineral/settings/network/icmp.nix>nix-mineral.settings.network.icmp.ignore-all Link copied!
booleanSet to true to ignore all ICMPv6 and ICMPv4 echo and timestamp requests.
Makes system slightly harder to enumerate on a network.
You will not be able to ping this computer with ICMP packets if this is enabled.
truefalse<nix-mineral/settings/network/icmp.nix>nix-mineral.settings.network.icmp.ignore-bogus Link copied!
booleanIgnore bogus ICMP error responses to reduce potential system impact caused by spammed error responses.
truefalse<nix-mineral/settings/network/icmp.nix>nix-mineral.settings.network.icmp.redirect Link copied!
booleanSet to false to disable ICMP redirects to prevent some MITM attacks.
::: .{note} See:
falsetrue<nix-mineral/settings/network/icmp.nix>nix-mineral.settings.network.icmp.secure-redirect Link copied!
booleanUse secure ICMP redirects by default.
Note
Helpful only if nix-mineral.settings.network.icmp.redirect is enabled, otherwise this does nothing.
Not harmful to leave enabled even if unnecessary.
truefalse<nix-mineral/settings/network/icmp.nix>nix-mineral.settings.network.ip-forwarding Link copied!
booleanEnable or disable IP forwarding.
::: .{warning}
If false, this may cause issues with certain VM networking,
and must be true if the system is meant to function as a router.
:::
falsetrue<nix-mineral/settings/network/ip-forwarding.nix>nix-mineral.settings.network.ipv6-tempaddr Link copied!
booleanEnable IPv6 Privacy Extensions (RFC3041) and prefer the temporary address.
Inclusive a "kitchen sink" config to enable privacy extensions in relevant daemons. If you do not use these, nothing will happen.
If you use alternative daemons or replacements, considering looking at upstream documentation or filing a PR to add their configurations here.
::: .{note} GrapheneOS devs seem to believe it is relevant to use IPV6 privacy extensions alongside MAC randomization, so consider doing both where applicable. https://grapheneos.org/features#wifi-privacy :::
truefalse<nix-mineral/settings/network/ipv6-tempaddr.nix>nix-mineral.settings.network.log-martians Link copied!
booleanLog packets with impossible addresses to kernel log.
No active security benefit, just makes it easier to spot a DDOS/DOS by giving extra logs.
This may worsen performance due to the additional logging.
truefalse<nix-mineral/settings/network/log-martians.nix>nix-mineral.settings.network.max-addresses Link copied!
boolean or signed integerNumber of global unicast IPv6 addresses can be assigned to each interface.
Set this to false to disable this option entirely.
1false<nix-mineral/settings/network/max-addresses.nix>nix-mineral.settings.network.neighbor-solicitations Link copied!
boolean or signed integerNumber of IPv6 duplicate address detection neighbor solicitations to send out per address.
See RFC4681 for details.
Set this to false to disable this option entirely.
0falsenix-mineral.settings.network.random-mac Link copied!
booleanIf set to true, randomize mac addressees to improve privacy.
Note
This currently only works if you use networkmanager. If you don't, this does nothing and you should consult upstream documentation or file a PR to add relevant configuration.
truefalse<nix-mineral/settings/network/random-mac.nix>nix-mineral.settings.network.rfc1337 Link copied!
booleanRFC1337 protects from TIME-WAIT assassination attacks by dropping TCP RST packets when in the TIME-WAIT state.
This protects against some potention DoS attacks which could cause TCP connections to drop given specific circumstances or crafted packets.
truefalse<nix-mineral/settings/network/rfc1337.nix>nix-mineral.settings.network.router-advertisements Link copied!
one of "off", "restrict", "on"IPv6 router advertisements which are accepted.
Malicious router advertisements have the potential to create a MITM attack by modifying the default gateway, cause a DoS/DDoS attack when flooded, or initiate unauthorized IPv6 access.
off: Disable all IPv6 router advertisements.restrict: Restrict the parameters of IPv6 router advertisements which are accepted.on: Enable all IPv6 router advertisements (effectively, do nothing).
Router advertisements are never authenticated, and can be sent and received by any device on the local network.
Warning
Setting to off or restrict may cause issues with IPv6 address autoconfiguration or
host discovery.
"restrict"nix-mineral.settings.network.router-solicitations Link copied!
boolean or signed integerNumber of IPv6 Router Solicitations to send until assuming no routers are present.
Setting to 0 limits outgoing traffic on the network, and reduces the frequecy of IPv6 router advertisements received.
See RFC4681 for details.
Set this to false to disable this option entirely.
Note
There is no point to setting this number above 0 if
nix-mineral.settings.network.router-advertisements is set to off.
0falsenix-mineral.settings.network.rp-filter Link copied!
booleanValidate source IPs of packets received on the machine, protecting from IP spoofing.
truefalse<nix-mineral/settings/network/rp-filter.nix>nix-mineral.settings.network.shared-media Link copied!
booleanEnable sending and receiving of shared media redirects.
This setting overwrites net.ipv4.conf.all.secure_redirects.
Refer to RFC1620
falsetrue<nix-mineral/settings/network/shared-media.nix>nix-mineral.settings.network.source-route Link copied!
booleanDisable source routing if set to false, since it allows for redirecting network traffic and potentially creating a man in the middle attack.
falsetrue<nix-mineral/settings/network/source-route.nix>nix-mineral.settings.network.syncookies Link copied!
booleanUse syncookies to help protect against SYN flooding, a type DoS attack.
truefalse<nix-mineral/settings/network/syncookies.nix>nix-mineral.settings.network.tcp-sack Link copied!
booleanSet to false to disable TCP SACK, which has been used for DoS attacks
and been exploited in the past.
Rarely used, but can reduce networking performance if disabled in certain applications.
falsetrue<nix-mineral/settings/network/tcp-sack.nix>nix-mineral.settings.network.tcp-timestamps Link copied!
booleanEnables TCP timestamps.
Disabling prevents leaking system time, enabling protects against wrapped sequence numbers and improves performance.
Disabling implicitly disables reuse of TIME_WAIT sockets, as they depend on TCP timestamps which may lead to corruption and an inability to detect duplicate packets. It may also result in port exhaustion as ports may not be immediately reused.
There are possible information leaks when timestamps are enabled. Offset randomization used by default prevents uptime prediction, but the rate of incrementing timestamps can be used in some advanced attacks to predict the current clock speed of a running system.
Because nix-mineral has different priorities to Whonix, which influences Kicksecure's development, we choose not to disable timestamps by default since clock speed fingerprinting is not a useful threat to most people; if it is important, it is probably smarter to use another Linux distribution entirely.
Note
In favor of disabling:
- https://madaidans-insecurities.github.io/guides/linux-hardening.html#tcp-timestamps
- https://forums.whonix.org/t/do-ntp-and-tcp-timestamps-really-leak-your-local-time/7824/6
In favor of enabling:
truefalse<nix-mineral/settings/network/tcp-timestamps.nix>nix-mineral.settings.pam.login-faildelay Link copied!
boolean or signed integerAdd/increase the delay to failed logins into the system.
The default for nix-mineral is 4 seconds, or 4000000 microseconds.
4000000false<nix-mineral/settings/pam/login-faildelay.nix>nix-mineral.settings.pam.shadow-hashing Link copied!
boolean or signed integerModify hashing rounds for /etc/shadow; this doesn't automatically
rehash your passwords, you'll need to set passwords for your accounts
again for this to work.
If you declaratively set passwords with a secret manager, consider using a good hashing round count for resilience to password hash cracking.
Set this to false to disable this option entirely.
Note
By default, this option will set to a value of 8 if yescrypt is used as the hashing algorithm for the passwd service in PAM.
yescrypt is the default hashing algorithm in NixOS for hashes created
by the passwd command for /etc/shadow.
This value was chosen to improve the cracking difficulty compared to the default equivalent of 5, while still being conservative in memory usage (128mb) to avoid causing major problems.
It is recommended that you make this value as close to 11 as possible given the performance allowed by your system, to improve resilience to cracking.
If yescrypt is not used, this option will do nothing by default and you will have to supply your own value.
Consult respective documentation if you do not use the default yescrypt as the hashing algorithm and wish to increase cracking difficulty compared to default values.
See: https://man.archlinux.org/man/chpasswd.8.en https://linux-audit.com/authentication/linux-password-security-hashing-rounds/ https://www.openwall.com/lists/yescrypt/2024/03/20/2 https://github.com/NixOS/nixpkgs/issues/112371
if config.security.loginDefs.settings.ENCRYPT_METHOD == "YESCRYPT" then 8 else falsefalse<nix-mineral/settings/pam/shadow-hashing.nix>nix-mineral.settings.pam.su-wheel-only Link copied!
booleanSet to true to require wheel to use su and su-l, to reduce the risk of
privilege escalation e.g from service accounts which have been
maliciously hijacked and used for a shell.
truefalse<nix-mineral/settings/pam/su-wheel-only.nix>nix-mineral.settings.system.file-protection Link copied!
booleanPrevent creation of files in world writable directories under certain circumstances to limit spoofing attacks.
truefalse<nix-mineral/settings/system/file-protection.nix>nix-mineral.settings.system.link-protection Link copied!
booleanProtect hardlinks and softlinks to prevent TOCTOU attacks.
Prevent users from hardlinking to files they can't read/write to.
Allows symlinks to be followed only outside world writable directories, when the owner and follower match, or when the directory and symlink owner match.
truefalse<nix-mineral/settings/system/link-protection.nix>nix-mineral.settings.system.lower-address-mmap Link copied!
booleanAllow or disallow mmap in lower addresses.
Disallowing mmap in lower addresses reduces the risk that incorrect memory allocations could tamper with the kernel, but may also cause compatibility issues with certain legacy software.
falsetrue<nix-mineral/settings/system/lower-address-mmap.nix>nix-mineral.settings.system.multilib Link copied!
booleanEnable multilib support, allowing 32-bit libraries and applications to run.
Warning
if false, this may cause issues with certain games that still require 32-bit libraries.
falsetrue<nix-mineral/settings/system/multilib.nix>nix-mineral.settings.system.proc-mem-force Link copied!
one of "none", "ptrace", "never"Configure whether processes can modify their own memory mappings or not, which could be used for some exploits.
See: https://github.com/Kicksecure/security-misc/pull/332
none - Keep the default configuration of your kernel.
ptrace - Only allow modification of memory mappings using ptrace. Affected by the "yama" option.
never - Do not allow modifying memory mappings at all.
"ptrace"<nix-mineral/settings/system/proc-mem-force.nix>nix-mineral.settings.system.yama Link copied!
one of "none", "relaxed", "admin-only", "restricted"Yama restricts ptrace, which allows processes to read and modify the memory of other processes. This has obvious security implications.
none: Keep the default configuration of your kernel.relaxed: Only allow parent processes to ptrace child processes.admin-only: Only allow processes with withCAP_SYS_PTRACEcapability or root to ptrace.restricted: No processes may be traced with ptrace.
Note
ptrace may be required for specific debugging or certain video game
anti cheats. Usually, the relaxed option avoids most breakage.
Additionally, envfs (https://github.com/Mic92/envfs) will fail
with the restricted option. Errors regarding hardcoded paths
when envfs is enabled should be resolved by setting to admin-only
or below.
"restricted"<nix-mineral/settings/system/yama.nix>