A hands-on S3 lab in twenty-four slides, in the console and the CLI: create the project bucket; follow the order of S3's access checks: see S3 refuse two users without permissions, let alice in with an identity policy and bob with a bucket policy, add an explicit Deny that wins and refuse plain HTTP, then see Block Public Access and disabled ACLs refuse to make objects public; encrypt new objects with a KMS key; turn on versioning, delete an object and restore it, and add a lifecycle rule; share an object with a presigned URL, host a static page from a public bucket, and clean up.
The slides
The tool is a hands-on lab in twenty-four slides, one step each, with the steps to follow beside a terminal, a policy to
paste, or a picture of the lab's users and bucket:
- Introduction: what the lab makes.
- 1. The bucket
- Create the project bucket: in the console, with its default settings.
- Upload the first object from the CLI:
aws s3 cp and aws s3 ls.
- 2. Access: policies
- The order of S3's access checks: the signature, a Deny, an Allow in a policy or an ACL.
- Give alice and bob access keys: and a CLI profile each.
- Show that S3 refuses alice and bob: no policy allows them.
- Let alice in with an identity policy: an inline policy on the user.
- Check alice's access from the CLI.
- Let bob in with a bucket policy: a policy on the bucket, naming him as its
Principal. - Check bob's access from the CLI: and that he holds no policy himself.
- Add a Deny and watch it win: over alice's allow.
- HTTPS only: a condition in the bucket policy: a request over plain HTTP, denied.
- 3. Access: other controls
- Block Public Access: a public bucket policy and a public ACL, both refused.
- Object Ownership: ACLs disabled: an upload that sets an ACL, refused.
- 4. Encryption
- Default encryption with a KMS key: new objects under
aws/s3, old ones as they were.
- 5. Versions and lifecycle
- Turn on versioning.
- Upload a second version: and list both.
- Delete notes.txt: a delete marker over the versions.
- Restore notes.txt: by deleting the marker.
- Add a lifecycle rule: Standard-IA after 30 days, old versions deleted after 30.
- 6. Sharing
- Share notes.txt with a presigned URL: from the console and from the CLI.
- Create a public bucket for the website.
- Host a static page: and fetch it from the website endpoint.
- 7. Clean up: the buckets, the access keys, the profiles.
Sections 2 to 4 are the bucket's security: to practice only versions and sharing, do section 1 and go straight to
section 5.
The buttons on the left and right edges move between slides. So do the arrow keys and a swipe.
The lab starts where
Getting Started with AWS ends: the users jane, alice and
bob exist, and the CLI works as jane. The slides
Amazon S3 in Depth explain what it
uses.
The placeholders
The bucket names, firstname-lastname-project and firstname-lastname-website, stand for the reader's own. The account
ID and the access keys are AWS's documentation placeholders (111122223333, AKIAIOSFODNN7EXAMPLE), and the version IDs
are made up.
Sources