Soru

Zorluk: ZorProgrammatic GCP Interaction via SDK, CLI, and APIs

A central security auditing application hosted on a Compute Engine instance needs to programmatically scan metadata and security postures across multiple Google Cloud projects in an organization using the official Cloud Client Libraries. Security governance policies strictly prohibit the creation of exportable, long-lived service account key files and mandate minimal role privilege grants across all target projects. Which TWO configuration choices should you implement to establish secure programmatic authentication for the audit application?

  1. Configure the application to leverage Application Default Credentials (ADC) to automatically obtain short-lived tokens from the Compute Engine metadata server.Cevap
  2. Grant the instance service account the Service Account Token Creator role on target service accounts in each target project to enable short-lived impersonation.Cevap
  3. C
    Generate service account JSON key files for each target project and dynamically load them into the auditing application via environment variables.
  4. D
    Assign the Owner primitive IAM role to the central auditing service account at the Organization level to ensure unhindered API access.

Cevap

The application should be configured to use Application Default Credentials (ADC) via the metadata server, paired with Service Account Impersonation using the Service Account Token Creator role on specific target service accounts.
Using Application Default Credentials allows the SDK to automatically query the Compute Engine metadata server for temporary credentials. Combining this with Service Account Impersonation using the Service Account Token Creator role enables short-lived, fine-grained access across target projects without creating exportable key files.

Adım Adım Çözüm

1
Establish identity authentication mechanism
Application Default Credentials automatically detects runtime environment credentials from the Compute Engine metadata server without requiring key files.
Eliminates the need for long-lived service account key files.
2
Configure cross-project programmatic access
Granting roles/iam.serviceAccountTokenCreator on target service accounts allows the central service account to impersonate target service accounts and generate short-lived access tokens.
Adheres to zero-trust standards and least privilege access controls across target projects.

Anahtar Kavram

Programmatic GCP authentication via Application Default Credentials and Service Account Impersonation
Bu soruyu puanla