Skip to content
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

Added support for access tokens in gcpkms #1358

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christoffer-eide
Copy link

This PR adds support for access token (via the GOOGLE_CREDENTIALS env var).

If the env var GOOGLE_CREDENTIALS is not set, the gcloud sdk fetches an access token from the instance metadata endpoint http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token.

In our workload on GKE, we don't want to use the access token returned by the metadata endpoint directly. We use this access token to impersonate another service account, which has the minimum of permissions required for the kms decrypt.

There is no facility to set access tokens in sops, only static (long lived) credentials via the credentials file/GOOGLE_CREDENTIALS.

@christoffer-eide christoffer-eide force-pushed the add-support-for-gcp-kms-access-tokens branch 2 times, most recently from 797ef4f to 26f3545 Compare November 25, 2023 20:59
@devstein devstein requested a review from a team November 26, 2023 01:26
@devstein devstein added keyservice/gcpkms go Pull requests that update Go code labels Nov 26, 2023
@christoffer-eide christoffer-eide force-pushed the add-support-for-gcp-kms-access-tokens branch from 7a7136f to ec9a4a7 Compare December 17, 2023 19:30
Copy link
Contributor

@devstein devstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing @christoffer-eide 🥇

Looks good to me. Can you quickly fix the merge conflicts?

cc @getsops/maintainers if anyone else wants to take a look

@devstein devstein requested a review from a team December 29, 2023 22:08
Copy link
Contributor

@devstein devstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Meant to comment, not approve yet)

Copy link
Contributor

@devstein devstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a note to the GCP KMS docs for others to discover this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code keyservice/gcpkms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants