-
Notifications
You must be signed in to change notification settings - Fork 989
Open
Description
The root cause of this issue is the same as #1142 but the way it manifests is different, and the workaround available for #1142 is not possible in this scenario. This issue is currently preventing our CD tooling from decrypting secrets.
The setup is this:
- I have a KMS key in project
foowhere the KMS API is enabled. - I have a workload in project
barwhere the KMS API is disabled. - My workload runs under a service account
bar-accountwhich has been grantedroles/cloudkms.cryptoKeyDecrypteron the key that lives infoo. - Despite having all the permissions required to perform decryption,
sops decryptfails because the KMS API is not enabled in projectbar.
$ sops decrypt secrets.stage.env
Failed to get the data key required to decrypt the SOPS file.
Group 0: FAILED
projects/bar/locations/global/keyRings/sops-stage/cryptoKeys/sops-stage: FAILED
- | failed to decrypt sops data key with GCP KMS key: rpc error:
| code = PermissionDenied desc = Cloud Key Management Service
| (KMS) API has not been used in project 756669343665 before
| or it is disabled. Enable it by visiting
| https://console.developers.google.com/apis/api/cloudkms.googleapis.com/overview?project=756669343665When I run a sops binary built with the patch in #1697 the call succeeds.
/sops-linux-amd64 decrypt secrets.stage.env
password=supersecret
If there's anything else I can provide to help get this patch merged please let me know.
Metadata
Metadata
Assignees
Labels
No labels