QuestionQ65

VerifiedEnsuring the successful operation of a cloud solution

You manage your organization's logging by aggregating logs into a centralized Google Cloud project. The aggregated logs originate from two source projects: one for a frontend application and one for a backend application. You must grant the frontend development team access to view all logs from the frontend project and only the Cloud Run service logs from the backend project. The team must not be able to view any other logs. You want to apply the principle of least privilege and implement a cost-efficient solution. What should you do?

Explanation

A Cloud Logging log view on the aggregated log bucket can filter entries to include all frontend-project logs and only backend-project logs of the cloud_run_revision resource type, which Cloud Run service logs use. Log view filters accept source(), log_id(), resource.type and NOT on those; flexible filters add OR and can also compare resource labels, labels and App Hub labels. Severity is not among the supported fields, so the backend restriction is expressed as a resource type. Granting roles/logging.viewAccessor on that specific view gives the team access only to the entries exposed by the view, enforcing least privilege without creating and operating a separate export destination.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!