nixos: break-glass root login on ops for its conversion
All checks were successful
nixos / nixos (push) Successful in 33s
All checks were successful
nixos / nixos (push) Successful in 33s
ops is the WireGuard hub. If WireGuard does not come back after the switch, root may still log in from the admin's exit address (services' IPv4, where the admin's traffic leaves through Xray). Root only, ops only; the dead-man reboot covers the rest. Remove after Phase 2. Assisted-by: Claude:opus-5-5
This commit is contained in:
parent
ce8b1a678e
commit
3aca8a85a3
1 changed files with 22 additions and 9 deletions
|
|
@ -32,6 +32,12 @@ in
|
|||
description = "Networks shell users may log in from.";
|
||||
};
|
||||
|
||||
options.asxpio.rootSshFromExtra = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Extra addresses root alone may log in from (break-glass).";
|
||||
};
|
||||
|
||||
# Units that own data start only once /var/lib/.data-in-place exists,
|
||||
# so a fresh install never creates empty state where a restore is about
|
||||
# to land. Create the file after the data is in place.
|
||||
|
|
@ -98,15 +104,17 @@ in
|
|||
];
|
||||
# Shell users only from the trusted networks; the Hetzner
|
||||
# firewall is the outer layer
|
||||
AllowUsers = lib.concatMap (
|
||||
net:
|
||||
map (u: "${u}@${net}") [
|
||||
"root"
|
||||
"asxpi"
|
||||
"deploy"
|
||||
"zerrtika"
|
||||
]
|
||||
) config.asxpio.sshFrom;
|
||||
AllowUsers =
|
||||
lib.concatMap (
|
||||
net:
|
||||
map (u: "${u}@${net}") [
|
||||
"root"
|
||||
"asxpi"
|
||||
"deploy"
|
||||
"zerrtika"
|
||||
]
|
||||
) config.asxpio.sshFrom
|
||||
++ map (net: "root@${net}") config.asxpio.rootSshFromExtra;
|
||||
};
|
||||
};
|
||||
services.fail2ban.enable = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue