Difference between revisions of "Sops --decrypt"

From wikieduonline
Jump to navigation Jump to search
Line 15: Line 15:
 
To edit file directly in your text editor:
 
To edit file directly in your text editor:
 
  sops contrib/helm/your-projects/secrets_prod.yaml  
 
  sops contrib/helm/your-projects/secrets_prod.yaml  
 +
[[--ignore-mac]]
  
  

Revision as of 14:11, 21 November 2022

--decrypt, -d 
sops --decrypt /path/to/your/file/to/decrypt.yaml
sops --decrypt --in-place /path/to/your/file/to/decrypt.yaml


sops --decrypt  contrib/helm/your-projects/secrets_prod.yaml 
(no output)
File will be unencrypted and replated.


To edit file directly in your text editor:

sops contrib/helm/your-projects/secrets_prod.yaml 
--ignore-mac



Errors

sops -d contrib/helm/your-aplication/secrets_prod.yaml > /tmp/decrypted_secrets_prod.yaml
Failed to get the data key required to decrypt the SOPS file.

Group 0: FAILED
  projects/your-project/locations/global/keyRings/sops/cryptoKeys/sops-encryption-key: FAILED
    - | Error decrypting key: googleapi: Error 403: Permission
      | 'cloudkms.cryptoKeyVersions.useToDecrypt' denied on resource
      | 'projects/your-project/locations/global/keyRings/sops/cryptoKeys/sops-encryption-key'
      | (or it may not exist)., forbidden

Recovery failed because no master key was able to decrypt the file. In order for SOPS to recover the file, at least one key has to be successful, but none were.

Solution: Cloud KMS CryptoKey Encrypter/Decrypter


MAC mismatch. File has <signature>, computed <different signature>


Related

See also

Advertising: