system/security: enable pam_u2f
This commit is contained in:
parent
4c28a3eecb
commit
cc43450dd1
1 changed files with 30 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, lib, pkgs, ... }: {
|
||||||
networking.firewall =
|
networking.firewall =
|
||||||
let
|
let
|
||||||
iptables = "${pkgs.iptables}/bin/iptables";
|
iptables = "${pkgs.iptables}/bin/iptables";
|
||||||
|
|
@ -49,9 +49,37 @@
|
||||||
{
|
{
|
||||||
groups = [ "wheel" ];
|
groups = [ "wheel" ];
|
||||||
keepEnv = true;
|
keepEnv = true;
|
||||||
persist = true;
|
persist = config.me.environment != "laptop";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
pam = lib.mkIf (config.me.environment != "headless") {
|
||||||
|
u2f = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
cue = true;
|
||||||
|
pinverification = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.doas.rules.auth = {
|
||||||
|
u2f.settings.pinverification = lib.mkForce 0;
|
||||||
|
u2f_int = lib.mkMerge [
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
order = config.security.pam.services.doas.rules.auth.u2f.order + 1;
|
||||||
|
control = "sufficient";
|
||||||
|
modulePath = "${pkgs.pam_u2f}/lib/security/pam_u2f.so";
|
||||||
|
inherit (config.security.pam.u2f) settings;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
settings = lib.mkForce {
|
||||||
|
interactive = true;
|
||||||
|
pinverification = 0;
|
||||||
|
userpresence = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue