-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot create GCP KMS when using Google Workload Identity Federation #969
Comments
Yup, getting this same issue - seems if the sops team upgrades to the latest oath2 library this can be resolved? ie: googleapis/repo-automation-bots#2752 |
I have this issue as well - can we get an update about how to resolve this issue? I'd really rather not generate a JSON key as it's less secure than using Workload Identity |
any updates on this? |
Same issue here as well - thanks for the help |
on 3.7.2 still have this bug |
It's because the referenced PR is marked for 3.7.3 release. You have to build it yourself if you want the fix included. |
As @kpocius said, this will be resolved in the next point release. |
When will 3.7.3 be released? We want to use Google Workload Identity Federation as soon as possible! |
Hi, just to check if anyone is having any strange issues, when using Workload Identity to access GCP KMS I am getting permission errors intermittently throughout the day (using v3.7.3). So obviously works from time to time, but often doesn't as well at the same container. Anyone with similar symptoms? |
@AndreLobato I haven't see any issue in the wild, at least for now. We are using sops I would say several times a day to decrypt secrets using Workload Identity obtained credentials, so maybe we also don't have a sufficient usage rate to trigger your issue? |
@multani Thanks for the response! I don't think rate is an issue, as in my case the usage is very low, I've set a monitor script running decrypt at every minute and on the last 6 hours there were only 2 occasions which failed, one lasted 4 min the other only 2 min. So I am suspecting some connectivity issue between GKE Metadata Server and GCP KMS or something else. |
Hey all, @AndreLobato idk if you solved your issue but I was getting an error about GCP KMS key not being found even though I followed the steps to create the key. My issue was that I kept getting a failure trying to decrypt,encrypt,etc even though I had previously used the key. What I found out was that I originally created a IAM key from a service account awhile ago that was stored in a different project. I saved this config in my local gcloud CLI and it was overriding the project location. (How this worked the first time... idk) after running the below steps I was able to remove this error even in the latest release of SOPS. `Failed to get the data key required to decrypt the SOPS file. Group 0: FAILED Quick fix this run the following steps: gcloud auth application-default login
export GOOGLE_APPLICATION_CREDENTIALS=/Users/$USER/.config/gcloud/application_default_credentials.json
echo 'export GOOGLE_APPLICATION_CREDENTIALS=/Users/$USER/.config/gcloud/application_default_credentials.json' > ~/.zshrc Cheers! Hope this helps someone |
Helped me, thanks |
Hi @armand93420, I haven't solved the issue, but figured out why. Turns out the GCP network is fairly unstable from where I was testing from, so every now or then I would get network connection errors causing the failure to decrypt. Wasn't an issue to me as most of services have retries in place to deal with that. Glad to hear you solved your issue. |
I'm authenticating and authorizing a GitHub Action workflow to impersonate a GCP service account using Workload Identity Federation, which has permissions to decrypt a SOPS-encrypted file. I'm using https://github.com/google-github-actions/auth to do so, which exports the
GOOGLE_APPLICATION_CREDENTIALS
environment variable and sets it to a generated credentials file. However, when it comes to usingsops
to decrypt the file, I encounter this error:Indeed, this credential file is of type
external_account
, notservice_account
which would normally work.The error is generated here. Looking further into this, I see the function is deprecated, and on top of that, the version of the pkg.go.dev/google.golang.org/api package used in
sops
is severely outdated.My suspicion lays in the outdated google api package which may not support workload identity federation, but of course there may be other reason(s) for why it's not supported.
The text was updated successfully, but these errors were encountered: