jenkinsci / google-storage-plugin

This plugin provides the “Google Cloud Storage Uploader” post-build step for publishing build artifacts to Google Cloud Storage.
https://plugins.jenkins.io/google-storage-plugin/
Apache License 2.0
31 stars 57 forks source link

Set the cloud-platform access scope #281

Open veram96 opened 10 months ago

veram96 commented 10 months ago

I would like to suggest the use of CLOUD_PLATFORM scope instead of the DEVSTORAGE_FULL_CONTROL scope. I am facing a problem with Jenkins deployed in GKE and using Workload identity as the authentication method for Jenkins agents where I cannot use this plugin because of the scope requirement.

Screenshot 2023-12-22 at 7 04 54 p m

The suggestion is also motivated by this lines:

"There are many access scopes available to choose from, but a best practice is to set the cloud-platform access scope, which is an OAuth scope for Google Cloud services, and then control the service account's access by granting it IAM roles."

Found in Google documentation

This fixes #231

Testing done

I test the change manually and it seems to fix the problem described.

Screenshot 2023-12-22 at 7 10 07 p m