Commit Graph

227 Commits

Author SHA1 Message Date
Felix Buehler
e32ec19edf nixos/security.pam: remove with lib; 2024-08-22 00:19:00 +02:00
Sandro Jäckel
96790120df
nixos/pam: fix writeFile no longer taking null as an argument warning
> evaluation warning: pkgs.writeText "motd": The second argument should be a string, but it's a null instead, which is deprecated. Use `toString` to convert the value to a string first.
2024-08-09 14:20:47 +02:00
Pratham Patel
4074853391
nixos/pam: kwallet: add the forceRun option 2024-08-01 09:51:31 +05:30
Colin
7306423158
nixos/pam: fully-qualify modulePath
this ensures PAM users always get the intended version of a module when
multiple versions of the same module exist on a system.

most packages which consume `pam` and link against `libpam.so` do so only
to access its API, and not because they care about the specific
`pam_<xyz>.so` modules provided by that `pam`. but when specifying
modules by name only, PAM-capable applications may well load the
`pam_<xyz>.so` from the `pam` they were compiled against instead of the
pam declared in `security.pam.package`. by fully qualifying `modulePath`
we ensure that users can actually swap out pam modules without rebuilding
the world.
2024-07-30 23:53:58 +05:30
Colin
7511ed266c
nixos/pam: add security.pam.package option
this can be used to swap out which pam package is actually used by the
system for things like `pam_limits`, `pam_tty_audit`, etc, without forcing
a mass rebuild the way an overlay would.
2024-07-30 23:53:57 +05:30
Max
1dd44eaf67 nixos/pam: use Kanidm's package option 2024-07-16 00:39:03 +02:00
novenary
fcccfb9e48 nixos/pam/u2f: implement RFC0042
This module has a lot of options, so it's a good candidate for freeform
settings.
2024-07-05 17:07:02 +03:00
Jan Tojnar
1369411184 gnome-keyring: Move from gnome scope to top-level
It is on the way out.
2024-07-01 09:35:26 +02:00
éclairevoyant
7d8742da87
treewide: fix mkEnableOption usage 2024-06-14 02:41:42 -04:00
Thomas Gerbet
deed6fb8f3
Merge pull request #277626 from nbraud/nixos/pam/ssh-agent-auth-31611-fix
nixos/pam: Use secure default for `sshAgentAuth.authorizedKeysFiles`
2024-04-28 09:24:38 +02:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Bjørn Forsman
a29010fe79 nixos: improve many 'enable' descriptions 2024-04-09 07:10:17 +02:00
Nick Cao
cee0d0bac7
nixos/pam: use services.fprintd.package for fprintd rule 2024-03-22 20:14:49 -04:00
Adam C. Stephens
b52452f8c7
Merge pull request #291951 from amarshall/zfs-pkgs-renaming
zfs: rename zfsStable -> zfs_2_2; zfsUnstable -> zfs_unstable; remove enableUnstable option in favor of package
2024-03-01 10:09:12 -05:00
K900
8be79e54c5 nixos/pam/kwallet: rename option, allow setting package 2024-02-28 18:49:33 +03:00
Andrew Marshall
2e36c49949 nixos/pam: Do not incorrectly use zfs.enableUnstable in assertion
`zfs.enableUnstable` only has an effect if `zfs.enabled = true`, so only
require `zfs.enabled` to be true here.
2024-02-27 18:46:00 -05:00
Raito Bezarius
2d78f55438 pam_usb, nixos/pam-usb: drop
`security.pam.usb` is broken anyway and upstream has abandoned the software.
2024-02-08 02:59:45 +01:00
Rhys Davies
d102910f47
nixos/pam: Add pam_intune 2024-02-02 10:01:52 +13:00
Adam Stephens
75ec325cb9
nixos/pam: remove pam_cgfs
pam_cgfs is a cgroups-v1 pam module. Verified with upstream that
this module no longer necessary on cgroups-v2 systems.
2024-01-31 17:19:23 -05:00
nicoo
bd6966bc4a nixos/pam: Secure default for sshAgentAuth.authorizedKeysFiles
Closes #31611
2024-01-12 13:39:08 +00:00
Peder Bergebakken Sundt
dff635f38d
Merge pull request #243169 from 2xsaiko/outgoing/krb5
nixos/krb5: cleanup, fix and RFC42-ify
2024-01-10 21:06:15 +01:00
nicoo
0e5c95035d nixos/pam: Fix use of renamed enableSSHAgentAuth option 2024-01-08 18:13:46 +00:00
Maciej Krüger
b5b2f6bec4
Merge pull request #277620 from nbraud/nixos/pam/ssh-agent-auth-31611
nixos/pam: Add option for ssh-agent auth's trusted authorized_keys files
2024-01-08 17:42:02 +01:00
nicoo
9ed1423dcf nixos/pam: Warn on insecure sshAgentAuth configurations 2024-01-04 17:30:09 +00:00
nicoo
822c0a86bd nixos/pam: Add sshAgentAuth.authorizedKeysFiles option 2024-01-03 14:49:36 +00:00
nicoo
a46ea51ca3 nixos/pam: Rename option enableSSHAgentAuth to sshAgentAuth.enable 2024-01-03 14:49:36 +00:00
nicoo
607679c6d3 nixos/pam: Assert that authorizedKeysFiles is non-empty when using pam_ssh_agent_auth 2023-12-30 22:19:38 +00:00
Marco Rebhan
fed77d1705
nixos/krb5: move to security.krb5 2023-12-21 11:35:26 +01:00
nicoo
bcc2d1238a nixos/sudo-rs: Move support for pam_ssh_agent_auth(8) to PAM's NixOS module
Similar to delroth's suggestion in #262790.
2023-11-25 14:11:25 +00:00
nicoo
19e1420e13 nixos/sudo: Move support for pam_ssh_agent_auth(8) to PAM's NixOS module 2023-11-08 19:41:37 +00:00
Majiir Paktu
9d6e6e18bc nixos/pam: add maintainer 2023-10-10 21:11:35 -04:00
Majiir Paktu
e712b6e81d nixos/pam: generate apparmor includes from rules
Removes redundant config from the module. Fixes a bug where some modules
(e.g. ussh) were added to apparmor even though they had no rules enabled.
2023-10-10 21:11:35 -04:00
Majiir Paktu
43f7cb4a95 nixos/pam: add order comment to each rule line 2023-10-10 21:11:35 -04:00
Majiir Paktu
077cdcc7e9 nixos/pam: convert rules to attrs, add order field
Makes it possible to override properties of a rule by name. Introduces
an 'order' field that can be overridden to change the sequence of rules.

