Skip to content
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

feat: use age instead of gpg for sops #153

Merged
merged 5 commits into from Nov 25, 2021
Merged

feat: use age instead of gpg for sops #153

merged 5 commits into from Nov 25, 2021

Conversation

onedr0p
Copy link
Owner

@onedr0p onedr0p commented Nov 24, 2021

Signed-off-by: Devin Buhl devin@buhl.casa

Description of the change

Use age instead of gpg

Benefits

Age is easier to configure and use, Flux also mentions in their documentation to use this over GPG when you are able to.

Possible drawbacks

Applicable issues

Additional information

To migrate from GPG to Age:

  • Create age public / private key:
age-keygen -o age.agekey
mkdir -p ~/.config/sops/age
mv age.agekey ~/.config/sops/age/keys.txt
export SOPS_AGE_KEY_FILE=~/.config/sops/age/keys.txt
source ~/.bashrc
  • Decrypt all secrets (e.g. find ./cluster -type f -iname "*sops*" -exec sops --decrypt --in-place {} \;
  • Update .sops.yaml with age public key and remove pgp keys.
  • Encrypt all secrets with age (e.g. find ./cluster -type f -iname "*sops*" -exec sops --encrypt --in-place {} \;)
  • Create sops-age secret for flux:
cat ~/.config/sops/age/keys.txt |
    kubectl -n flux-system create secret generic sops-age \
    --from-file=age.agekey=/dev/stdin
  • Update sops-gpg secret to sops-age in the 3 files in the ./cluster/base directory
  • Commit and push your changes
  • Apply the flux-system kustomization (e.g. k apply -k cluster/base/flux-system/)

Signed-off-by: Devin Buhl <devin@buhl.casa>
Signed-off-by: Devin Buhl <devin@buhl.casa>
Signed-off-by: Devin Buhl <devin@buhl.casa>
@onedr0p onedr0p changed the title feat: use age instead of gpg feat: use age instead of gpg for sops Nov 24, 2021
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@mrueg
Copy link
Contributor

mrueg commented Nov 24, 2021

In general looks good to me, I still need to execute in on a cluster.
One thing that might be worth for users to cover is:

  • Migration from gnupg to age (or recommend a reinstall)

Signed-off-by: Devin Buhl <devin@buhl.casa>
Signed-off-by: Devin Buhl <devin@buhl.casa>
@onedr0p
Copy link
Owner Author

onedr0p commented Nov 24, 2021

I added a rough migration guide to the PR

@onedr0p onedr0p merged commit 35d41ca into main Nov 25, 2021
@onedr0p onedr0p deleted the sops-age branch November 25, 2021 13:44
edmundmiller added a commit to edmundmiller/home-ops that referenced this pull request Jan 18, 2022
Already did it in my dotfiles.
Guide: onedr0p/cluster-template#153
edmundmiller added a commit to edmundmiller/home-ops that referenced this pull request Jan 18, 2022
Already did it in my dotfiles.
Guide: onedr0p/cluster-template#153
edmundmiller added a commit to edmundmiller/home-ops that referenced this pull request Jan 18, 2022
Already did it in my dotfiles.
Guide: onedr0p/cluster-template#153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate support for age as an alternative for gnupg
2 participants