Section 11: Amazon S3 Introduction Flashcards
True/False
Amazon S3 is infinitely scaling storage, and also since so much of the internet uses it, it’s probably a good choice if you want to use an AWS resources that has a ton of online tutorials/instructions
True
Subsection: S3 Overview
- Backup and storage
- Disaster Recovery
- archiving
- hybrid cloud storage
- app hosting
- media hosting (video/images/etc)
- data and data analytics
- software delivery & static website
Amazon S3 Buckets
*Amazon S3 alllows people to store objects (like files) in “buckets” (directories)
* must have globally unique name (across the whole internet, everyone using S3)
* buckets defined at region level
* S3 looks like a global service but bickets are created in a region
* naming convention: No uppercase, no underscore, 3-63 characters long, not an IP, must start with a lowercase letter or number, must not start with “xn–”, must not end with “-s3alias”
S3 Overview
Amazon S3 Objects
* OBjects (files) have a key, and the key is the full path (s3://my-bucket/my-child- bucket/my_file.txt)
* key is a prefix + object name. So in s3://my-bucket/my-child- bucket/my_file.txt the prefix is my-bucket/my-child- bucket/ and the object name is my_file.txt.
* there aren’t really directories, though it migjht look like it. they’re all buckets
* max object size is 5TB (5000GB)
* if uploading a file of more thatn 5GB, must use multi part upload
* metadata (key value pairs)
* tags (unicode key/value pairs - up to 10 useful for security lifecycle)
* version ID (if versioning is enabled)
S3 Overview
S3 objects are not public unless you explicitly make them public. presigned urls
True. You can view your own objects using the presigned URL (which you can find if you click the “Open” button on your s3 object UI)
S3 Overview (slash S3 Hands On)
- User-Based: IAM policies - which API calls should be allowed for a specific user from IAM
- Resource-Based: Bucket Policies - bucket wide rules from the S3 console - allows cross account
- Object Access Control List (ACL) - finer grain (can be disabled)
- Bucket access Control List (ACL) - less common (can be disabled)
- Note: an IAM principal can access an S3 object if ((the user IAM permissions ALLOW it OR the resource policy ALLOWs it) AND (there’s no explicity deny))
- Encrypt objects using encryption keys
True
S3 Security: Bucket Policy
S3 Bucket Policies - JSON based policies
* Resources: buckets and objects
* Effect: Allow/Deny
* Actions: set of API to allow or deny
* principal: account or user to apply the policy to
S3 Security: Bucket Policy
Use S3 bucket for policy to:
* grant public access to bucket
* force objects to be encrypted at upload
* grant access to another account (cross account)
S3 Security: Bucket Policy
might rework this to make it less memory dependant.
S3 Bucket Policy example. Describe the resources this applies to (2), the “Effect” options, a definition of the “Action” set and a definition of “Principal”
{“Version”: “2012-10-17”,
“Statement”: [
{
“Sid”: “PublicRead”,
“Effect”: “Allow”,
“Principal”, “”,
“Action”: [
“s3:GetObject”
],’
“Resource”: [
“arn:aws:s3:::examplebucket/”
]
}
]
}
S3 Bucket Policies - JSON based policies
* Resources: buckets and objects
* Effect: Allow/Deny
* Actions: set of API to allow or deny
* principal: account or user to apply the policy to
S3 Security: Bucket Policy
True/False. If false, what’s the correct version?
You use a Bucket Policy for Public Access. To do this you give your S3 Bucket an S3 Bucket Policy that allows public access and then anyone on the internet can visit your s3 bucket.
True
S3 Security: Bucket Policy
True/False. If false, what’s the correct version?
You can give a user access to an S3 bucket using IAM permissions. To do this, you give an IAM User an IAM Policy that allows access to your S3 bucket.
True
S3 Security: Bucket Policy
True/False. If false, what’s the correct version?
You can give an EC2 instance access to your S3 bucket by using IAM Roles. To do this, you create for your EC2 Instance an EC2 Instance Role and attach IAM permissions to your EC2 Instance Role that allow your EC2 instance to access your S3 bucket.
True
S3 Security: Bucket Policy
True/False. If false, what’s the correct version?
You can give another IAM User on a different AWS account access to your S3 bucket. This is called Cross-Account Access (not sure that’s an official AWS term) and you provide it using an S3 Bucket Policy. To do this, you create/update your S3 Bucket’s S3 Bucket Policy to allow Cross Account.
True
S3 Security: Bucket Policy
True/False. If false, what’s the correct version?
You can create Bucket settings to block all public access by default. This “Block all public access” feature blocks public access to buckets and objects granted through new and/or any access control lists (ACLs), or granted through new and/or any public bucket or access point policies.
This was created to prevent company data leaks. Can be set at the account level. Leave these on if your bucket should never be public
True
S3 Security: Bucket Policy
You created a bucket policy allowing everyone to see your coffee.jpg, but it doens’t seem to be working, what’s wrong?
{
“Version”: “2012-10-17”,
“Id”: “Policy1696976642467”,
“Statement”: [
{
“Sid”: “Stmt1696976641525”,
“Effect”: “Allow”,
“Principal”: “*”,
“Action”: “s3:GetObject”,
“Resource”: “arn:aws:s3:::2023-283-tuesday-s3”
}
]
}
Your resource needs to end in “/”. The “/” means that your bucket policy applies to everything inside the bucket arn:aws:s3:::2023-283-tuesday-s3.