Ensure that there is no wildcard principal in an inline KMS replica key policy

KMS replica key policy should be setup in such a way that it follows the least privilege principle. Having wildcard in an principal may result into a weak security configuration.

Risk Level: High
Cloud Entity: AWS Key Management Service (KMS)
CloudGuard Rule ID: D9.CFT.IAM.33
Covered by Spectral: No
Category: Security, Identity, & Compliance

GSL LOGIC

AWS_KMS_ReplicaKey should not have KeyPolicy.Statement contain-any [ Effect='Allow' and ( Principal='*' or Principal.AWS='*' ) ]

REMEDIATION

From CFT
Set AWS::KMS::ReplicaKey KeyPolicy.Statement.Principal to a specific set of principals.

References

  1. https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-services.html
  2. https://docs.aws.amazon.com/cli/latest/reference/kms/put-key-policy.html

AWS Key Management Service (KMS)

AWS Key Management Service (KMS) is a managed service that makes it easy for you to create and control the encryption keys used to encrypt your data, and uses FIPS 140-2 validated hardware security modules to protect the security of your keys. AWS Key Management Service is integrated with most other AWS services to help you protect the data you store with these services. AWS Key Management Service is also integrated with AWS CloudTrail to provide you with logs of all key usage to help meet your regulatory and compliance needs.

Compliance Frameworks

  • AWS CloudFormation ruleset