-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOPS and fresh installation #18
Comments
Hi @archer-65 I'm +1 to the question. Did you ever find an answer? |
I think that generating keys before installation and update the desired secrets' keys through |
I am struggeling with the same problem. I have a .sops.yaml
With this I am able to generate/encrypt hosts/common/secrets.yaml
In my
The gpg-fingerprint used to encrypt/decrypt derives from my pgp-key stored on my yubikey. To bootstrap an new machine I generate a
The Installation works fine and I can boot up my machine with encrypted (ephermal?) zfs. It even logs into the graphical environment. But I cannot I will be finitely glad for any help. For reference: Here is my scrap-repo. |
Is it necessary to have a key for each machine? I want to use one single key for each user I want to install with instead of having keys for each machine |
@NovaViper I don not think, that it is necessary to have a key for each machine, but I think it is good practice. BTW: There is something wrong with my configuration. I added a hashed password to my
Seemingly the |
Ah.. So I can't use age-keys to decrypt the |
Hi there @lutzgo , did you find a solution at all? Having the same issue, and can't seem to get past it at the moment. |
@mannp I think the issue there is that you need to have in the remote host the same host key that you use to generate the age key and then encrypt the secrets.yaml file. This method is described here: I'm not using pass to store the host private key but instead I'm keeping them in Bitwarden Secret Manger. |
Hi @Tommixe thanks for your help. For the first installation on my yoga laptop I cheated and bypassed the sops stuff as it failed, but after the initial install the ssh private keys are correctly added to /persist/etc/ssh/ssh_host_ed25519_key, but oddly they are not the correct keys :-( ?? I thought initially they were being taken from my host machine, but they are different again, so I am unclear where the ssh keys are coming from at the moment..... I am assuming once I find that out and change them, all will be fine.
Is this the ssh_host_ed25519_key being stored, or a password to unlock somehow....it confused me a little? I have sops working great on my k3s cluster, but on nix not at all. Edit: My rookie error, as I had created the ssh_host_ed25519_key for the user and not for root, so the keys did not match. Once I updated the host keys to match those create on the target, the secrets were decrypted :) |
Hey all, I usually copy the booted ISO's generated SSH keys into /persist when installing, and use that public key to encrypt the secrets for the newly-added machine. It's not super convenient, but I'm not a fan of the alternative (copying private keys). I haven't tried nixos-anywhere just yet, but I think it should be possible to somehow replicate that with it. Maybe a possible way to it would be:
|
I think GPG will never work that nicely in root level. Using the SSH Host keys to age-encrypt is the way to go, while GPG is better for your "personal key to edit the secrets manually". |
@Misterio77 I'm actually switching to use the host ssh keys aswell as my yubikey-based gpg key, how do you handle the host's private ssh keys for cases where a machine needs to be reinstalled? |
Hello! I really like your repo structure, I'm constantly visiting it.
I decided to try sops-nix to manage sensible stuff, and I'm curious: how do you handle the first installation? Keys need to be deployed to allow decryption at activation time.
The text was updated successfully, but these errors were encountered: