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

Permission error with newest version: 'iam.serviceAccounts.signBlob' denied on resource #171

Open
hendrik244 opened this issue May 25, 2023 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@hendrik244
Copy link

hendrik244 commented May 25, 2023

Hi,

just updated to the latest version of strapi and this plugin.
All services are hosted in gcp.
After updating I received this error, when trying to fetch content with images (stored in gcs) included:

Bildschirmfoto 2023-05-25 um 10 34 47

After rolling it back to the former used version (4.5.6) it all runs fine again. Even with the latest strapi version.

Best regards,
Hendrik

@tjablonski
Copy link

I have same issue with 4.10.2

@marcneander
Copy link

Same here

@hendrik244
Copy link
Author

This helped me out: https://stackoverflow.com/questions/75071759/google-cloud-storage-permission-denied

Maybe not the plugin, but gcp is the problem...

@Lith Lith added bug Something isn't working help wanted Extra attention is needed labels Jun 7, 2023
@knokmki612
Copy link

knokmki612 commented Jul 12, 2023

Maybe not the plugin, but gcp is the problem...

I think it also relates to release version of 4.10.1
https://github.com/strapi-community/strapi-provider-upload-google-cloud-storage/releases/tag/4.10.1

Because this release supports gcs signed url
https://cloud.google.com/storage/docs/access-control/signed-urls#signing-iam

If my guess is correct, enable publicFiles options will be change the situation (If you don't want to use expires option signed url).

@LaurenceHo
Copy link

Is that possible we don't use signed url on public files? or maybe we can config whether we want to use signed URL or not?

@benaduggan
Copy link

This helped me out: stackoverflow.com/questions/75071759/google-cloud-storage-permission-denied

Maybe not the plugin, but gcp is the problem...

This also helped fix things for me! Specifically adding the "Service Account Token Creator" role to our service account. Also just wanted to show off my config block in case it helps anyone else!

image

@knokmki612
Copy link

Is that possible we don't use signed url on public files?

Yes that's possible. if you set true to publicFiles option, you can get unsigned url. This behavior documented as follows:

Files are signed when publicFiles is set to false.

https://github.com/strapi-community/strapi-provider-upload-google-cloud-storage#expires

or maybe we can config whether we want to use signed URL or not?

We can choose to use signed URL or not by publicFiles option.

@Fryuni
Copy link

Fryuni commented Oct 25, 2023

This should just be documented on the new version, but it is not something that this plugin can change.

The new version of the @google-cloud/storage library uses the new signature method to sign the upload (and preview) URLs. The new method requires a different IAM permission, not on the bucket but on the service account itself.

You either have to use a key file, which allows signing the blobs locally, or grant the role "Service Account Token Creator" (role/iam.serviceAccountTokenCreator) to the service account on the service account itself. This is in addition to the roles required to manage the files in the bucket, those were already required and still are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants