More Info:

Amazon Cloudfront Content Delivery Network (CDN) distributions should be configured to automatically compress content for web requests in order to increase your web applications performance and reduce bandwidth costs.

Risk Level

Low

Address

Cost Optimization, Security

Compliance Standards

CBP

Triage and Remediation

Remediation

To remediate the misconfiguration of CloudFront web distributions not automatically compressing web content in AWS using the AWS console, please follow the below steps:

  1. Open the AWS Management Console and navigate to the CloudFront service.

  2. Select the distribution that needs to be remediated.

  3. Click on the “Behaviors” tab.

  4. Click on the “Create Behavior” button.

  5. In the “Create Behavior” dialog box, set the following values:

  • Path Pattern: *
  • Viewer Protocol Policy: Redirect HTTP to HTTPS
  • Allowed HTTP Methods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
  • Compress Objects Automatically: Yes
  • Cache Based on Selected Request Headers: None
  1. Click on the “Create” button to create the new behavior.

  2. Wait for the distribution to update and propagate the changes.

After following these steps, CloudFront web distributions will automatically compress web content.

Additional Reading: