Description
Without KmsKeyId, Secrets Manager encrypts values with the AWS managed aws/secretsmanager key. Choose a customer managed key for cross-account reads or direct control of key policy and lifecycle.
Potential impact
Missing decryption permissions can prevent an application from retrieving a required secret.
Remediation
Set KmsKeyId to the customer managed key ARN. Limit secret reads and KMS decryption to the required callers through the secret and key policies, then verify the application can retrieve the value.
Examples
Both examples create empty secrets. Generate and store the actual values securely in a separate step.
Before
Resources:
MySecret:
Type: AWS::SecretsManager::Secret
Properties:
Description: secret description
After
Resources:
MySecret:
Type: AWS::SecretsManager::Secret
Properties:
Description: secret description
KmsKeyId: !Ref SecretKeyArn
The second example selects SecretKeyArn to encrypt values stored later.