Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KMS permssions for replication role #8250

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions terraform/environments/core-logging/observability.tf
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ module "s3-moj-cur-reports-modplatform" {
}

data "aws_iam_policy_document" "moj_cur_bucket_replication_policy" {
#checkov:skip=CKV_AWS_111:"Policy is directly related to the resource"
#checkov:skip=CKV_AWS_356:"Policy is directly related to the resource"
statement {
sid = "ReplicationPermissions"
effect = "Allow"
Expand All @@ -183,14 +185,32 @@ data "aws_iam_policy_document" "moj_cur_bucket_replication_policy" {
]
}
actions = [
"s3:ReplicateObject",
"s3:ObjectOwnerOverrideToBucketOwner",
"s3:GetBucketVersioning",
"s3:GetObjectVersionTagging",
"s3:ReplicateTags",
"s3:ReplicateDelete"
"s3:List*",
"s3:ObjectOwnerOverrideToBucketOwner",
"s3:PutBucketVersioning",
"s3:ReplicateDelete",
"s3:ReplicateObject",
"s3:ReplicateTags"
]
resources = ["${module.s3-moj-cur-reports-modplatform.bucket.arn}/*"]
}
statement {
sid = "AllowS3ReplicationSourceRoleToUseTheKey"
effect = "Allow"
principals {
type = "AWS"
identifiers = [
"arn:aws:iam::295814833350:role/moj-cur-reports-replication-role"
ASTRobinson marked this conversation as resolved.
Show resolved Hide resolved
]
}
actions = [
"kms:GenerateDataKey",
"kms:Encrypt"
]
resources = ["*"]
}
}

# Athena Workgroup for CUR Reports
Expand Down