More Info:
CloudFront distributions should be enabled with HTTPSRisk Level
MediumAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- StateRAMP
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Sure, I can help you with that. Here are the steps to remediate the HTTPS misconfiguration on CloudFront Distributions in AWS using the AWS console:
- Log in to the AWS Management Console.
- Navigate to the CloudFront service.
- Click on the ID of the distribution you want to remediate.
- Click on the “Behaviors” tab.
- Select the behavior that requires HTTPS.
- Click on the “Edit” button.
- In the “Viewer Protocol Policy” section, select “Redirect HTTP to HTTPS”.
- Click on the “Yes, Edit” button to save the changes.
Using CLI
Using CLI
To remediate this misconfiguration for AWS using AWS CLI, you can follow the below steps:Note: Replace Note: This command should return “true” to indicate that HTTPS is enabled.
- Open the AWS CLI on your local machine or on an EC2 instance.
- Run the following command to enable HTTPS on your CloudFront distributions:
<distribution-id> with the ID of your CloudFront distribution.- Wait for the distribution to update. This might take a few minutes.
- Run the following command to verify that HTTPS is enabled:
- Repeat the above steps for all of your CloudFront distributions.
Using Python
Using Python
To remediate the HTTPS should be enabled on CloudFront Distributions misconfiguration in AWS using Python, follow these steps:This will enable HTTPS on the CloudFront distribution.
- Import the required modules:
- Create a boto3 client for CloudFront:
- Get a list of all CloudFront distributions:
- Loop through the distributions and check if HTTPS is enabled:
- If HTTPS is not enabled, update the distribution to enable HTTPS:
Using Terraform
Using Terraform
viewer_protocol_policy from allow-all (HTTP and HTTPS) to redirect-to-https in default_cache_behavior and every ordered_cache_behavior, matching the CLI remediation’s requirement to enforce HTTPS. The distribution is updated in place (no resource replacement), but CloudFront changes can take several minutes to propagate.To verify, terraform plan should show viewer_protocol_policy changing from "allow-all" (or "https-only", if that was set) to "redirect-to-https" for the affected cache behaviors, with the resource marked for in-place update (~), not +/-.
