Identify any publicly accessible Cloud Run services within your GCP account and update their IAM policy in order to protect against unauthorized users that are sending requests to invoke these services. To deny access from anonymous and public users, remove the bindings for allUsers and allAuthenticatedUsers members from your service's IAM policy. allUsers is a special member identifier that represents any user on the Internet, including authenticated and unauthenticated users, while the allAuthenticatedUsers is an identifier that represents any user or service account that can sign in to Google Cloud Platform (GCP) with a Google account.
optimisation
efficiency
excellence
Misconfigured access permissions are a common security vulnerability that involves Google Cloud resources. Granting permissions to allUsers and allAuthenticatedUsers members can allow anyone to invoke your services. To prevent sensitive data leaks, data loss, and unexpected charges on your GCP bill, ensure that anonymous and/or public access to your Cloud Run services is not allowed.
Audit
To determine if there are any publicly accessible Cloud Run services available within your GCP account, perform the following operations:
Remediation / Resolution
To remove the allUsers and/or allAuthenticatedUsers IAM member bindings from the associated invoker policy in order to restrict anonymous and/or public access to your Cloud Run services, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- IAM overview
- IAM basic and predefined roles reference
- Principal identifiers
- Authenticate for invocation
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud run services list
- gcloud run services get-iam-policy
- gcloud run services remove-iam-policy-binding
- gcloud run services add-iam-policy-binding