Difference between revisions of "Sops --encrypt --gcp-kms"

From wikieduonline
Jump to navigation Jump to search
Line 9: Line 9:
 
== Examples ==
 
== Examples ==
 
* <code>[[sops --encrypt --gcp-kms]] $[[KMS_PATH]] secret.yaml > secret.enc.yaml</code>
 
* <code>[[sops --encrypt --gcp-kms]] $[[KMS_PATH]] secret.yaml > secret.enc.yaml</code>
* <code>[[sops --encrypt --gcp-kms]] $[[KMS_PATH]] --in-place secret.yam</code>
+
[[sops --encrypt --gcp-kms]] $[[KMS_PATH]] --in-place your-secret.yaml
 +
(no output)
 +
 
 +
sops --encrypt --in-place [[--unencrypted-regex]] '^(description|metadata)$' k8s-secret.yaml
 +
(no output)
 +
 
 +
sops --encrypt [[--encrypted-regex]] '^(data|stringData)$' app-secret.yaml
 +
(no output)
  
 
== Errors ==
 
== Errors ==

Revision as of 07:06, 24 November 2022

sops --encrypt --gcp-kms

You can define your key using --gcp-kms option or by defining a SOPS_GCP_KMS environment variable

Exporting your key:

  • export SOPS_GCP_KMS="projects/your-project/locations/global/keyRings/your-keyring/cryptoKeys/your-sops-encryption-key"

Examples

sops --encrypt --gcp-kms $KMS_PATH --in-place your-secret.yaml
(no output)
sops --encrypt --in-place --unencrypted-regex '^(description|metadata)$' k8s-secret.yaml
(no output)
sops --encrypt --encrypted-regex '^(data|stringData)$' app-secret.yaml
(no output)

Errors

sops --encrypt --gcp-kms only-one-file
Error: no file specified

Related

See also

Advertising: