I have a security issue raised by Trusted Advisor.
**S3 permissions granted to other AWS accounts in bucket policies should be restricted **
This checks if the S3 bucket policy allows sensitive bucket-level or object-level actions from a principal in another AWS account. The check fails if any of the following actions are allowed in the S3 bucket policy for a principal in another AWS account: s3:DeleteBucketPolicy, s3:PutBucketAcl, s3:PutBucketPolicy, s3:PutObjectAcl, and s3:PutEncryptionConfiguration.
I have an S3 bucket that is failing to comply this check. It has a bunch of statements in its bucket policy. The one that is causing the security check to fail is the following :
{
"Sid": "AllowAppFlowDestinationActions",
"Effect": "Allow",
"Principal": {
"Service": "appflow.amazonaws.com"
},
"Action": [
"s3:PutObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts",
"s3:ListBucketMultipartUploads",
"s3:GetBucketAcl",
"s3:PutObjectAcl"
],
"Resource": [
"arn:aws:s3:::qa-abhra",
"arn:aws:s3:::qa-abhra/*"
],
"Condition": {
"StringEquals": {
"aws:SourceAccount": "account_number"
},
"ArnLike": {
"aws:SourceArn": [
"arn:aws:appflow:us-east-1:account_number:flow/contacts",
"arn:aws:appflow:us-east-1:account_number:flow/account"
]
}
}
}
I understand the Service associated in the statement is not tied to an AWS account. But I have been able to mention the condition and ArnLike in the statement above as suggested in the docs Why am I still getting the same security alert from Trusted Advisor? What can I do to fix the issue?