AWS S3 Bucket (9, 10, 11) Flashcards
An S3 file has a full path of s3://my-bucket/my_folder/another_folder/my_file.txt … Which part of the path is the Key
The Key is my_folder/another_folder/my_file.txt
What is the max object size in S3? What is uploading max?
5TB; 5GB (recommended use multi-part upload after 100MB)
S3 Versioning will overwrite the previous file, true or false?
False. S3 creates a new version
Version ID for a file in a bucket is null, why?
We enabled versioning for the bucket after the object was added to the bucket
How can you restore a deleted object in S3?
Delete the version with a Delete Marker
What are the 4 methods of encrypting objects in S3?
SSE-S3, SSE-KMS, SSE-C, Client Side Encryption
What is SSE-S3 encryption for S3?
Encryption using keys handled & managed by Amazon s3; object is encrypted server side
What header must be set for SSE-S3 encryption for S3?
“x-amz-server-side-encryption”: “AES256”
What is SSE-KMS encryption for S3?
Encryption using keys handled & managed by KMS;
object is encrypted server side
What header must be set for SSE-KMS encryption for S3?
“x-amz-server-side-encryption”:”aws:kms”
What are the SSE-KMS advantages?
User control and audit trail
What is SSE-C encryption for S3?
Server-side encryption using data keys fully managed by the customer outside of AWS;
Amazon S3 does not store the encryption key you provide;
HTTPS must be used and the encryption key must be provided in every request
What is client-side encryption for S3?
Clients must encrypt data themselves before sending to S3;
Clients must decrypt data themselves when retrieving from S3
What two options for default encryption does S3 bucket provide for you?
SSE-S3 and SSE-KMS
What is User Based S3 security?
IAM policies - which API calls should be allowed for a specific user from IAM console
What is a Resource Based Policy?
Bucket policies - bucket wide rules from the S3 console - allows cross account;
JSON based policies
Which encryption method for S3 Bucket requires you to use HTTPS?
SSE-C
How can an IAM principal access an S3 object?
If the user IAM permissions allow it OR the resource policy allows it AND there is no explicit deny;
An explicit deny takes precedence over the IAM permissions allowance;
A bucket policy does not need to be created as long as there is no explicit deny
What are 3 use cases for S3 bucket policy?
Grant public access;
Force objects to be encrypted at upload;
Grant access to another account (Cross Account)
How can MFA (Multi-Factor Authentication) be used in S3 Bucket?
It can be required to delete objects
What is a pre-signed URL used for in S3?
They are URLs that are only valid for a limited time
You are getting a Forbidden when trying to upload a file on S3? What is a possible reason?
The bucket policy could be preventing it; e.g. files must be encrypted before/while uploading;
If it is a public upload, it could also be the Block Public Access settings
Users cannot access the object S3 URL with correct key path for your static website? What could be a cause?
When a bucket is created, it has the Block All Public Access option configured in the Block Public Access settings. You need to configure this and then create a Bucket Policy that allows users to Read the object (the static site object). Even if Block Public Access is turned off, you still need to create a Bucket Policy.
What is an origin in CORS?
An origin is a scheme (protocol), host (domain) and port;
e.g. https://www.example.com (implied port is 443 for HTTPS, 80 for HTTP)
What is an example of when CORS would be needed?
Say we have a bucket that serves a website. That website then needs to call another bucket for a resource (say a picture). The other (cross origin) bucket will need to allow traffic calls from the origin website. We need to enable CORS in the cross origin bucket.
How long is the read after write consistency time for deleting or updating objects to S3?
It is eventually consistent
Your client wants to make sure the encryption is happening in S3, but wants to fully manage the encryption keys and never store them in AWS. You recommend
SSE-C
Your company wants data to be encrypted in S3, and maintain control of the rotation policy for the encryption keys. You recommend
SSE-KMS
Your company does not trust S3 for encryption and wants it to happen on the application. You recommend
Client Side Encryption
The IAM permissions allows our users to read/write files in the bucket, yet we were not able to perform a PutObject API call. What is your assessment?
The IAM user has an explicit DENY in the bucket policy. Explicit DENY in an bucket policy will take precedence over the IAM permission
If you are installing AWS CLI, you use it and get the error aws: command not found
; what is the problem?
The AWS executable is not in the PATH environment variable
What is the wrong way of configuring credentials on EC2 for CLI?
Running aws configure
in the EC2 instance is very insecure. Never put personal credentials on an EC2 machine. Only belong on personal computer. We should use an IAM Role attatched to an EC2
What is the right way of configuring credentials on EC2?
Attach an IAM Role to an EC2 instance; EC2 instances will reach out to the AWS Account through the CLI and the AWS will check the credentials and permissions of the ROLE.
How many IAM roles can an EC2 instance have at a time?
One, this is the instance profile
What is an inline policy in IAM?
It is a policy that is only attached to one identity (user, group, or role)