Learning center

Find why Google Cloud Application Default Credentials use another principal

Treat the active gcloud account and the application's Application Default Credentials (ADC) as separate evidence. The client library may obtain credentials from a file or an attached service account while gcloud uses a named user configuration.

In a fictional local job, gcloud auth list --filter=status:ACTIVE shows the approved developer identity. The application's failed query records reports-test in the audit entry. Inspect the application's actual process environment for the presence of GOOGLE_APPLICATION_CREDENTIALS, without reading or sharing file contents. If the application uses ADC, that configuration source takes precedence over the local ADC file and the attached service account. Explicit credentials in application code warrant their own check. Application Default Credentials search order ยท gcloud auth list

Compare the configured source to the deployment's intended identity, then use the original audit entry as the receipt. If policy work follows, scope it to the approved application identity. The gcloud command only describes credentials available to that CLI.

Trace another denied request.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading