Volume 2 · Chapter 13 — AWS Networking Deep Dive (VPC)

CloudFront, Global Accelerator, and Edge Network Security

Goutham Mayaluri 5 min read AWSCloudVPCNetworkingSecurityCloudFront

13.1 Introduction

This chapter deepens the edge: CloudFront’s origin protection, signed URLs/cookies, cache behaviors, and edge compute; the distinction between CloudFront and Global Accelerator (a classic exam confusion); and the edge security services (WAF, Shield, Network Firewall) and where they attach. Edge design affects performance, security, and cost simultaneously.

13.2 CloudFront Origins, OAC, and Content Protection

CloudFront caches at edge locations, pulling from anorigin(S3, an ALB, an API Gateway, or any HTTP server). To keep the origin private,Origin Access Control (OAC)- the modern replacement for Origin Access Identity (OAI) - restricts an S3 origin so it’s reachable only through CloudFront, not directly. For paid or private content,signed URLs(single files) andsigned cookies(multiple files) grant time-limited access, andfield-level encryptioncan encrypt specific sensitive form fields at the edge so only downstream services with the key can read them.Origin groupsprovide origin failover (primary/secondary) for resilience.Price classeslet you limit which edge locations serve content to control cost. These features make CloudFront a performance, security, and cost tool at once.

13.3 Edge Compute: Lambda@Edge vs CloudFront Functions

CloudFront supports running code at the edge, and the exam tests the two options.CloudFront Functionsare lightweight JavaScript functions for high-scale, latency-sensitive viewer-request/response manipulation (header rewrites, redirects, simple auth) - sub-millisecond, massive scale, runs at edge locations.Lambda@Edgeruns fuller Lambda functions (more compute, longer duration, network/SDK access) at Regional Edge Caches, for heavier logic at any of the four CloudFront trigger points (viewer/origin request/response). Rule of thumb: CloudFront Functions for simple, ultra-fast, ultra-high- volume header/URL manipulation; Lambda@Edge for richer processing that needs more resources or external calls.

flowchart LR
  User((User)) --> CF[CloudFront edge]
  CF -->|cache hit| User
  CF -->|simple header/redirect/auth| CFF[CloudFront Functions - sub-ms, huge scale]
  CF -->|heavier logic, SDK/network| LE[Lambda@Edge]
  CF -->|miss| Origin[(Origin: S3 w/ OAC, ALB, API GW)]
  Origin -.origin failover.-> Origin2[(Secondary origin)]

13.4 CloudFront vs Global Accelerator

A frequently-confused pair.CloudFrontis a CDN: itcaches contentat edge locations and is ideal for cacheable HTTP content (static assets, media, cacheable APIs).Global Acceleratordoesnot cache; it provides two static anycast IP addresses at the edge and routes traffic over AWS’s private global network to the optimal healthy endpoint (ALB, NLB, EC2, or EIP) in a Region - improving performance and providing fast regional failover fornon-cacheabletraffic, including TCP/UDP and non-HTTP protocols. So: use CloudFront to cache and accelerate cacheable web content; use Global Accelerator to accelerate and fail over dynamic/non-HTTP traffic to Regional endpoints with static anycast IPs. They can be combined, and both leverage the AWS edge network.

13.5 Edge Security: WAF, Shield, and Network Firewall

Edge and network security services and their placement are tested.AWS WAFis a web application firewall (Layer 7) that filters HTTP requests by rules (SQL injection, XSS, rate limiting, managed rule groups, geo-match) and attaches to CloudFront, ALB, API Gateway, or AppSync.AWS Shieldprovides DDoS protection -Shield Standardis free and automatic (common network/transport attacks), whileShield Advanced(paid) adds protection against larger/sophisticated attacks, cost protection, and a response team.AWS Network Firewallis a managed, stateful network firewall for the VPC (deployed with a firewall subnet and routing) providing IPS/IDS and domain filtering at the network layer - distinct from WAF’s application-layer filtering.Firewall Managercentrally manages WAF, Shield Advanced, and Network Firewall policies across an organization. For the exam: WAF = app-layer HTTP filtering at the edge/ALB; Shield = DDoS (Standard free, Advanced paid); Network Firewall = VPC network-layer firewall; Firewall Manager = central management across accounts.

13.6 Banking Production Scenario

A bank serves its web and mobile front ends through CloudFront with OAC locking the S3 origin to CloudFront only, signed cookies gating premium statements, field-level encryption on sensitive form inputs, and origin groups for failover. CloudFront Functions rewrite headers and enforce simple edge auth at massive scale, while Lambda@Edge handles a heavier personalization step. A WAF on CloudFront filters injection and abusive traffic and rate-limits, with Shield Advanced for DDoS protection and cost coverage. For a non-cacheable trading API needing static IPs and fast regional failover, the bank uses Global Accelerator to two Regional NLBs. AWS Network Firewall inspects egress at the VPC layer, and Firewall Manager enforces all these policies across every account. This complete edge-and-network security design is exactly the professional-level architecture expected.

13.7 Chapter Revision Notes

  • CloudFront: OAC (lock S3 origin to CloudFront), signed URLs/cookies (time-limited access), field-level encryption, origin groups (failover), price classes (cost).
  • Edge compute: CloudFront Functions (sub-ms, huge scale, simple header/URL/auth) vs Lambda@Edge (heavier logic, SDK/network, at Regional Edge Caches).
  • CloudFront caches content (cacheable HTTP); Global Accelerator does not cache - static anycast IPs + AWS backbone routing + fast failover for dynamic/non-HTTP traffic to Regional endpoints.
  • WAF = L7 HTTP filtering (CloudFront/ALB/API GW/AppSync); Shield = DDoS (Standard free, Advanced paid); Network Firewall = VPC network-layer firewall; Firewall Manager = central org-wide management.