!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

255 Members
age-encrypted secrets for NixOS https://github.com/ryantm/agenix/81 Servers

Load older messages


SenderMessageTime
20 Aug 2024
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.deHi, I store multiple secrets using the same SSH key with agenix but every time I rebuild my system, I have to enter the password of the key for each secret. Is there an option to only enter it once?22:36:07
21 Aug 2024
@eyjhb:eyjhb.dkeyJhb joined the room.19:20:47
22 Aug 2024
@uep:matrix.orguep you shouldn't have to enter it at all 08:58:51
@uep:matrix.orguepthe secrets should be decrypted on the host at runtime, not during build. Something is amiss with your config it seems.09:00:07
@uep:matrix.orguepthe only time you should need to enter your user key is when editing or rekeying secrets to additional hosts09:01:32
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.de
In reply to @uep:matrix.org
you shouldn't have to enter it at all
My key has a password so I should have to enter it at some point.
09:12:45
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.de
In reply to @uep:matrix.org
the secrets should be decrypted on the host at runtime, not during build. Something is amiss with your config it seems.
Could it be that this happens because I also switch the generation and not only rebuild?
09:12:55
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.deBut I'll look in the docs again.09:13:08
@uep:matrix.orguep

Secrets should be encrypted to several keys:

  • the ssh host public key of each system that needs it, to be decrypted at boot / activation
  • the user public key of each admin that needs to edit or change the config, such as when re-encrypting to add a new host

Note, in particular, that neither of these happens during build (but, yes, switch involves activation that should not involve a user key)

19:06:01
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.deOn my system, I am the admin AND user with one single key.19:09:05
@uep:matrix.orguepyes 19:09:20
@uep:matrix.orguepthat's the second row. You still want the first row for the host key as well19:10:02
@uep:matrix.orguepthe minimum useful case is one of each19:10:24
@uep:matrix.orguepmore if the key is shared between hosts, there are multiple admins, backup keys, etc etc19:11:31
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.deOr is the idea, that I have one key for me (eventually with a password) and one without one for the system?19:12:27
@uep:matrix.orguepI suspect your host won't boot properly and won't decrypt the secret except when you're running switch in a user session with sudo etc19:13:45
@uep:matrix.orguepthhd19:13:51
@uep:matrix.orguep * the ssh host key is the usual choice for that system key. yes.19:14:34
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.deAnd why do I need two keys? Wouldn't one be sufficient technically?19:16:04
@uep:matrix.orguepyes but then you have to enter it on every boot and activation, which is what you're complaining about :)19:17:11
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.deOk. Makes sense.19:17:39
@uep:matrix.orguepyou need two keys, one (at least) for each of the circumstances in the dot points above19:18:06
@uep:matrix.orguepif you really want just one key, it should be the host key, and you decide you never want an admin to edit it (perhaps you just generate an entirely new secret whenever a change happens)19:20:21
@uep:matrix.orguepthink of it like sending a message to the future host while it boots, it needs to be able to decrypt your message19:22:01
@pascal.dietrich:mintux.de@pascal.dietrich:mintux.deOk. Thanks a lot for your explanations.19:22:59
@uep:matrix.orguepnp, good luck19:23:18
29 Aug 2024
@feathecutie:tchncs.de@feathecutie:tchncs.de left the room.12:40:43
31 Aug 2024
@setthemfree:matrix.orgundltd joined the room.15:33:53
@setthemfree:matrix.orgundltd Hi everyone. Is there a way to specify in secrets.nix something like "mysecret-*.age" = [ key1 key2 ] so that I don't have to list every file explicitly? 15:37:23
@setthemfree:matrix.orgundltd Hi everyone. Is there a way to specify in secrets.nix something like "mysecret-*.age".publicKeys = [ key1 key2 ] so that I don't have to list every file explicitly? 15:38:05

Show newer messages


Back to Room ListRoom Version: 6