-
Notifications
You must be signed in to change notification settings - Fork 336
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
Support signurl using compute engine service account #983
Comments
Hi @horgh, that error indicates that you are not using a service account. Can you check your boto config? Maybe you are using your user account instead of a service account in the boto config.
More info https://cloud.google.com/storage/docs/gsutil/commands/signurl |
Thanks for the response! I actually have no boto config in use for other gsutil commands that succeed, other than I believe
I figured gsutil is automatically picking up the default compute engine service account. Here's an example (I have no
|
You can run |
|
|
Interesting! This might need a fix. I guess GCE service accounts were not handled here Line 314 in 08f6963
gsutil/gslib/gcs_json_credentials.py Line 375 in 9af3262
|
Oh ok. That sounds promising! I'm not familiar with the code at all :-). I'm happy to test anything if that would help though! |
Edited the title to better describe the exact feature that is needed here. On digging a little more into this problem, it looks like the fix is not as simple as I thought earlier. We might have to figure out other ways to access the service account email which would need further exploring the API. A quick look here shows that currently there is no good way to extract that information. |
I think it's available via the GCE metadata API, if that's an option. In Go I look it up for SignBlob using this call (passing |
Hi! Do you think there is any chance this will be supported some time soon? It has been blocking my team switching to managed private keys in a few spots. We'd love to be able to do this without bespoke code on our side, since so far we've been able to wrap Thank you! |
I wound up creating a simple tool to generate signed urls that may be useful to those affected by this bug. retailnext/gcsdropbox creates signed urls using the signBlob api to sign the url using a service account's Google-managed key. The requirements are that you must specify the service account you want to use, and the ambient ADC (Application Default Credentials) must have the |
Hi! Same problem here with version 4.61 of Thanks in advance. |
Also running into this issue. Any updates? |
A quick update after a bit more digging: It turns out we can fetch the SA email using a single API call (on any given GCE instance):
While this is great, we had assumed up until this point that we just needed the SA email and then we'd be able to generate the key. The problem is actually a bit deeper than that, as the actual signing API call happens in oauth2client, which unfortunately does not support signing with GCE service accounts (and never will): Seeing what the draft implementation looks like, it seems possible that we could use the IAM API to perform the sign blob operation, although when I did a quick test implementation I kept getting stopped by 400 errors. We'll need to do a bit more digging, but so far I'm not convinced this is feasible. |
Hi! I noticed in #968 there was functionality added to create signed URLs without a local private key. That's awesome! I'm trying to use this and I could use a little help.
I'm running on a compute instance and I'm able to do things like list the contents of my bucket without setting up any special configuration using the default service account, but trying to create a signed URL results in this message:
I'm guessing I need to set up a boto config, though I haven't had to do that for other actions. Is there anything you could suggest?
I'm using gsutil 4.49.
Thank you!
The text was updated successfully, but these errors were encountered: