S3 Security

Learn to secure S3 data with encryption, configure CORS for browser access, enforce MFA delete, enable access logging for auditing, and generate presigned URLs for temporary, secure access.

Security and compliance are top priorities for any modern application, and Amazon S3 provides robust encryption capabilities to help us protect our data at rest.

Types of server-side encryption in S3

AWS offers three main types of server-side encryption (SSE) for S3: SSE-S3, SSE-KMS, and SSE with customer-provided keys (SSE-C).

  • SSE-S3 (AES-256) allows AWS to handle both the encryption key management and the encryption process. It is the simplest to enable, requiring only a single configuration flag at the bucket or object level. While this method is fully managed and secure, it lacks the detailed audit and access control we get with KMS.

  • SSE-KMS integrates Amazon S3 with AWS Key Management Service (KMS). With this method, each object is encrypted with a unique data key, which is protected with a KMS-managed master key (CMK). SSE-KMS allows us to set key usage policies, track access through CloudTrail logs, and control access to object decryption. It’s especially useful in regulated environments where data access tracking is critical.

  • SSE-C (server-side encryption with customer-provided keys) allows us to supply our encryption keys when uploading objects to Amazon S3. AWS performs the encryption and decryption using our key, but does not store the key itself. This approach gives us full control over key management, but it also means users are responsible for securely storing and supplying the key with each request. SSE-C is suitable for scenarios where key custody must remain entirely outside AWS, but it comes with added operational complexity and limited support for features like object replication and cross-region access. ...