Skip to content

Commit 34073c6

Browse files
iam permissions
1 parent 8afefa9 commit 34073c6

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

infrastructure/stacks/api-layer/iam_policies.tf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,38 @@ resource "aws_kms_key_policy" "s3_rules_kms_key" {
350350
policy = data.aws_iam_policy_document.s3_rules_kms_key_policy.json
351351
}
352352

353+
data "aws_iam_policy_document" "s3_consumer_mapping_kms_key_policy" {
354+
#checkov:skip=CKV_AWS_111: Root user needs full KMS key management
355+
#checkov:skip=CKV_AWS_356: Root user needs full KMS key management
356+
#checkov:skip=CKV_AWS_109: Root user needs full KMS key management
357+
statement {
358+
sid = "EnableIamUserPermissions"
359+
effect = "Allow"
360+
principals {
361+
type = "AWS"
362+
identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"]
363+
}
364+
actions = ["kms:*"]
365+
resources = ["*"]
366+
}
367+
368+
statement {
369+
sid = "AllowLambdaDecrypt"
370+
effect = "Allow"
371+
principals {
372+
type = "AWS"
373+
identifiers = [aws_iam_role.eligibility_lambda_role.arn]
374+
}
375+
actions = ["kms:Decrypt"]
376+
resources = ["*"]
377+
}
378+
}
379+
380+
resource "aws_kms_key_policy" "s3_consumer_mapping_kms_key" {
381+
key_id = module.s3_consumer_mappings_bucket.storage_bucket_kms_key_id
382+
policy = data.aws_iam_policy_document.s3_consumer_mapping_kms_key_policy.json
383+
}
384+
353385
resource "aws_iam_role_policy" "splunk_firehose_policy" {
354386
#checkov:skip=CKV_AWS_290: Firehose requires write access to dynamic log streams without static constraints
355387
#checkov:skip=CKV_AWS_355: Firehose logging requires wildcard resource for CloudWatch log groups/streams

0 commit comments

Comments
 (0)