L12. S3 Data Protection: Bucket Policies, Access Points & Object Lock
Video generating
Check back soon for the video lesson on S3 Data Protection: Bucket Policies, Access Points & Object Lock
Course outlineLesson 12 of 18
Block Public Access as the last line of defense, Access Points for scaling shared-bucket permissions, and Object Lock Compliance mode as a WORM defense even the root user cannot override.
Block Public Access: The Last Line of Defense
S3 Block Public Access controls public access at account, bucket, and access point scope. New buckets enable all four settings by default. S3 applies the most restrictive combination of settings; keep all four enabled unless a reviewed use case requires public access.- BlockPublicAcls rejects new public ACLs
- IgnorePublicAcls ignores existing public ACL grants
- BlockPublicPolicy rejects new public bucket policies
- RestrictPublicBuckets restricts access to buckets that have public policies
These controls address public exposure. They do not replace the IAM and resource-policy permissions needed for intentional private access.
Object Ownership: Simplifying Down to Policies
S3 Object Ownership controls who owns objects uploaded by other AWS accounts and, more importantly for the exam, whether ACLs matter at all. Setting Object Ownership to "Bucket owner enforced" disables ACLs entirely for the bucket. Every access decision then comes down to bucket policies and IAM alone, which is simpler to reason about and audit than a mix of ACLs, bucket policies, and IAM working together. This is now AWS's default and recommended setting for new buckets, reflecting a broader shift away from ACLs as an access control mechanism.Cross-Account Access Needs Both Sides
A bucket policy is a resource-based policy. For a principal in another AWS account to read objects, the bucket account must allow the request in its resource policy and the requester account must allow it in an identity policy. An explicit deny or applicable guardrail can still block access. For SSE-KMS objects, also grant the required KMS permissions.
Access Points for Shared Buckets
When many applications or teams share a single bucket, maintaining one bucket policy that encodes every consumer's rules becomes unwieldy fast. S3 Access Points solve this by creating named, distinct network endpoints for the same underlying bucket, each with its own access policy. A finance team's access point and a marketing team's access point, both pointing at the same bucket, can enforce completely different policies without either team's rules bleeding into the other's. A VPC-only access point restricts requests to a specific VPC. Both the access point and underlying bucket must permit the request; a bucket policy can delegate access control to the access point.
Object Lock: WORM Protection
S3 Object Lock requires versioning and protects individual object versions with Write Once, Read Many (WORM) retention. A new version or delete marker can still be created without deleting the locked version. The exam distinguishes two modes:| Mode | Can be overridden? |
|---|---|
| Governance | Yes, with s3:BypassGovernanceRetention and an explicit bypass request |
| Compliance | No, by anyone, including the root user, until the retention period expires |
Encrypt by Default
Since January 2023, S3 encrypts all new object uploads with SSE-S3 by default. Configure default bucket encryption to SSE-KMS when you need KMS key control and permissions. Changing the default does not re-encrypt existing objects; migrate them separately if required. This closes the gap where an application team forgets to configure encryption client-side. Cross-region replication carries its own nuances around preserving encryption status and object ownership on the replica, and it is worth double-checking whenever a scenario combines replication with a KMS-encrypted source bucket, since a replica in a different region needs its own KMS key. Exam tip: If a question says "cannot be deleted by anyone, including the root user," that is Compliance mode, full stop. If it says "can be overridden with special permission," that is Governance mode.
Continue Learning
Review IAM users, roles, and policies before troubleshooting a cross-account denial. These concepts support current SCS-C03 study; compare the broader course with the current exam guide.
References
- ✓S3 Block Public Access at the account or bucket level overrides any bucket policy or ACL that would otherwise expose objects publicly
- ✓"Bucket owner enforced" Object Ownership disables ACLs entirely, leaving bucket policies and IAM as the only access controls, which is the current AWS-recommended default
- ✓S3 Access Points give each application or team its own named endpoint and policy on a shared bucket, and can be restricted to a specific VPC
- ✓S3 Object Lock Governance mode can be overridden by users with special permission; Compliance mode cannot be overridden or deleted by anyone, including the root user, until the retention period expires
- ✓Default bucket encryption (SSE-S3 or SSE-KMS) ensures new objects are encrypted automatically even when the uploader does not specify encryption settings
1. A bucket policy accidentally grants public read access to an S3 bucket containing sensitive data. What is the most effective control to prevent this from actually exposing the data?
2. A company needs to guarantee that protected backup object versions cannot be permanently deleted or altered by anyone, including their own root user, for 7 years to satisfy a regulatory requirement, even if credentials are compromised. Which S3 feature enforces this?
3. Multiple application teams share a single S3 bucket, and each team needs a distinct, independently manageable access policy without splitting the bucket. What should they use?