How do you secure the origin behind a CDN?
IntermediateConceptLoad Balancers, Proxies & CDNs
Answer
Make the origin unreachable except via the CDN: restrict the security group to the CDN's managed prefix list (CloudFront has an AWS managed prefix list), add a secret custom header the origin checks, use Origin Access Control for S3, and optionally mTLS or a VPC origin.
Otherwise attackers hit the origin IP directly and bypass WAF and caching.
More on Load Balancers, Proxies & CDNs
What is a load balancer and why do we use one?BeginnerWhat is the difference between L4 and L7 load balancing?IntermediateCompare ALB, NLB, GWLB and Classic Load Balancer in AWS.IntermediateWhat load-balancing algorithms are common?BeginnerWhat are health checks and how should they be designed?AdvancedWhat is connection draining (deregistration delay)?Intermediate