Repository navigation
Conversation
… keys The Datadog Forwarder template grants kms:Decrypt on "*" when its KmsKeyList parameter is empty, so the forwarder role could decrypt every customer-managed key in the account. Pass the key ARNs behind the AWS-managed aws/secretsmanager and aws/s3 aliases, resolved per account and region at deploy time, plus secretsKmsKeyArn when it is set.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Datadog Forwarder template (5.4.11) gives its role
kms:Decrypton"*"whenKmsKeyListis empty. We never set it, so all three kite forwarder roles can decrypt every customer-managed key in account 604598162673, including the Intelligence licence key (alias/copilotkit-license-encryption). That key uses the default key policy, so IAM alone decides access.The forwarder needs no customer-managed key. It reads its API key secret, which uses the AWS-managed
aws/secretsmanagerkey, and its own bucket, which usesaws/s3. This PR setsKmsKeyListto the key ARNs behind those two aliases. TwoAwsCustomResourceDescribeKeylookups resolve the ARNs at deploy time, so each account and region gets its own keys and no ARNs are hardcoded. IfsecretsKmsKeyArnis set, that key is added too.RED (live, read-only)
Each forwarder role has an inline
ForwarderRolePolicy0with{"Action":["kms:Decrypt"],"Resource":"*","Effect":"Allow"}. Result ofaws iam simulate-principal-policy --action-names kms:Decrypt --resource-arns arn:aws:kms:us-east-1:604598162673:key/10321f7b-1581-4540-9d49-d818523098ff:Synth diff
From
cdk synth kite-prod -c appName=kite -c environment=prod -c sharedCluster=true, before and after this change. These are the forwarder nested stack's parameters:New resources:
AwsManagedKmsKeySecretsManager,AwsManagedKmsKeyS3(each with itsCustomResourcePolicyallowingkms:DescribeKey), and the sharedAwsCustomResourceprovider function and role. No resources are removed.In us-west-2, the two aliases currently resolve to
key/eb1e900a-…(aws/secretsmanager) andkey/ff92dfcd-…(aws/s3). I ransimulate-custom-policyon the scoped statement before deploying:Checks
pnpm --dir deployment/aws build(tsc): passpnpm --dir deployment/aws test: 28/28 pass. Two new tests failed before the change and pass after it.GREEN (after deploy)
simulate-principal-policyfor each forwarder role showsimplicitDenyon the licence key andallowedon the two AWS-managed keys.InvocationsandErrorsstay unchanged. The baseline is about 2,885 invocations and 0 errors per forwarder per 24h.Deploy
Deploy all three stacks (staging, community, prod) after review; owner Tyler.
Nothing has been deployed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4kRRs8251kXTRWNeNywkH