AWS S3
Bucket Versioning
- a means of keeping multiple variants of an object in the same bucket; you can use versioning to preserve, retrieve, and restore every version of every object stored in the bucket
- with versioning, you can easily recover from both unintended user actions and application failures
- MFA delete: an additional layer of security that requires multi-factor authentication for changing bucket versioning settings and permanently deleting object versions
Object Lock
- Store objects with a write-once-read-many (WORM) model to help you prevent objects from being deleted or overwritten for a fixed amount of time or indefinitely
- Works only in versioned buckets
- After you enable Object Lock for a bucket, you can't disable Object Lock or suspend versioning for that bucket
- Retention mode:
- Governance: Users with specific IAM permissions can overwrite or delete protected object versions during the retention period
- users with
s3:BypassGovernanceRetention
permission, and the root user have the write permission
- users with
- Compliance: No users (including the root user) can overwrite or delete protected object versions during the retention period
- Governance: Users with specific IAM permissions can overwrite or delete protected object versions during the retention period
- Legal Hold vs Retention Period
- Legal hold: with Object Lock, you can also place a legal hold on an object version. Like a retention period, a legal hold prevents an object version from being overwritten or deleted. However, a legal hold doesn't have an associated retention period and remains in effect until removed. Legal holds can be freely placed and removed by any user who has the
s3:PutObjectLegalHold
permission. - Legal holds are independent from retention periods. As long as the bucket that contains the object has Object Lock enabled, you can place and remove legal holds regardless of whether the specified object version has a retention period set. Placing a legal hold on an object version doesn't affect the retention mode or retention period for that object version.
- For example, suppose that you place a legal hold on an object version while the object version is also protected by a retention period. If the retention period expires, the object doesn't lose its WORM protection. Rather, the legal hold continues to protect the object until an authorized user explicitly removes it. Similarly, if you remove a legal hold while an object version has a retention period in effect, the object version remains protected until the retention period expires.
- Use case: you're tasked with ensuring that no object can be overwritten or deleted by any user in a period of one year only, you should enable S3 Object Lock in compliance mode with a retention period of one year.
- Legal hold: with Object Lock, you can also place a legal hold on an object version. Like a retention period, a legal hold prevents an object version from being overwritten or deleted. However, a legal hold doesn't have an associated retention period and remains in effect until removed. Legal holds can be freely placed and removed by any user who has the
S3 Data Encryption
-
Server-side encryption
- encrypts objects before saving on disk in AWS data centers, then decrypts the objects when you download them
- all S3 buckets have encryption (SSE-S3) configure by default, the encryption algorithm is AES256
- you can change the default encryption of the bucket to SSE-KMS, or DSSE-KMS (Duer-layer server-side encryption)
- you can also change the type of server-side encryption to use in your S3 PUT request
-
Client-side encryption
- you encrypt your data client-side and upload the encrypted data to S3
- you manage the encryption process and encryption keys