Check provider logo

Cloud KMS key does not grant access to allUsers or allAuthenticatedUsers

kms_key_not_publicly_accessible

Severitycritical
Servicekms
by Prowler

KMS keys are assessed for excessive access in key policies or grants, including * principals and broadly scoped permissions to multiple identities.

Risk

Broad access to a KMS key enables unauthorized kms:Decrypt and data-key generation, breaking confidentiality. With admin rights, attackers can change policies or schedule deletion, undermining control integrity and threatening availability of data dependent on the key.

Run this check with Prowler CLI

prowler aws --checks kms_key_not_publicly_accessible

Recommendation

Apply least privilege to KMS keys:

  • Restrict principals to specific roles and accounts
  • Prefer narrow, time-bound grants
  • Separate key administration from usage
  • Use conditions to limit context
  • Review regularly and remove wildcard or cross-account exposure

Remediation

CLI

aws kms put-key-policy --key-id <example_resource_id> --policy-name default --policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::<account_id>:root"},"Action":"kms:*","Resource":"*"}]}'

Native IaC
Terraform
Other
  1. Open AWS Console > Key Management Service (KMS)
  2. Select the affected key and go to the Key policy tab
  3. Click Edit and remove any statement with Principal set to "*" (or AWS: "*")
  4. Ensure a statement exists that allows only arn:aws:iam::<account_id>:root
  5. Save changes

Source Code

Resource Type

AwsKmsKey

References