Amazon S3 Security Flashcards
How many methods of encryption are there for S3?
4
Sever-Side encryption with Amazon S3-Managed Keys (SSE-S3) - Default
encrypts objects using keys handled, managed, and owned by AWS
Server-Side Encryption with KMS keys stored in AWS KMS (SSE-KMS)
Leverage AWS Key Management Service (AWS KMS) to manage encryption keys
Server-Side Encryption with Customer-Provided Keys (SSE-C)
When you want to manage your own encryption keys
Client Side Encryption
This happens on the client server
How does S3 Encryption - SSE S3 work
Encryption using keys handled, managed, owned by AWS
Server side encryption
Type is AES 256
header must include “x-amz-server-side-encryption”:”AES256”
enabled by default
Amazon S3 Encryption - SSE-S3 architecture
User uploads HTTP(S) + Header to Amazon S3.
The object is paired with S3 Owned Key, and is encrypted moving to the encrypted S3 Bucket
Advantages of SSE-KMS?
keys are handled by AWS KMS
there is user control & audit key usage using CloudTrail (logs everything that happens)
Object is encrypted server side
header = x-amz-server-side-encryption”:”awsLkms”
SSE-KMS encryption architecture
User uploads HTTP(S) & KMS header into Amazon S3.
Object is created and is combined with KMS key from AWS KMS. Then it gets encrypted and moved to the S3 Bucket
SSE-KMS Limitations
When you uplaod it calls GenerateDataKey KMS API.
When downloading it calls Decrypt KMS API.
This means that you are quoted and charged for each call.
Can result in throttling use case
SSE-KMS API calls architecture
User upload/download SEE-KMS.
S3 Bucket calls API KMS Key
SSE-C encryption
Server-Side encryption using keys managed by customer outside AWS.
Amazon S3 does NOT store keys you provide
MUST use HTTPS
Encryption key must provide in HTTP headers for every HTTP request made
SSE-C architecture
User uploads file and key (HTTP ONLY & Key in header).
Amazon S3 uses Client-provided key and object, encrypts it and then moves it to S3 bucket.
To read it you need the key provided.
S3 Client-Side Encryption
use client libraries such as Amazon S3 Client-Side Encryption Library
clients must encrypt data before sending to S3
also must decrypt data when retrieving from S3
Customer fully manages keys and encryption cycle
Client-Side Encryption Architecture
File & Client key are encrypted. Then the encrypted file is uploaded via HTTP(S) to Amazon S3 Bucket
Encryption in Transit (SSL/TLS)
HTTPS recommended when using amazon S3
And HTTPS mandatory for SSE-C
How do you force encryption in transit? aws:SecureTransport
Add Bucket Policy onto S3 Bucket that says “aws:SecureTransport”: “false”
Blocks all HTTP traffic and allows only HTTPS
Default Encryption vs Bucket Policies
SSE-S3 is automatically applied to new objects
You can also Force encryption using bucket policies and refuse any API call to PUT an S3 object without encryption headers (SSE-KMS or SSE-C)
Are Bucket Policies evaluated before “Default Encryption”?
Yes
What does CORS mean?
Cross-Origin Resource Sharing (CORS)
What is Origin in CORS?
scheme (protocol) + host (domain) + port
e.g. https://www.example.com = port is 443 for HTTPS, 80 for HTTP)
What is CORS? technical
Web Browser based mechanism to allow requests to other origins while visiting the main origin
same origin = http://example.com/app1
&
http://example.com/app2