S3 object is not encrypted Affecting S3 service in AWS


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Data/ Access

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-ControlsCSA-CCM
  • Snyk IDSNYK-CC-00298
  • creditSnyk Research Team

Description

Objects are not encrypted by default when stored in the S3 bucket. Anyone with access to the destination S3 bucket will be able to read the contents of the object.

How to fix?

Set server_side_encryption attribute to AES256 or aws:kms.

Example Configuration

# Example aws_s3_bucket_object
resource "aws_s3_bucket_object" "allowed" {
  key                    = "allowedbucketobject"
  bucket                 = aws_s3_bucket.b1.id
  server_side_encryption = "AES256"
}

# Example aws_s3_object
resource "aws_s3_object" "allowed2" {
  key                    = "allowed2object"
  bucket                 = aws_s3_bucket.b1.id
  server_side_encryption = "aws:kms"
}