Back to controls

Ensure Cloud KMS cryptokeys are not anonymously or publicly accessible

It is recommended that the IAM policy on Cloud KMS cryptokeys should restrict anonymous and/or public access.

Category

Controls

High

Applies to

Google Cloud

Coverage

1 queries

Asset types

1 covered

Overview

It is recommended that the IAM policy on Cloud KMS cryptokeys should restrict anonymous and/or public access.

Rationale

Granting permissions to allUsers or allAuthenticatedUsers allows anyone to access the dataset. Such access might not be desirable if sensitive data is stored at the location. In this case, ensure that anonymous and/or public access to a Cloud KMS cryptokey is not allowed.

Impact

Removing the binding for allUsers and allAuthenticatedUsers members denies accessing cryptokeys to anonymous or public users.

Remediation guidance

From Google Cloud CLI

  1. List all Cloud KMS Cryptokeys.
gcloud kms keys list --keyring=<keyRingName> --location=global --format=json | jq '.[].name'
  1. Remove IAM policy binding for a KMS key to remove access to allUsers and allAuthenticatedUsers using the below command.
gcloud kms keys remove-iam-policy-binding <keyName> --keyring=<keyRingName> --location=global --member='allAuthenticatedUsers' --role='<role>'
gcloud kms keys remove-iam-policy-binding <keyName> --keyring=<keyRingName> --location=global --member='allUsers' --role='<role>'

Default Value

By default Cloud KMS does not allow access to allUsers or allAuthenticatedUsers.

References

  1. https://cloud.google.com/sdk/gcloud/reference/kms/keys/remove-iam-policy-binding
  2. https://cloud.google.com/sdk/gcloud/reference/kms/keys/set-iam-policy
  3. https://cloud.google.com/sdk/gcloud/reference/kms/keys/get-iam-policy
  4. https://cloud.google.com/kms/docs/object-hierarchy#key_resource_id

Google Cloud Console (Asset-Level)

  1. Open the affected project/resource from the finding details in Google Cloud Console.
  2. Navigate to the resource security/configuration settings.
  3. Apply the control-specific secure configuration.
  4. Save and re-run the check.

Service-wide remediation

Recommended when many resources are affected: fix the platform baseline first so new resources inherit the secure setting, then remediate the existing flagged resources in batches.

Google Cloud

Use organization or folder policies where available, shared project templates, logs and alerting baselines, and IaC modules so new resources inherit the secure setting.

Operational rollout

  1. Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
  2. Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
  3. Re-scan and track approved exceptions with an owner and expiry date.

Query logic

These are the stored checks tied to this control.

Cloud KMS cryptokeys are not anonymously or publicly accessible

Connectors

Google Cloud

Covered asset types

KMSKey

Expected check: eq []

kmsKeys(where:{OR:[{policyDocument_CONTAINS:"allUsers"},{policyDocument_CONTAINS:"allAuthenticatedUsers"}]}){...AssetFragment}
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon