!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

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

Load older messages


SenderMessageTime
10 Mar 2023
@jayhenks:matrix.orgjayhenks
In reply to @dandellion:dodsorf.as
I don't understand what's different
So it is just impossible to use agenix’s config.path in home manager to point to an encrypted file?
17:18:00
@peter-lustig:matrix.orgpeter-lustig joined the room.21:38:30
@peter-lustig:matrix.orgpeter-lustig

Hello. How could I represent the following secrets for firefox-syncserver with agenix?

      secrets = builtins.toFile "sync-secrets" ''
        SYNC_MASTER_SECRET=this-secret-is-actually-leaked-to-/nix/store
      '';

Do I just write SYNC_MASTER_SECRET=something in the agenix file?

21:39:41
@peter-lustig:matrix.orgpeter-lustig *

Hello. How could I represent the following secrets for firefox-syncserver with agenix?

      secrets = builtins.toFile "sync-secrets" ''
        SYNC_MASTER_SECRET=this-secret-is-actually-leaked-to-/nix/store
      '';

Do I just write SYNC_MASTER_SECRET=something in the .age file?

21:40:02
@cole-h:matrix.orgcole-hIf firefox-syncserver accepts a path to a file with that, yeah that would work.21:41:30
@cole-h:matrix.orgcole-h * If firefox-syncserver accepts a path to a file with those contents, yeah that would work.21:41:36
@peter-lustig:matrix.orgpeter-lustig
In reply to @cole-h:matrix.org
If firefox-syncserver accepts a path to a file with those contents, yeah that would work.

Looks like it takes a path:

Description
A file containing the various secrets. Should be in the format expected by systemd’s EnvironmentFile directory. Two secrets are currently available: SYNC_MASTER_SECRET and SYNC_TOKENSERVER__FXA_METRICS_HASH_SECRET.

Type
path
21:42:31
@cole-h:matrix.orgcole-h Then yeah, that should work. Just point it to config.age.secrets.<firefox-syncserver-server>.path 21:44:48
@peter-lustig:matrix.orgpeter-lustig
In reply to @cole-h:matrix.org
Then yeah, that should work. Just point it to config.age.secrets.<firefox-syncserver-server>.path

This should work, right?

      secrets = builtins.toFile "sync-secrets" config.age.secrets.mainserver-firefox-syncserver-secrets.age;

Modified the example config in the manual:

https://nixos.org/manual/nixos/unstable/index.html#module-services-firefox-syncserver-quickstart

21:46:05
@cole-h:matrix.orgcole-herrr not exactly21:46:16
@cole-h:matrix.orgcole-h Drop the builtins.toFile "sync-secrets" 21:46:29
@peter-lustig:matrix.orgpeter-lustigoh yeah i just saw21:46:40
@cole-h:matrix.orgcole-h Otherwise you're creating a file named sync-secrets with the contents being the path to that secret file 21:46:59
@cole-h:matrix.orgcole-h And also .age at the end should probably be .path 21:47:25
@peter-lustig:matrix.orgpeter-lustigyep21:47:59
@peter-lustig:matrix.orgpeter-lustig What I wonder is what I need the SYNC_MASTER_SECRET for. Literally cannot find any explanation. 21:48:22
@cole-h:matrix.orgcole-hhttps://github.com/mozilla-services/syncstorage-rs/blob/f416d8a8c44c4c294f9403b40f136bda85bdd709/docs/config.md?plain=1#L1321:51:38
@cole-h:matrix.orgcole-hLooks like it's just something the sync server uses21:51:50
@peter-lustig:matrix.orgpeter-lustigOh, I thought I needed a 256-bit random key21:52:35
@cole-h:matrix.orgcole-hThat would probably be more secure21:53:12
@peter-lustig:matrix.orgpeter-lustig
In reply to @cole-h:matrix.org
That would probably be more secure
So all I need in the .age file is SYNC_MASTER_SECRET=something?
21:57:45
@cole-h:matrix.orgcole-hIn its decrypted contents; that's what I would believe.21:58:08
@peter-lustig:matrix.orgpeter-lustiglets see if this works22:00:47
@peter-lustig:matrix.orgpeter-lustigIt seems like everything worked perfectly fine :)22:13:09
@peter-lustig:matrix.orgpeter-lustigI assume the Master Secret is so only the server with that secret on it can use the syncserver22:22:37
11 Mar 2023
@peter-lustig:matrix.orgpeter-lustig I am generating a private key for wireguard with the following command: wg genkey > ~/wireguard-keys/private. I want to put the output of that command in an encrypted age file. How would I do that? 14:17:17
@ryantm:matrix.orgryantm peter-lustig: agenix supports piping clear text to a secret now! 14:35:50
@peter-lustig:matrix.orgpeter-lustig
In reply to @ryantm:matrix.org
peter-lustig: agenix supports piping clear text to a secret now!
how?
14:39:17
@ryantm:matrix.orgryantm peter-lustig: wg genkey | agenix -e secret name.age 15:36:30
@ryantm:matrix.orgryantm* peter-lustig: wg genkey | agenix -e secret_name.age15:36:56

Show newer messages


Back to Room ListRoom Version: 6