aws-notebook

My AWS Notebook

View the Project on GitHub kyhau/aws-notebook

Design Edge Security

Table of Contents


CloudFront - Global Content Delivery Network (CDN)

SNI (Server Name Identifier)

Encryption in transit and at rest

  1. Default Certificate on the S3 bucket
  2. ACM generated certificate on the CloudFront Distribution
  3. Field-level encryption

Field-level encryption

Restricting S3 to CloudFront

Restricting origin with a secret header

Reference: CloudFront Origin Protection with AWS WAF & Shield

Amazon has been steadily improving their CloudFront CDN offering with WAF capabilities. This is a great feature, however it’s ineffective if origin servers can be attacked directly, bypassing CloudFront. With a little extra work, access to the origin can be restricted. The solution is to add a secret header value at the edge, and configure the load balancer to block requests that are missing this secret. This is necessary because CloudFront distributions are not associated with security groups, nor are fixed IPs available (unlike higher-priced competitors like Kona Site Shield).

Signed URLs and Cookies

CloudFront signed URLs and signed cookies allow you to control who can access your content.

Features and Limits

Geo Restriction

  1. Option 1: CloudFront can restrict content using CloudFront Geo Restriction.
    • Whitelist OR Blacklist and it works on country restriction ONLY.
    • Location is based on IP country location - acked by a GeoIP Database (~99.8% accuracy).
    • No restrictions on ANYTHING ELSE - session/cookie/content/browser etc.
  2. Option 2: CloudFront can restrict content using a Third-Party Geolocation Service.
    • Third-Party Geo Restriction needs a server/serverless application - signed URLs are used.
    • A Third-Party Geolocation Service is used - extra accuracy.
    • Location can be much more accurate (city, locale, lat/long in some cases).

Protecting Web Applications

AWS WAF (Web Application Firewall)

DoS (Denial of service) attacks

AWS Shield Standard

AWS Shield Advanced