For now, the order value for each built-in rule is derived from its
place in the hardcoded list of rules.
2023-10-10 21:11:34 -04:00
Majiir Paktu
e86487e579 nixos/pam: remove empty text fields 2023-10-10 21:11:34 -04:00
Majiir Paktu
5b8439f966 nixos/pam: add settings option for common argument styles
Adds easily overrideable settings for the most common PAM argument
styles. These are:

- Flag (e.g. "use_first_pass"): rendered for true boolean values. false
  values are ignored.

- Key-value (e.g. "action=validate"): rendered for non-null, non-boolean
  values.

Most PAM arguments can be configured this way. Others can still be
configured with the 'args' option.
2023-10-10 21:11:34 -04:00
Majiir Paktu
6eea7fb194 nixos/pam: extract args field
Module arguments have common escaping rules for all PAMs.
2023-10-09 23:17:37 -04:00
Majiir Paktu
12a488e89c nixos/pam: extract modulePath field 2023-10-09 23:17:36 -04:00
Majiir Paktu
25bc21f19a nixos/pam: extract control field 2023-10-09 23:17:36 -04:00
Majiir Paktu
0563e0a379 nixos/pam: give each rule a name
These names are internal identifiers. They will be used as keys so that
users can reconfigure rules by merging a rule config with the same name.
The name is arbitrary. The built-in rules are named after the PAM where
practical.
2023-10-09 23:17:36 -04:00
Majiir Paktu
fbd7427b14 nixos/pam: define rules as submodules
Allows us to decompose rules into multiple fields that we later format
as textual rules. Eventually allows users to override individual fields.
2023-10-09 23:17:36 -04:00
Majiir Paktu
3c85d159f7 nixos/pam: automatically populate rule type
Eliminates a redundancy between the 'rules' suboptions and the type
specified in each rule.

We eventually want to give each rule a name so that we can merge config
overrides. The PAM name is a natural choice for rule name, but a PAM is
often used in multiple rule types. Organizing rules by type and rule
name avoids name collisions.
2023-10-09 23:17:15 -04:00
Majiir Paktu
d6bb805932 nixos/pam: extract header comments
Unblocks converting the rules from one big string to a rich data
structure.
2023-10-09 20:40:19 -04:00
Majiir Paktu
0f9d719d8a nixos/pam: split rule lists into individual rules 2023-09-24 18:37:10 -04:00
Majiir Paktu
dd458977a0 nixos/pam: clean up rules
Makes the rules more uniform in structure and style. This makes it
easier to automate subsequent commits. No behavior changes.
2023-09-24 18:37:10 -04:00
mib
2e66f109ed nixos/pam: fix typo in fscrypt enable option
mkEnableOption prepends "Whether to enable" to text, so this became
"Whether to enable Enables fscrypt ..."
2023-09-11 12:06:39 +02:00
Aaron Andersen
9d56365451 security/pam: add umask option to configure pam_mkhomedir 2023-08-10 20:35:08 -04:00
Lin Jian
74fadae942
treewide: stop using types.string
It is an error[1] now.

[1]: https://github.com/NixOS/nixpkgs/pull/247848
2023-08-08 21:31:21 +08:00
Jacob Moody
5f97e78c64 pam_dp9ik: init at 1.5 2023-07-09 14:12:21 -05:00
Max
34a4165674 nixos/pam: support Kanidm 2023-06-11 17:17:42 +02:00