add an ssh ca to bao, agent ssh certificates and a target module
This commit is contained in:
parent
ac01ef1bdb
commit
0afb111862
1 changed files with 1056 additions and 17 deletions
23
nix/host-modules/lib/ssh-agent-ca.nix
Normal file
23
nix/host-modules/lib/ssh-agent-ca.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# What the swarm's SSH CA and its agent role fix, spelled once for the two
|
||||
# files that must agree: ../swarm-bao.nix writes the role, and
|
||||
# ../../agent-modules/ssh.nix signs through it and renews on a schedule
|
||||
# derived from the certificate's lifetime.
|
||||
#
|
||||
# `mountPath` and `roleName` are also `swarm_secret_client::policy::SSH_MOUNT`
|
||||
# and `SSH_ROLE`, which the shared agent policy names; the bao-grants module-eval
|
||||
# suite reads that file and fails when the two disagree.
|
||||
#
|
||||
# Pure attrset, not a NixOS module.
|
||||
{ }:
|
||||
rec {
|
||||
mountPath = "ssh-agents";
|
||||
roleName = "swarm-agent";
|
||||
|
||||
# A certificate is valid this long, and the role refuses a longer request.
|
||||
certTtlMinutes = 60;
|
||||
certMaxTtlMinutes = 180;
|
||||
|
||||
# A third of the lifetime: a run that fails once still leaves the old
|
||||
# certificate valid for the retry, and a few failed runs still do.
|
||||
renewEveryMinutes = certTtlMinutes / 3;
|
||||
}
|
||||
Loading…
Reference in a new issue