
We assume you have an instance (or more) of Vault running and you have privileged access to it. Now you can encrypt a file using: $ sops -encrypt -azure-kv test.yaml > $ az keyvault key show -name sops-key -vault-name $keyvault_name -query key.kid $ az keyvault set-policy -name $keyvault_name -resource-group sops-rg -spn $AZURE_CLIENT_ID \
#BASH AWS COMMAND NOT FOUND MAC FROM ATOM COMMAND LINE SOFTWARE#
$ az keyvault key create -name sops-key -vault-name $keyvault_name -protection software -ops encrypt decrypt $ az keyvault create -name $keyvault_name -resource-group sops-rg -location westeurope $ keyvault_name=sops- $(uuidgen | tr -d - | head -c 16 ) # Create a Vault, a key, and give the service principal access: # Key Vault names are globally unique, so generate one: $ az group create -name sops-rg -location westeurope # Create a resource group if you do not have one: You can force a specific authentication method through the AZURE_AUTH_METHODĮnvironment variable, which may be one of: clientcredentials, clientcertificate,įor example, you can use service principals with the following environment variables: The Azure Key Vault integration tries several authentication methods, in Now you can encrypt a file using: $ sops -encrypt -gcp-kms projects/my-project/locations/global/keyRings/sops/cryptoKeys/sops-key test.yaml > Īnd decrypt it using: $ sops -decrypt Projects/my-project/locations/global/keyRings/sops/cryptoKeys/sops-key ENCRYPT_DECRYPT ENABLED $ gcloud kms keys list -location global -keyring sops $ gcloud kms keys create sops-key -location global -keyring sops -purpose encryption

$ gcloud kms keyrings create sops -location global To decrypt a file in a cat fashion, use the -d flag: As long as one of the KMS or PGP method is still usable, you will be able =oJgS -END PGP MESSAGE-Ī copy of the encryption/decryption key is stored securely in each KMS and PGPīlock.

User: ENC password: ENC # private key for secret operations in app2 key: |- ENC an_array: Recommended to use at least two master keys in different regions.

If you're using AWS KMS, create one or multiple master keys in the IAM consoleĪnd export them, comma separated, in the SOPS_KMS_ARN env variable. 7.1 Compromised AWS credentials grant access to KMS master keyįor a quick presentation of Sops, check out this Youtube tutorial:.6.2 KMS, Trust and secrets distribution.4.7 Using sops as a library in a python script.4.5 Extract a sub-part of a document tree.2.18 Passing Secrets to Other Processes.2.13 Specify a different GPG key server.2.12 Specify a different GPG executable.sops.yaml conf to select KMS/PGP for new files 2.8 Assuming roles and using KMS in various AWS accounts.
