Sender | Message | Time |
---|---|---|
10 Mar 2025 | ||
So, ive been using agenix for a bit and only now thought to myself hey, maybe i should check how (easily) recreating my system actually is in case i ever need to do so. The issue i ran into was, of course, that the install media can't decrypt any secrets during nixos-install. Is there a way to supply a user or a previous host key to that or do i have to re-key everything? | 00:01:46 | |
Personally I find it's easiest to deploy a relatively blank nixos (e.g. just disk config), rekey, then do the full in install. Doesn't hurt to have new host keys once in a while, but ymmv | 06:35:11 | |
If that is the intended usage, would not be SOPS simpler? It will work fine without the secrets, then you put them and run again to get the data decryted for real | 08:19:45 | |
agenix also "works fine" without secrets, the secret files just won't be there 🤷 | 08:25:52 | |
then you don't need a relatively blank anything, no? | 08:28:16 | |
just don't depend on secrets for your system to function | 08:28:33 | |
maybe I just misunderstood what you meant by "sops will work fine without the secrets". I'd think it behaves very similar to agenix in this regard | 08:33:54 | |
Yeah fair point tbh, as long as the secrets don't prevent the system from running itll be easy enough to rekey right after. | 08:42:17 | |
I guess the host keys will only be generated during a first startup though and not already during nixos-install? Else one could already check those and rekey right after the install.. | 08:43:32 | |
As far as I know, they just put empty files in places, instead of failing. Is that what agenix does too? | 08:54:16 | |
But in order to rekey, you need to do that in an environment where the secrets are available. No? so you can't do that in the host being built | 08:57:41 | |
As long as i have my "master" key i can just go about and re-key everything no problem or am i missing something | 14:50:10 | |
22:27:10 | ||
22:30:10 | ||
12 Mar 2025 | ||
Hi everyone, I've been trying to use the path option to decrypt a secret to $home/.config/ntfy/client.yaml, but is not working, my best guess is that is not being evaluated? | 02:53:43 | |
Are you using straight up "$home"? Either that's not evaluated or placed at the home of the agenix activation script user (probably root?) | 02:56:11 | |
No I am using an interpolated string | 02:56:48 | |
put that to save typing hahaha | 02:57:07 | |
oh for the love of god, it was wrong name in cfg = config.modulename that i pasted from another file | 02:59:13 | |
no wonder it did not eval | 02:59:23 | |
16 Mar 2025 | ||
12:38:26 | ||
18 Mar 2025 | ||
I'm a little confused on how I use Agenix secrets with multiple machines? I have Agenix set up on machine A, and a key on machine A was used to create/encrypt the secrets I installed NixOS on machine B, and I have generated a new keypair to belong to this machine. If I add my new public key to I'm struggling to see how a malicious actor couldn't just download the repo, add their keys, and decrypt? The "original" key (on machine A) has to be used to decrypt at some point right? What am I missing here? Do I just have to share the same keypair across machines? Obviously not, or else why can we configure multiple? | 22:47:03 | |
19 Mar 2025 | ||
You need to rekey your secrets manually on a machine that can decrypt them | 00:34:28 | |
K900: ok, this enables the secrets to be read by multiple users? | 01:51:37 | |
is https://github.com/oddlama/agenix-rekey recommended? | 02:00:16 | |
In reply to @raijin_:matrix.orgNot necessarily, depends on your setup | 06:45:41 | |
K900: this is my current secrets "architecture" https://github.com/GideonWolfe/nix/tree/main/configs/secrets I did some reorganizing to separate system/user secrets, but I'm not sure how to really make the whole process "seamless" to set up a new machine | 15:25:22 | |
20 Mar 2025 | ||
raijin_: you'll need the private key for a public key which has "access" to a given age/agenix secret to be able to decrypt it, public key just allows for encryption not decryption. So for example, my workflow is that all secrets can be decrypted by the SSH private keys of machines which need them, and also my yubikey's age key (which is stored on the yubikey and has to be plugged in). If I want to add a new host, I do an ssh-keyscan to get the public key, add it to my list of identies, and then rekey everything. My yubikey is sufficient to rekey because if it is plugged in then I have access to a private key which can decrypt the secrets. Does that make sense? | 20:23:07 | |
You set out what has access to which secrets in the secrets.nix file and you can lock it down to just your private key (which can be on a yubikey) and just the SSH private keys of the machines which need access to those secrets. The SSH private keys stay on those machines so an attacker would already have to have access to those machines with sufficient access to read just the secrets you were using on that machine or the SSH private key (which is usually only accessible to root). But if they had root on your machine, or access as a service account where you'd configured the permissions on a secret to be readable by the service, on the target machine, they'd be able to read the secret. But in most threat models that would be expected and acceptable, if someone is already on the machine then at least you're able to limit and restrict the secrets to just what is needed for each given service + user. | 20:25:45 | |
I just have agenix -r with the appropriate identity for my yubikey age key in a Makefile I run when I need to rekey everything (i.e. add a new host's SSH public key) | 20:27:04 |