DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Sops

Encrypt / Decrypt

You Azure user must have "Encrypt" and "Decrypt" Access Policy for the key.
1
KEY_VAULT_NAME="PASTE-YOUR-KEY-VAULT-NAME-HERE"
2
KEY_NAME="PASTE-YOUR-KEY-NAME-HERE"
3
KV=$(az keyvault key show --name $KEY_NAME --vault-name $KEY_VAULT_NAME | jq -r ".key.kid")
4
5
sops --encrypt --azure-kv $KV file-decrypted > file-encrypted
6
sops --decrypt file-encrypted
Copied!

References