An enterprise DevOps team needs to collect high-severity application logs across all projects within a Google Cloud folder and publish them to a centralized Pub/Sub topic for real-time automated incident response. The solution must capture only error-level logs and adhere strictly to Google Cloud security best practices and least-privilege access. Which TWO actions should the team take to implement this logging architecture?
- Create an aggregated log sink at the folder level with an inclusion filter specifying severity >= ERROR, setting the centralized Pub/Sub topic as the destination.Cevap
- Grant the Pub/Sub Publisher role (roles/pubsub.publisher) to the writer service account generated by the folder log sink on the target Pub/Sub topic.Cevap
- CGrant the Owner primitive role (roles/owner) to the folder log sink's writer service account on the centralized monitoring project to guarantee log export delivery.
- DConfigure an exclusion filter at the folder level for log entries with severity >= ERROR to prevent duplicate log storage and reduce ingestion overhead.
- EGrant the Service Account User role (roles/iam.serviceAccountUser) to the operations team on the log sink resource so Cloud Logging can impersonate their user identity.
Cevap
To establish real-time centralized error log routing, the enterprise should create a folder-level aggregated log sink configured with an inclusion filter of severity >= ERROR pointing to the Pub/Sub topic, and grant the sink's unique writer service account the Pub/Sub Publisher role (roles/pubsub.publisher) on that topic.
Centralized cross-project logging across a resource hierarchy requires a folder-level aggregated log sink. Setting an inclusion filter for severity >= ERROR ensures that only high-severity operational logs are routed to the central Pub/Sub topic destination. Furthermore, Cloud Logging generates a unique writer service account for the sink; granting this service account the predefined Pub/Sub Publisher role (roles/pubsub.publisher) on the target topic complies with the principle of least privilege.
Adım Adım Çözüm
Anahtar Kavram
Aggregated Log Sinks and Least-Privilege IAM Sink Authorization