An enterprise security policy requires granting an external analytics team read access to messages processed by a Google Cloud Pub/Sub subscription and read-only access to log archive files in a specific Cloud Storage bucket within the `iot-telemetry-prod` project. The team must not be permitted to publish messages, alter Pub/Sub configurations, or modify/delete storage buckets and objects. Which TWO of the following IAM role configurations follow the principle of least privilege while providing the required access? (Select TWO.)
- Grant `roles/pubsub.subscriber` on the specific Pub/Sub subscription in the `iot-telemetry-prod` project.Cevap
- BGrant the primitive `roles/editor` role at the `iot-telemetry-prod` project level.
- Grant `roles/storage.objectViewer` directly on the target Cloud Storage bucket resource.Cevap
- DGrant `roles/storage.admin` at the parent Folder level containing the `iot-telemetry-prod` project.
Cevap
Granting `roles/pubsub.subscriber` on the Pub/Sub subscription and granting `roles/storage.objectViewer` on the specific Cloud Storage bucket.
The Pub/Sub Subscriber role (`roles/pubsub.subscriber`) provides the minimal permissions necessary to read messages from Pub/Sub subscriptions without granting permissions to modify topics or publish data. Similarly, granting Storage Object Viewer (`roles/storage.objectViewer`) directly on the specific Cloud Storage bucket allows reading object data while preventing object deletion, bucket deletion, or broader project-level changes.
Adım Adım Çözüm
Anahtar Kavram
Applying Predefined IAM Roles at Resource-Specific Scopes for Least Privilege