agenix - manage NixOS secrets
This project has not be audited by a security professional.
agenix
is a commandline tool for managing secrets encrypted with your existing SSH keys. It includes a NixOS module age
for adding encrypted secrets into the Nix store and decrypting them.
Problem and solution
All files in the Nix store are readable by any system user, so it is not a suitable place for including cleartext secrets. Many existing tools (like NixOps deployment.keys) deploy secrets separately from nixos-rebuild
, making deployment, caching, and auditing more difficult. Out-of-band secret management is also less reproducible.
agenix
solves these issues by using your pre-existing SSH key infrastructure and age
to encrypt secrets into the Nix store. Secrets are decrypted using an SSH host private key during NixOS system activation.
Features
- Secrets are encrypted with existing SSH keys
- system public keys via
ssh-keyscan
- can use public keys available on GitHub for users (for example, https://github.com/ryantm.keys)
- system public keys via
- No GPG
- Very little code, so it should be easy for you to audit
- Encrypted secrets are stored in the Nix store, so a separate distribution mechanism is not necessary
Public Beta
Today, I’ve released version 0.9 which is the first public beta release. Right now, I may be the only user of agenix
. I use it at home to manage all my secrets. Please take a look at the code, provide feedback, and try it out!
Shout out to @Mic92 whose sops-nix is probably much more production-ready™.