Being able to restrict and grant access to specific S3 resources is fundamental when implementing your security procedures. There are various methods that could be used to achieve this, one of which is to implement bucket policies. Bucket policies are applied directly to a bucket within S3 itself, and apply to that bucket only.
To make your bucket policy even more effective, you can apply specific conditions as to when the effects of that Policy should apply. There are a number of conditions you could base your bucket policy upon, and the AWS documentation provides greater insight into these found here.
It is also possible to create user policies which are created within IAM, however for this lab we will be focusing on bucket policies. For more information regarding user policies, please see our other labs and courses relating to IAM.
This lab will guide you through the bucket policy creation process with the use of the AWS Policy Generator.
We will create 2 Bucket Policies
1. Configure a bucket policy that will restrict what a user can do within an S3 bucket based upon their IP address
2. Configure a bucket policy to only allow the upload of objects to a bucket when server side encryption has been configured for the object
Your first step to start the laboratory experience
Create a new S3 bucket
How to create and apply a bucket policy with IP address conditions within S3 using the AWS Policy Generator.
How to create and apply a bucket policy with encryption conditions using the AWS Policy Generator.