diff --git a/docs/guides/mozilla-sops.md b/docs/guides/mozilla-sops.md index fd2d16d1..c39fec0d 100644 --- a/docs/guides/mozilla-sops.md +++ b/docs/guides/mozilla-sops.md @@ -21,7 +21,10 @@ brew install gnupg sops Generate a GPG/OpenPGP key with no passphrase (`%no-protection`): -```console +```sh +export KEY_NAME="cluster0.yourdomain.com" +export KEY_COMMENT="flux secrets" + gpg --batch --full-generate-key < ./clusters/cluster0/.sops.pub.asc +```sh +gpg --export --armor "${KEY_FP}" > ./clusters/cluster0/.sops.pub.asc ``` Check the file contents to ensure it's the public key before adding it to the repo and committing. -```console +```sh git add ./clusters/cluster0/.sops.pub.asc git commit -am 'Share GPG public key for secrets generation' ``` Team members can then import this key when they pull the Git repository: -```console +```sh gpg --import ./clusters/cluster0/.sops.pub.asc ``` @@ -121,11 +128,12 @@ Write a [SOPS config file](https://github.com/mozilla/sops#using-sops-yaml-conf- to store encrypted objects with this particular GPG key's fingerprint. ```yaml -# ./clusters/cluster0/.sops.yaml +cat < ./clusters/cluster0/.sops.yaml creation_rules: - path_regex: .*.yaml encrypted_regex: ^(data|stringData)$ - pgp: 1F3D1CED2F865F5E59CA564553241F147E7C5FA4 + pgp: ${KEY_FP} +EOF ``` This config applies recursively to all sub-directories.