Skip to content

Commit 7b9ac10

Browse files
achave11-ucscdsotirho-ucsc
authored andcommitted
Revert "Fix: Alarm api_unauthorized for HeadBucket from AWS Config (#6134)"
This reverts commit afea053, a workaround to prevent the undesired access denied events from the service. This issue is now resolved via an AWS Internal fix.
1 parent b35d598 commit 7b9ac10

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

terraform/shared/shared.tf.json.template.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,12 @@ def conformance_pack(name: str) -> str:
250250
'Service': 'config.amazonaws.com'
251251
},
252252
'Action': ['s3:GetBucketAcl', 's3:ListBucket'],
253-
'Resource': '${aws_s3_bucket.aws_config.arn}'
253+
'Resource': '${aws_s3_bucket.aws_config.arn}',
254+
'Condition': {
255+
'StringEquals': {
256+
'AWS:SourceAccount': config.aws_account_id
257+
}
258+
}
254259
},
255260
{
256261
'Effect': 'Allow',
@@ -262,7 +267,8 @@ def conformance_pack(name: str) -> str:
262267
f'/*/AWSLogs/{config.aws_account_id}/Config/*',
263268
'Condition': {
264269
'StringEquals': {
265-
's3:x-amz-acl': 'bucket-owner-full-control'
270+
's3:x-amz-acl': 'bucket-owner-full-control',
271+
'AWS:SourceAccount': config.aws_account_id
266272
}
267273
}
268274
}

0 commit comments

Comments
 (0)