Check provider logo

Secret Manager secret is not publicly accessible

secretmanager_secret_not_publicly_accessible

Severitycritical
by Prowler

Secret Manager secrets deny access to allUsers and allAuthenticatedUsers, so only explicitly authorized identities can read or use them.

The evaluation reviews each secret's IAM policy bindings to confirm no public principals are granted access.

Risk

Granting public IAM access to a secret exposes credentials, API keys, certificates, or other sensitive values to any caller on the internet or any authenticated Google account. This compromises confidentiality, enables lateral movement with leaked credentials, and can trigger regulatory breaches under PCI-DSS, ISO 27001, and GDPR.

Run this check with Prowler CLI

prowler gcp --checks secretmanager_secret_not_publicly_accessible

Recommendation

Apply least privilege to Secret Manager: grant roles/secretmanager.secretAccessor only to the specific service accounts or groups that need to read each secret.

Use workload identity for GKE workloads and rotate credentials regularly to limit blast radius when a binding is misconfigured.

Remediation

CLI

gcloud secrets remove-iam-policy-binding <SECRET_NAME> --member=<allUsers|allAuthenticatedUsers> --role=roles/secretmanager.secretAccessor

Terraform
Other
  1. In Google Cloud Console, go to Security > Secret Manager
  2. Select the secret and open the Permissions tab
  3. Remove any binding with allUsers or allAuthenticatedUsers
  4. Grant access only to required service accounts or groups

Source Code

Resource Type

secretmanager.googleapis.com/Secret

References

Related To

  • secretmanager_secret_rotation_enabled
  • kms_key_not_publicly_accessible
  • cloudstorage_bucket_public_access