S3-Security Flashcards
You can encrypt objects in S3 buckets using one of four methods:
- Server-Side Encryption (SSE)
- Amazon S3-Managed Keys (SSE-S3) - default
- KMS Keys stored in AWS KMS (SSE-KMS)
- Customer-Provided Keys (SSE-C)
- Client-Side Encryption
Amazon S3-Managed Keys (SSE-S3)
- encryption using keys handled, managed, and owned by ____
- object is encrypted server-side
- encryption type is ____
- must set header “x-amz-server-side-encryption”:”AES256”
- enabled by default for new buckets and objects
AWS
AES-256
KMS Keys stored in AWS KMS (SSE-KMS)
- encryption using keys handled and managed by AWS KMS
- KMS advantages: user control + audit key usage using ____
- object is encrypted server-side
- must set header “x-amz-server-side-encryption”:”aws:kms”
CloudTrail
SSE-KMS Limitations
When you upload data it calls the ____ KMS API.
When you download data it calls the ____ KMS API.
These calls count toward the KMS quota per second. (5500, 10000, 30000 req/s based on region)
you can request a quota increase using the ____.
GenerateDataKey
Decrypt
Service Quotas Console
Customer Provided Keys (SSE-C)
- Server-side encryption using keys fully managed by the customer outside of AWS.
- Amazon S3 does NOT store the encryption key you provide.
- HTTPS must be used
- Encryption key must be provide in HTTP headers, for every HTTP request made.
- Will not see the option in the UI, must be done via CLI.
Client-Side Encryption
- use client libraries such as Amazon S3 Client-Side Encryption Library
- Clients must encrypt the data themselves before sending to S3
- Clients must decrypt data themselves when retrieving from S3
- Customer fully manages the keys and encryption cycle
Encryption in-flight is called ____.
S3 exposes two endpoints:
- http endpoint: non encrypted
- https endpoint: encryption in-flight
http is recommended
https is mandatory for which S3 encryption method?
SSL/TLS
SSE-C
How can you force S3 encryption in transit?
via a bucket policy, by adding a condition to Deny the GetObject action when aws:SecureTransport is false.
Amazon S3 bucket policies are evaluated ____ “Default Encryption”.
before
Which S3 encryption method is automatically applied to new objects stored in an S3 bucket?
SSE-S3
You can “force encryption” using a bucket policy and refuse any API call to PUT an S3 object without encryption headers (SSE-KMS or SSE-C).
CORS: Cross-Origin Resource Sharing
origin = scheme (protocol) + host (domain) + port
ex: https://www.example.com
CORS is a web browser based mechanism to allow requests to other origins while visiting the main origin.
Same origin: http://example.com/app1 & https://example.com/app2
Different origins: http://www.example.com & https://other.example.com
These request won’t be fulfilled unless the other origin allows for the requests, using CORS Headers (ex: Access-Control-Allow-Origin)
** If a client makes a cross-origin request on our S3 bucket, we need to enable the correct ____.
CORS headers
you can allow for a specific origin or for * (all origins)
To use MFA Delete, ____ must be enabled on the S3 bucket.
versioning
Only the ____ can enable/disable MFA Delete.
bucket owner (root account)
Identify the actions below that require MFA to be enabled:
- enable versioning
- suspend versioning on the bucket
- list deleted versions
- permanently delete an object version
suspend versioning on the bucket
permanently delete and object version
MFA Delete can only be enabled via the ____ using the root account.
CLI
For ____ purposes, you may want to log all access to S3 buckets.
Any request made to S3, from any account, authorized or denied, will be logged into another S3 bucket.
That data can be analyzed using data analysis tools (such as Athena)
The target logging bucket must be in the same AWS ____.
audit
region
Do not set your S3 access logging bucket to the the ____ bucket.
It will create a loggin loop and your bucket will grow exponentially and be very expensive.
monitoring
S3 Pre-Signed URLs can be generated using what 3 methods?
S3 Console
AWS CLI
AWS SDK
What are the expiration times for S3 pre-signed URLs?
- S3 Console: 1 min up to 720 mins (12 hours)
- AWS CLI: default 3600 secs, max 604800 sec ~ 168 hours
- configure expiration with –expires-in parameter in seconds
Users given a ____ URL inherit the permissions of the user that generated the URL for GET / PUT
pre-signed
Use case for pre-signed URL: when you want to provide a user access to a private S3 file for them to download (or upload).
Examples:
- allow only logged-in users to download a premium video from your S3 bucket
- allow an ever-changing list of users to download files by generating URLs dynamically
- allow temporarily a user to upload a file to a precise location in your S3 bucket (while keeping your bucket private)
The S3 Glacier ____ feature is helpful for compliance and data retention because it adopts the WORM (Write Once Ready Many) model.
Valut Lock
- The lock policy is at the bucket level
- Create a vault lock policy, the lock the policy for future edits. (can no longer be changed or deleted)