Ensure Amazon S3 permissions granted to other AWS accounts are restricted to enhance security.
Rule | Amazon S3 permissions granted to other AWS accounts in bucket policies should be restricted |
Framework | NIST 800-171 Revision 2 |
Severity | ✔ High |
Rule Description:
The rule ensures that permissions granted to other AWS accounts in Amazon Simple Storage Service (S3) bucket policies are restricted in accordance with the National Institute of Standards and Technology (NIST) 800-171 Revision 2.
Permissions Restriction:
The rule aims to limit access to S3 buckets by implementing stricter permission controls, particularly for granting cross-account access through bucket policies. By adhering to the NIST 800-171 Revision 2 guidelines, the rule helps mitigate the risk of unauthorized access to sensitive data stored in S3 buckets.
Troubleshooting Steps:
Necessary Code:
If the bucket policies do not comply with the NIST 800-171 Revision 2 requirements, the following sample code can be used to modify the bucket policy and restrict permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RestrictS3Access",
"Effect": "Deny",
"Principal": {
"AWS": [
"arn:aws:iam::123456789012:root",
"arn:aws:iam::<Other AWS Account ID>:root"
]
},
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::example-bucket/*",
"arn:aws:s3:::example-bucket"
]
}
]
}
Note: Replace
example-bucket
with the actual bucket name, and <Other AWS Account ID>
with the appropriate AWS account ID.Remediation Steps:
Verification:
To verify if the permissions have been successfully restricted, follow these steps: