Add encrypted munge key with agenix

This commit is contained in:
Rodrigo Arias 2023-09-08 19:01:57 +02:00
parent ec9be9bb62
commit 19a451db77
3 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ config, pkgs, lib, ... }:
let
suspendProgram = pkgs.writeScript "suspend.sh" ''
@ -85,4 +85,15 @@ in {
SrunPortRange=60000-61000
'';
};
age.secrets.mungeKey = {
file = ../../secrets/munge-key.age;
owner = "munge";
group = "munge";
};
services.munge = {
enable = true;
password = config.age.secrets.mungeKey.path;
};
}

BIN
secrets/munge-key.age Normal file

Binary file not shown.

View File

@ -3,11 +3,12 @@ let
adminsKeys = builtins.attrValues keys.admins;
hut = [ keys.hosts.hut ] ++ adminsKeys;
# Only expose ceph keys to safe nodes and admins
ceph = keys.hostGroup.safe ++ adminsKeys;
safe = keys.hostGroup.safe ++ adminsKeys;
in
{
"ovni-token.age".publicKeys = hut;
"nosv-token.age".publicKeys = hut;
"ceph-user.age".publicKeys = ceph;
"ceph-user.age".publicKeys = safe;
"munge-key.age".publicKeys = safe;
}