-
Notifications
You must be signed in to change notification settings - Fork 25
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
Workload Identity Federation from AWS support #29
Comments
Hello, Sorry for bumping an old issue, but I wonder if my use-case would be similar, I need to auth with WIP, but on any kind of Kubernetes cluster. In the end, I need to auth with this equivalent gcloud iam workload-identity-pools create-cred-config \
projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID \
--credential-source-file=/var/run/service-account/token \
--credential-source-type=text \
--output-file=credential-configuration.json If I'm not mistaken, the produced JSON file may be used as a I planned on writing a custom Do you have ideas about how things should be implemented ? Like, creating a new variant of Should I create another issue ? Thanks for reading ! |
Hi, Your use case seems already covered in my implementation:
AWS is a special one since it requires to implement complex interaction with AWS. Yours looks like just a file and it should work. GitHub has similar integration and it works even in this repo. |
In theory you shouldn't write anything and can use the crate out of box. It should handle workload identity in kubernetes automatically (just make sure it is enabled in GKE). |
Thanks for quick reply ! Indeed, looks like it is already covered, but in the above If I'm not mistaken, with what's done in the crate, I should just have to provide it :
I probably have missed something, sorry for asking |
Oh, right, you don't have metadata server and stuff available I guess? Is it some kind of self hosted Kubernetes? Let me investigate available options and come back to you. |
I think I found something : https://cloud.google.com/iam/docs/workload-download-cred-and-grant-access What it produces : {
"type": "external_account",
"audience": "//iam.googleapis.com/projects/<PROJECT_NUMBER>/locations/global/workloadIdentityPools/<WIP_ID>/providers/<WIPP_ID>",
"subject_token_type": "urn:ietf:params:oauth:token-type:jwt",
"token_url": "https://sts.googleapis.com/v1/token",
"credential_source": {
"file": "/run/secrets/kubernetes.io/serviceaccount/token",
"format": {
"type": "text"
}
}
} I guess I just have to format the file for my need and reference it with I'll try that and let you know. EDIT : And I think I can even use the EDIT 2 : I confirm it works with |
Yeah, this should work. I was trying to find a similar example, glad you have already found it. |
One thing worth to mention about that file, please consider it also as a sensitive file so nobody can modify it. |
AWS needs a specialised implementation for Workload Identity Federation authentication.
Described here:
https://google.aip.dev/auth/4117
The text was updated successfully, but these errors were encountered: