Question

Difficulty: MediumConfiguring Cloud Logging, Monitoring, and Operational Alerting

A company requires long-term retention of system error logs from Google Kubernetes Engine (GKE) clusters in a centralized Cloud Storage bucket located in a separate compliance project. An administrator configures an organization-level log sink with an inclusion filter for error log entries. However, logs are not appearing in the target destination bucket. Which action should be taken to ensure log delivery following the principle of least privilege?

  1. Grant the unique service account (writer identity) generated for the log sink the Storage Object Creator role on the destination Cloud Storage bucket.Answer
  2. B
    Grant the Cloud Logging Service Agent the primitive Owner role on the destination compliance project.
  3. C
    Grant the GKE node pool default service account the Service Account Admin role across the organization.
  4. D
    Submit a Cloud Console support ticket to request a regional quota increase for aggregated log sink throughput.

Answer

Grant the unique service account (writer identity) generated for the log sink the Storage Object Creator role on the destination Cloud Storage bucket.
When configuring a Cloud Logging sink that exports logs to a destination in another project or resource, Cloud Logging generates a unique service account called a writer identity (e.g., `serviceAccount:[email protected]`). To grant log delivery access according to least privilege, you must grant this specific writer identity the `roles/storage.objectCreator` role directly on the destination Cloud Storage bucket.

Step-by-Step Solution

1
Identify the log sink writer identity
Obtain the unique service account created automatically when the log sink was provisioned.
Cloud Logging log sinks use a dedicated writer identity service account to write log entries to external destinations.
2
Assign fine-grained destination permissions
Grant `roles/storage.objectCreator` to the sink writer identity specifically on the destination Cloud Storage bucket.
The writer identity requires write access to create log blobs in the destination bucket without granting broad privileges over the destination project.

Key Concept

Log Sink Writer Identity IAM Permissions
Rate this question