An automated deployment process requires access to upload build artifacts as new files into a specific Cloud Storage bucket named `prod-build-artifacts` located inside the project `app-deployments-prod`. According to organization security compliance, the process must adhere strictly to the Principle of Least Privilege by ensuring it cannot read existing objects, overwrite/delete files, or access any other buckets in the project or parent folder. Which IAM role assignment strategy should be configured?
- Grant the predefined role Storage Object Creator (roles/storage.objectCreator) on the specific prod-build-artifacts bucket resource.Answer
- BGrant the primitive role Editor (roles/editor) at the app-deployments-prod project level.
- CGrant the predefined role Storage Object Creator (roles/storage.objectCreator) at the parent Folder level containing app-deployments-prod.
- DGrant the primitive role Viewer (roles/viewer) on the prod-build-artifacts bucket resource.
Answer
Grant the predefined role Storage Object Creator (roles/storage.objectCreator) specifically on the target Cloud Storage bucket resource.
Granting `roles/storage.objectCreator` directly on the target Cloud Storage bucket grants only the necessary `storage.objects.create` permission specifically on that bucket. It prevents reading existing objects, deleting data, and accessing any other buckets in the project or folder hierarchy.
Step-by-Step Solution
Key Concept
Principle of Least Privilege and IAM Resource Hierarchy Binding
Estimated Time:2m 0s