2021-11-27 08:04:28 +00:00
|
|
|
import ../make-test-python.nix ({ ... }:
|
2019-01-29 16:45:26 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "pam-u2f";
|
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine =
|
2019-01-29 16:45:26 +00:00
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
security.pam.u2f = {
|
|
|
|
enable = true;
|
2023-12-22 17:02:46 +00:00
|
|
|
control = "required";
|
|
|
|
settings = {
|
|
|
|
cue = true;
|
|
|
|
debug = true;
|
|
|
|
interactive = true;
|
|
|
|
origin = "nixos-test";
|
|
|
|
# Freeform option
|
|
|
|
userpresence = 1;
|
|
|
|
};
|
2019-01-29 16:45:26 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
2019-12-07 22:16:59 +00:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
|
|
|
machine.succeed(
|
2023-12-22 17:02:46 +00:00
|
|
|
'egrep "auth required .*/lib/security/pam_u2f.so.*cue.*debug.*interactive.*origin=nixos-test.*userpresence=1" /etc/pam.d/ -R'
|
2019-12-07 22:16:59 +00:00
|
|
|
)
|
2019-01-29 16:45:26 +00:00
|
|
|
'';
|
|
|
|
})
|