From 19a451db777efe1c7abbd73a4fc74a8eb2978055 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 8 Sep 2023 19:01:57 +0200 Subject: [PATCH] Add encrypted munge key with agenix --- m/common/slurm.nix | 13 ++++++++++++- secrets/munge-key.age | Bin 0 -> 2007 bytes secrets/secrets.nix | 5 +++-- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 secrets/munge-key.age diff --git a/m/common/slurm.nix b/m/common/slurm.nix index 5404d0c..22ffae6 100644 --- a/m/common/slurm.nix +++ b/m/common/slurm.nix @@ -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; + }; } diff --git a/secrets/munge-key.age b/secrets/munge-key.age new file mode 100644 index 0000000000000000000000000000000000000000..ead42c816eb6d3ba2973e4dcb0a62c55e6f5ac8b GIT binary patch literal 2007 zcmZY8`CpBR0>^Pni%ycsD6Z5o*-yvWH{;cK&c1KY*`5>XEYEq)zVC^`Wv)z?q2Xml zC3h|{O=ud0o1LMCVr)ZPTM=nO!^OB>ulpN+!TX2L_iI34EbKPK_1{#3qaZv>AiSj5E*c`SS>^ufciW<#Oghn8`xNZ&00{h9nkTWFl zkYsc|9YwO+nHUEKv{0xL37!H&T%|f9lrvpohFpXTf;Jn-v#Q80jvDw-3m|~O1)u?+ z5aQuOkld)0%dKGth9xjFs6MS%>i|>;p3gJ-DMYT)rDl;)Y<`^UjIrDVHibeG(tLO| zksydk06tD*khsJUzD{q(+5`D>O!pLWUc$Gwgbyj0XgmHiGi~;4mMrL;`Y2W(2J^(rGZ2 zkJzo)Xk!U4xB1#<*hJlD7$Z;`gdWVk@HhHLGz$JCr5R`sW z7rcR9iLJ{0GQQ|eSNioS%fQCBeJuXtftqcu@a6b6?C}fp3mYekC!ZhFoCuD%#$7*Y z#wpS9VZRsrc;(x4PDJx`-jDZG#iM_%iSG68%HCA`?gnSgjT*tNX-%81W@ia!Tq*7S zT+bfytb6%)FCUMcNVFY2q)SlZ2X8fepC*}RkyWl4xjUfS?U>M+h`hr6_rd(_e=_rK z7Y(wbxW)&Z+LS=|+b{izi+2@X=1(ifo=f<3WqRhT(rU$0?6`Y#Q&zHGd*%~|#R7Vz zRB&%*ZR_al^?uCy`eo%E_+xX@a&jumep|id=as9U?H~oO-4c;kzT1EHbap}2g9DeI ztW~8%tP6q6(v$=Rf7^+18#ee~wv}hR<@6uqwA9s2X_qDMyZ=nIwY^m3lRXUXYV+M) zcf0H0p0eRZ+YJ>zvo59Z?sqrar)Hazx^+@;`@7htt{W%&X85?3=M+!Yc&pB=S~}$X zmq*YLoAIe3md#kCF>J4Sp>!D!)I)EBU7aaN>Xsk=%3PGcYWhjrrXT*fx_I~kZR?{8 zx&8A!?THnA3tx?&y18}w`@d*j98SJQSbKKE;EN3Z=+-O7v0p!*gHvac0ndg>wI8CIRWwef!y2ImJ+FR*cutStO%*k2xZv&=+gUR1!PVA@{=i=`D<=U|o%F(xR8#xtF&+x~+ zrB+r_+ts`g?PEF)RcdcOzw?xMYT-_x=~Z1OTynf%RO|Ib4JWdZdDpWd$*$N}yR`73 z4VKk9I;saJC<%k^d$+fudU5!9V=vd`EH7BK;P&df%TdCGEBQjqPboMzAm$zb`>HYv8BB s{p$z+e{uH`#IZ<`Ht<{if!xgv8cxFh0FV+i@Bjb+ literal 0 HcmV?d00001 diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 34fb177..9dce058 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -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; }