Skip to main content

More Info:

AWS CloudFront Content Delivery Network (CDN) service should be used within your AWS account to secure and accelerate the delivery of your websites, media files or static resources.

Risk Level

Medium

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Startup Security Baseline
  • AWS Well Architected Framework
  • 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)
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • StateRAMP
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate this misconfiguration, you can follow the steps below:
  1. Log in to your AWS console and navigate to the CloudFront service.
  2. Click the “Create Distribution” button.
  3. Choose the type of distribution you want to create. For example, if you want to use CloudFront to deliver your website content, select “Web”.
  4. Configure the settings for your distribution. This includes setting the origin, which is the location of your content, and configuring caching settings.
  5. Once you have configured your settings, click “Create Distribution” to create your CloudFront distribution.
  6. After your CloudFront distribution is created, you will need to update your DNS settings to point to your CloudFront distribution. This involves creating a CNAME record in your DNS that points to your CloudFront distribution.
  7. Finally, test your CloudFront distribution to ensure that your content is being delivered correctly.
By following these steps, you can remediate the misconfiguration and begin using CloudFront to deliver your content.

To remediate the misconfiguration in AWS that the account should use CloudFront CDN service, you can follow the below steps using AWS CLI:
  1. Open the AWS CLI on your local machine.
  2. Run the following command to create a new CloudFront distribution:
Note: Replace distribution-config.json with the path to your CloudFront distribution configuration file.
  1. Update the DNS records for your domain to point to the CloudFront distribution.
  2. Wait for the DNS changes to propagate.
  3. Verify that your website is now being served through CloudFront by visiting your website and checking the response headers for the X-Cache header. If the header is present, it means that your website is being served through CloudFront.
By following these steps, you can remediate the misconfiguration that your AWS account should use CloudFront CDN service.
To remediate the misconfiguration in AWS where the account should use CloudFront CDN service, you can use the following steps in Python:
  1. Import the necessary AWS SDK for Python (Boto3) library.
  1. Create a CloudFront client object using the boto3.client() method.
  1. Create a new CloudFront distribution using the create_distribution() method.
  1. Wait for the distribution to be deployed using the wait_until() method.
  1. Update the DNS records to point to the CloudFront distribution using Route 53 or other DNS service.
By following these steps, you can remediate the misconfiguration in AWS where the account should use CloudFront CDN service using Python.
Substitute:
  • YOUR_STATIC_SITE_BUCKET_NAME with the actual S3 bucket name that holds your static site or assets.
This change creates new resources (an S3 bucket, an origin access identity, and a CloudFront distribution); it does not replace existing distributions but will incur new CloudFront usage.To verify, terraform plan should show:
  • + aws_cloudfront_distribution.PRIMARY_CDN to be created
  • + aws_s3_bucket.STATIC_SITE_BUCKET to be created (if not already managed)
  • + aws_cloudfront_origin_access_identity.OAI and + aws_s3_bucket_policy.STATIC_SITE_BUCKET_POLICY to be created.

Additional Reading: