Commit Graph

1363 Commits

Author SHA1 Message Date
Peder Bergebakken Sundt
d165ee4dcd nixos/isolate: fix type for uid/gid options (#450233) 2026-08-12 19:27:22 +00:00
Grimmauld
3ecdde1b2a nixos/wrappers: verify that capabilities strings are valid (#502310) 2026-08-09 07:04:18 +00:00
Andrew Marshall
6b93582064 nixos/wrappers: verify that capabilities strings are valid
Without this, an invalid capabilities string would cause the activation
script to fail completely, meaning all wrappers would be missing. This
causes unix_chkpwd to be missing, and thus all logins to fail.

See https://github.com/NixOS/nixpkgs/issues/398934.
2026-08-08 07:27:22 -04:00
Andrew Marshall
039b9bc5fa nixos/wrappers: do not substitute checks
These are likely to differ for many folks, and running these checks
should be quite fast (`runCommandLocal` docs suggest anything less than
one second should use local).
2026-08-08 07:23:23 -04:00
Andrew Marshall
acab862fb5 nixos/wrappers: prefer toShellVar over manually constructing bash array 2026-08-08 07:23:23 -04:00
Grimmauld
39fda4c8e8 nixos/auditd: adjust defaults according to upstream (#549914) 2026-08-07 07:05:11 +00:00
Grimmauld
9664cdb37e nixos/auditd: adjust defaults according to upstream
According to `man 8 audisp-af_unix`:

> If the output format is not specified, the plugin defaults to the "string" format.

`string` format is more compatible with existing parsers,
and differing from the upstream default should be opt-in.

Also adjust the socket path in the option description to what we actually set up.
2026-08-06 17:35:23 +02:00
Martin Weinelt
a6d4e38e13 nixos/security.wrappers: Fix loop condition to include last_cap (#538872) 2026-08-03 15:12:47 +00:00
Eman Resu
5c483d4767 various: partially apply prefix/suffix/infix checks (#543869) 2026-07-26 21:41:24 +00:00
h7x4
9c63d6c2a2 nixos/isolate: fix type for uid/gid options 2026-07-24 06:13:31 +09:00
nixpkgs-ci[bot]
9b79d0afb5 Merge master into staging-nixos 2026-07-22 18:27:02 +00:00
TheRealGramdalf
f993ce2ffd nixos/auditd: fix mkEnableOption description 2026-07-22 10:36:47 -07:00
nixpkgs-ci[bot]
6d4751efc4 Merge master into staging-nixos 2026-07-22 00:31:17 +00:00
Grimmauld
d42da8a083 nixos/account-utils: support config file 2026-07-21 21:22:14 +02:00
Martin Weinelt
2cc2d0808c nixos/pam: remove explicit hardcoded yescrypt (#541548) 2026-07-21 11:14:12 +00:00
Eman Resu
31043cff65 nixos/pam: partially apply hasInfix and replaceStrings 2026-07-20 10:30:09 -04:00
Eman Resu
153dc57d16 nixos/pam: Write all pam.d config in a single derivation (#525102) 2026-07-15 13:30:10 +00:00
Grimmauld
7000a4f71f nixos/apparmor: use upstream aa-teardown 2026-07-14 12:51:12 +02:00
Grimmauld
3d32e0705a nixos/pam: remove explicit hardcoded yescrypt
Both `pam_unix.so` and `pam_unix_ng.so` look at `ENCRYPT_METHOD` in
`/etc/login.defs` to determine the algorithm to use for password
encryption: 66fbd0382b/src/pam_unix_ng-common.c (L27-L62)
If this is not set, both already default to `YESCRYPT`.
The shadow module makes this configurable via
`security.loginDefs.settings.ENCRYPT_METHOD`, which also defaults to `YESCRYPT`.
Seeing as what was previously hardcoded is default anyways, with a global
configuration option to change it, there is no point to keep this.
2026-07-13 20:29:02 +02:00
Salva
0b7b877e9a pam: add support for oo7 2026-07-09 23:26:38 -06:00
Linus Jäger
dfba3a7bc1 nixos/security.wrappers: include CAP_LAST_CAP when raising ambient capabilities 2026-07-06 08:00:13 +02:00
夜坂雅
ec51ed1449 nixos/pam/u2f: add settings.{,cue_}prompt option 2026-07-01 15:38:40 +08:00
adisbladis
f072535eb2 nixos/pam: Write all pam.d config in a single derivation
Calling writeText in a loop is silly when we can use a single runCommand by passing all config as structured attrs.
2026-06-29 02:32:30 +12:00
Grimmauld
58462a7e8d nixos/apparmor: fix lsm loading order (#533428) 2026-06-25 11:00:35 +00:00
Samuel Cobb
bd022e3c5a nixos/apparmor: load bpf last unconditionally 2026-06-25 08:18:54 +02:00
Aaron Andersen
6986b21e85 nixos/pam: allow disabling entirely (#512541) 2026-06-24 21:27:51 +00:00
Ilan Joselevich
bf58ca65b6 nixos/acme: also allow _PATH-suffixed credential files (#534035) 2026-06-24 16:55:18 +00:00
Grimmauld
ce6be70e00 nixos/account-utils: init 2026-06-24 10:50:07 +02:00
Grimmauld
ad462fc106 nixos/pam: introduce enableLegacySettings option 2026-06-24 10:49:40 +02:00
Grimmauld
9af57289b3 nixos/pam: allow changing pam_unix module path 2026-06-24 10:16:01 +02:00
Grimmauld
854a752851 nixos/run0: add options for persistent authentication (#533341) 2026-06-23 09:22:31 +00:00
zimward
498aab6ea8 nixos/run0: add options for persistent authentication
Co-authored-by: Grimmauld <soeren@benjos.de>
Assisted-by: languagetool 6.6
2026-06-23 08:49:45 +02:00
Florian Klink
633f52c08e nixos/acme: remove unused symbols 2026-06-21 23:47:29 +03:00
Florian Klink
78d07871f5 nixos/acme: also allow _PATH-suffixed credential files
The acmedns backend consumes a ACME_DNS_STORAGE_PATH environment
variable.

Upstream does treat this file as mutable (if you create or delete
accounts through the CLI, it would update it. We don't do this in our
module).

But the possibility for edits is probably why they didn't go with
`ACME_DNS_CONFIG` env var for the contents (as they'd be read-only), or
a `ACME_DNS_CONFIG_FILE`. (And the fact that a
`ACME_DNS_STORAGE_PATH_FILE` env var with questionable usability exists
is due to this logic being generic for most env vars).

So instead of fighting upstream over this, let's simply make our module
assertion also accept `_PATH` suffixes for `credentialFiles`.

Fixes #344684.
2026-06-21 23:47:29 +03:00
Grimmauld
471ac28cfa nixos/polkit: add RFC42 settings (#532954) 2026-06-19 18:27:13 +00:00
zimward
5e0c3907aa nixos/polkit: add RFC42 settings
Assisted-by: languagetool 6.6
2026-06-19 20:16:55 +02:00
zimward
d842b18bb9 nixos/polkit: adopt by zimward 2026-06-18 13:26:30 +02:00
zimward
f52355045f nixos/run0: switch to run0-sudo-shim 2026-06-17 22:07:30 +02:00
zimward
2266840d7c nixos/run0: adopt by zimward, grimmauld, kuflierl 2026-06-14 20:47:38 +02:00
Martin Weinelt
517a082acc nixos/polkit: stop if changed
We concluded this is fine, because we don't require elevation while
switching generations.

Co-Authored-By: r-vdp <ramses@well-founded.dev>
Co-Authored-By: Grimmauld <Grimmauld@grimmauld.de>
2026-06-11 20:31:49 +02:00
Martin Weinelt
45d40120be nixos/security/run0: enable guard, polkit, refactor
The module now enables polkit, which run0 requires to faciliate
elevation. This warrants guarding the config by an opt-in enable toggle.

For the options that existed prior to the enable toggle we now assert
that users need to opt into the module for them to have an effect.
2026-06-11 20:31:49 +02:00
Martin Weinelt
e88efa7306 nixos/polkit: make pkexec opt-in 2026-06-11 20:31:23 +02:00
Martin Weinelt
3a8b38d4ee nixos/polkit: modernize 2026-06-11 20:31:23 +02:00
nikstur
9841bd4eb6 nixos/security/wrappers: add more context to enableWrappers description (#527948) 2026-06-04 17:28:01 +00:00
nikstur
f59623d121 nixos/security/wrappers: add more context to enableWrappers description 2026-06-04 15:25:23 +02:00
Jennifer Graul
f5df55072b nixos/pam_mount: migrate to fuse3
Part of #526161
2026-06-01 17:01:36 +02:00
zowoq
1dfd9599a9 nixos/dhparams: remove (#524658) 2026-05-31 02:04:24 +00:00
adisbladis
4eb838f5d2 nixos/pam: Refactor with an eye for performance
This moves up some variables in scope, changes iteration patterns & and eliminates use of `lib.pipe`.
2026-05-28 14:30:14 +12:00
Martin Weinelt
94a36f74d0 nixos/dhparams: remove
This module was deprecated in 26.05 and is being removed in 26.11.

Generating your own dhparams has been obsoleted by RFC 7919 (2016).

DHE itself has been obsoleted by ECHDE (RFC8422, 2018) and Hybrid PQ
(draft-ietf-tls-ecdhe-mlkem, 2026) key exchanges.

TLS 1.3 (RFC8446, 2018) stopped defining any DHE cipher suites and lists
this as a major difference from TLS 1.2.
2026-05-27 03:19:26 +02:00
dram
42de2da71a Revert "nixos/security: warn if wrappers are disabled and wrappers are defined" 2026-05-26 22:40:17 +08:00