Enhance AWS S3 Data Security with Bucket Level Policy
After restricting the source of S3 Bucket access requests through Bucket Level Policy, the data in AWS S3 Bucket can still be secured even if AKSK is compromised.
Due to weak security awareness, many people prefer to access resources through AKSK (Access Key and Secret Key). AKSK contains only two strings and the user permissions can be obtained via command line tools or API codes.
Take AWS as an example, a simple
aws s3 sync command can drag away all the data stored in S3 Bucket. After restricting the source of S3 Bucket access requests through Bucket Level Policy, the data in AWS S3 Bucket can still be secured even if AKSK is compromised.
One prerequisite is that the compromised AKSK should not have administrator privileges or full privileges of services such as IAM, EC2, Lambda, etc. Otherwise, it may bypass the Bucket Level Policy restrictions or modify the Bucket Level Policy through those services. For such cases, restrictions could be imposed on various services from the organization account level by SCP.
The following Bucket Level Policy uses the
Deny by default, only allows the following types of requests.
- When requests come directly from AWS services.
- When requests come from the specified VPC IDs.
- When requests come from the specified Roles.
- When requests come from the specified IPs.
Here are some strong protection mechanisms for the data in Amazon S3, including least privilege access, encryption of data at rest, restricted sources, logging, monitoring, and configuration checks.
- Restrict the sources of requests at the organization level for S3 and other AWS services
- Use bucket policies to verify all access granted is restricted and specific
- Enable S3 protection in GuardDuty to detect suspicious activities
- Use Macie to scan for sensitive data outside of designated areas
- Use KMS to encrypt data in S3
- Protect data in S3 from accidental deletion using S3 Versioning and S3 Object Lock
- Enable logging for S3 using CloudTrail and S3 server access logging
- Monitor S3 using Security Hub and CloudWatch Logs
- Use Cross-region replication to backup data in S3