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

Use instance service account tokens in cloud init http downloads #1549

Open
rrs45 opened this issue Jul 27, 2021 · 3 comments
Open

Use instance service account tokens in cloud init http downloads #1549

rrs45 opened this issue Jul 27, 2021 · 3 comments
Labels

Comments

@rrs45
Copy link

rrs45 commented Jul 27, 2021

I want to download files from cloud storage in GCP, using service account assigned to the VM instance. Currently, cloud-init doesnt support using bearer tokens with http gets. There is a way to pull access tokens from local metadata server as shown in the link below. Would it be possible to implement it in cloud-init? I could see similar use cases for other major providers.

https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#applications

@eyberg eyberg added the klibs label Jul 27, 2021
@francescolavra
Copy link
Member

It could be done. A possible way to do it would be to have an optional "auth" attribute in download directives, which when set to something like "access_token" would prompt the cloud_init klib to detect the cloud the instance is running on, and if the detected cloud is GCP, retrieve the access token from the metadata server and then use it in the HTTP download request. But there is a non-trivial amount of work involved.

@rrs45
Copy link
Author

rrs45 commented Jul 29, 2021 via email

@francescolavra
Copy link
Member

As of now, this is not a high-priority feature, so I don't have an ETA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants