QuestionQ81

VerifiedConfiguring access

You are building a new application that uses only Compute Engine VMs. Once per day, the application will run five distinct batch jobs. Every batch job needs its own dedicated set of permissions for Google Cloud resources outside your application. You must create a secure access model for the batch jobs that follows the least-privilege principle.

What should you do?

Explanation

Use a separate service account for each batch job and grant it only the permissions that job requires. The Compute Engine orchestration identity can impersonate each batch-job service account to obtain a short-lived OAuth 2.0 access token; the Service Account Token Creator role includes iam.serviceAccounts.getAccessToken. This preserves per-job least privilege and avoids long-lived, user-managed service-account keys.

Learn more

Community Discussion

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