Xoxoftware - XOXO Creative Studio | Web & Mobile App Development | Fred Cheung | Hong Kong
AWSSecurity

AWS WAF and Shield

Web application firewall and DDoS protection — web ACLs, rate limiting, managed rules, Shield Standard vs Advanced.

Overview

AWS WAF is a web application firewall that filters HTTP/HTTPS traffic at Layer 7 — it protects against common exploits like SQL injection, XSS, and bot traffic. AWS Shield provides managed Distributed Denial of Service (DDoS) protection at Layers 3, 4, and 7.

ServicePurposeCost
AWS WAFLayer 7 filtering (web ACLs, rules)Per web ACL + rules + requests
Shield StandardBasic L3/L4 DDoS protectionFree (automatic for all)
Shield AdvancedEnhanced DDoS protection + DRT + cost protection$3,000/month + data fees

Core Concepts

ConceptDescription
Web ACLA set of rules that inspects and controls HTTP/S traffic to a protected resource
RuleA condition-action pair: match criteria → allow, block, count, or CAPTCHA
Rule GroupA reusable collection of rules (AWS Managed, Marketplace, or custom)
Rate-Based RuleBlocks IPs exceeding a request threshold within a 5-minute window
IP SetA named list of IP addresses or CIDR ranges for allow/block lists
Regex Pattern SetA set of regex patterns for matching request components
Managed Rule GroupPre-configured rules maintained by AWS or third-party vendors
Shield StandardAutomatic L3/L4 DDoS protection at no cost for all AWS resources
Shield AdvancedEnhanced detection, DDoS Response Team (DRT), cost protection, and advanced metrics

WAF Deployment Points

ResourceLayerNotes
Amazon CloudFrontEdgeGlobal protection; recommended for internet-facing apps
Application Load BalancerRegionalProtects ALB-backed applications
Amazon API GatewayRegionalProtects REST APIs
AWS AppSyncRegionalProtects GraphQL APIs
Amazon Cognito User PoolsRegionalProtects authentication endpoints
AWS App RunnerRegionalProtects App Runner services
AWS Verified AccessRegionalProtects enterprise application access

WAF Rule Types

Rule TypeMatches OnExample
IP matchSource IP or IP setBlock known bad IPs
Geo matchCountry of originBlock or allow specific countries
String matchURI, query string, header, body contentBlock paths containing /admin
Regex matchRegex patterns on request componentsDetect SQL injection patterns
Size constraintRequest component size exceeds thresholdBlock oversized payloads
Rate-basedRequest count per IP exceeds threshold per 5 minutesRate limit to 2,000 req/5 min per IP
Managed rulePre-built detection logic (OWASP Top 10, bots, etc.)AWS Core Rule Set, Bot Control

AWS Managed Rule Groups (Key Examples)

Rule GroupProtects Against
Core Rule Set (CRS)OWASP Top 10 — SQLi, XSS, SSRF, etc.
Known Bad InputsCommon exploit payloads
Bot ControlAutomated bot traffic (scraping, credential stuffing)
Account Takeover PreventionCredential stuffing on login pages
IP ReputationIPs with known malicious activity

Shield Standard vs Advanced

FeatureShield StandardShield Advanced
CostFree$3,000/month (1-year commitment)
Protection layerL3/L4L3/L4/L7
Automatic mitigationYes (basic)Yes (enhanced ML-based)
DDoS Response Team (DRT)NoYes (24/7 access)
Cost protectionNoYes (credits for scaling costs during attacks)
Advanced metricsNoYes (real-time attack visibility)
WAF integrationSeparateFree WAF for Shield-protected resources
Health-based detectionNoYes (Route 53 health checks for faster detection)

SAA/SAP Tip: Shield Advanced includes free WAF (no web ACL or rule charges) for protected resources. It also provides cost protection — AWS credits scaling charges incurred during a DDoS attack (e.g., EC2, CloudFront, ALB scale-out).


Common Use Cases

  • OWASP Top 10 protection — Deploy AWS Managed Core Rule Set on CloudFront or ALB to block SQL injection, XSS, and other common attacks.
  • Rate limiting — Rate-based rules to throttle brute-force login attempts or API abuse.
  • Geo-blocking — Restrict content delivery to specific countries for compliance or licensing.
  • Bot mitigation — Bot Control managed rule group to detect and block scrapers and automated threats.
  • DDoS protection — Shield Advanced for mission-critical public-facing applications with DRT support and cost protection.

SAA/SAP Exam Tips

SAA/SAP Tip: AWS WAF on CloudFront protects at the edge (global). WAF on ALB protects at the regional level. For best protection, attach WAF to CloudFront in front of the ALB.

Exam Trap: Shield Standard is already enabled for all AWS accounts at no cost. Questions asking about "additional DDoS protection" or "DDoS Response Team" always point to Shield Advanced ($3,000/month).

SAA/SAP Tip: For "block SQL injection and XSS attacks" with minimal effort, the answer is WAF with AWS Managed Rules (specifically the Core Rule Set). No custom rule writing is required.


Cross-Cloud Equivalents

ProviderService / SolutionNotes
AWSAWS WAF + ShieldBaseline
AzureAzure Web Application Firewall + Azure DDoS ProtectionWAF on Application Gateway or Front Door
GCPGoogle Cloud ArmorCombined WAF + DDoS; integrated with LB
On-PremisesCloudflare, Akamai, Imperva, ModSecurityCDN-based or on-premises WAF appliances

Pricing Model

WAF

DimensionUnitNotes
Web ACL$5/monthPer web ACL
Rule$1/month per rulePer rule within a web ACL
Requests$0.60 per millionInspected requests
Bot Control$10/month + $1/MAdditional charge for bot rule group

Shield

DimensionUnitNotes
Shield StandardFreeAutomatic for all AWS accounts
Shield Advanced$3,000/month1-year commitment; includes free WAF for protected resources
DDoS data transferPer GBCharged during Shield Advanced events

Built by Fred Cheung @CookedRicer · Powered by Fumadocs & Github Copilot

On this page