SAABlog
SecurityIntermediate

AWS WAF & Shield: Complete Guide to Web Application and DDoS Protection

Learn how to block web attacks with AWS WAF and defend against DDoS with Shield, including architecture design patterns.

PHILOLAMB-Updated: January 31, 2026
WAFShieldDDoSWeb SecurityCloudFront

Related Exam Domains

  • Domain 1: Design Secure Architectures

Key Takeaway

AWS Shield Standard is free and protects against L3/L4 DDoS, while WAF blocks L7 web attacks (SQL injection, XSS, etc.). Shield Advanced provides paid advanced DDoS protection, SRT support, and cost protection. CloudFront + WAF combination is the best practice for edge defense.

Exam Tip

Exam Essential: "L3/L4 DDoS = Shield", "L7 web attacks = WAF", "Advanced DDoS + SRT + cost protection = Shield Advanced"

AWS Shield

Shield Standard vs Advanced

ItemShield StandardShield Advanced
CostFree (automatic)$3,000/month + data transfer
Protection LayerL3/L4L3/L4 + L7
Applied ToAll AWS resourcesCloudFront, ALB, NLB, EC2, Global Accelerator, Route 53
DDoS DetectionBasicAdvanced (real-time visibility)
SRT Support✅ 24/7
Cost Protection✅ Credits for DDoS-induced scaling
WAF Integration✅ WAF cost included
Stateful Detection✅ Per-resource traffic baseline
CommitmentNone1 year

Shield Standard

Automatically applied to all AWS customers.

Protection Coverage:
- SYN/UDP Flood
- Reflection attacks
- Other L3/L4 DDoS attacks

Automatic detection + automatic mitigation (no user configuration needed)

Shield Advanced

Advanced protection against large-scale, sophisticated DDoS attacks.

Additional Features:
1. Real-time attack visibility (CloudWatch metrics)
2. Shield Response Team (SRT) 24/7 support
3. DDoS cost protection (scaling cost credits)
4. Automatic WAF rule creation (L7 DDoS mitigation)
5. Stateful detection (normal traffic baseline)

Exam Tip

Shield Advanced Keywords: "24/7 expert support", "DDoS cost protection", "real-time visibility" → Choose Shield Advanced

AWS WAF

What is WAF?

A Web Application Firewall that inspects HTTP/HTTPS requests and blocks malicious traffic.

Services WAF Can Be Applied To

ServiceProtection Target
CloudFrontBlock at global edge (recommended)
ALBRegional web app protection
API GatewayAPI endpoint protection
AppSyncGraphQL API protection
Cognito User PoolAuthentication endpoint protection

Exam Tip

WAF Not Supported: WAF cannot be applied directly to NLB or EC2. You need CloudFront or ALB in front.

WAF Rule Types

1. Regular Rules

Inspect specific conditions to allow/block.

ConditionDescription
IP SetAllow/block specific IPs
Geo MatchBlock by country
String MatchInspect URI, headers, body
RegexPattern matching
Size ConstraintRequest size limits
SQL InjectionDetect SQL insertion attacks
XSSDetect cross-site scripting

2. Rate-Based Rules

Automatically block when same IP exceeds threshold in 5 minutes

Example: Over 2,000 requests in 5 minutes → Block IP
→ Effective for HTTP Flood DDoS defense

3. Managed Rule Groups

Pre-configured rules provided by AWS and AWS Marketplace partners.

Rule GroupProtection Target
Core Rule SetCommon web vulnerabilities (OWASP Top 10)
SQL InjectionSQL insertion attacks
Known Bad InputsKnown malicious patterns
IP ReputationBlock malicious IPs
Bot ControlBot traffic management
Account Takeover PreventionAccount takeover prevention

WAF Web ACL Structure

Web ACL (Web Access Control List)
│
├── Rule 1: AWS Managed Rules (Core Rule Set)    [Priority: 0]
│   → Action: Block
│
├── Rule 2: Rate-Based Rule (2000/5min)          [Priority: 1]
│   → Action: Block
│
├── Rule 3: Geo Block (specific countries)       [Priority: 2]
│   → Action: Block
│
├── Rule 4: IP Whitelist                         [Priority: 3]
│   → Action: Allow
│
└── Default Action: Allow

Exam Tip

WAF Rule Evaluation Order: Rules are evaluated in order of Priority number (lowest first). Once matched, that action is executed and evaluation stops.

Multi-Layer Defense Architecture

Best Practice: CloudFront + WAF + Shield

[Internet]
    │
    ▼
[CloudFront] ← WAF Web ACL attached
    │            ├── Managed Rules (OWASP)
    │            ├── Rate-Based Rules
    │            └── Geo Block
    │
    │  Shield Standard (automatic, free)
    │  Shield Advanced (optional, paid)
    │
    ▼
[ALB] ← Additional WAF possible
    │
    ▼
[EC2 / ECS / Lambda]

Defense Layer Roles

LayerServiceDefense Target
Edge (L3/L4)Shield StandardSYN Flood, UDP Flood
Edge (L7)WAF on CloudFrontSQL injection, XSS, bots
Regional (L7)WAF on ALBAdditional rule application
Advanced DDoSShield AdvancedLarge-scale sophisticated attacks

WAF Cost Structure

ItemCost
Web ACL$5/month
Rule$1/rule/month
Requests$0.60/million
Managed Rule GroupsVaries by group
Example: 1 Web ACL, 5 rules, 10 million requests/month
- Web ACL: $5
- Rules: $5 (5 × $1)
- Requests: $6 (10 × $0.60)
- Total: $16/month

AWS Firewall Manager

Centrally manage WAF, Shield Advanced, and Security Groups across multiple accounts.

Organizations + Firewall Manager:

Management Account
└── Firewall Manager
    ├── WAF Policy → Apply to CloudFront/ALB across all accounts
    ├── Shield Advanced Policy → Apply to designated accounts
    └── Security Group Policy → Apply to VPC resources

Exam Tip

Firewall Manager Prerequisite: Requires AWS Organizations + WAF enabled.

SAA-C03 Exam Focus Points

  1. Shield Standard: "Free, automatic, L3/L4 DDoS defense"
  2. Shield Advanced: "Paid, SRT 24/7, DDoS cost protection"
  3. WAF Targets: "CloudFront, ALB, API Gateway (NLB not supported)"
  4. Best Practice: "CloudFront + WAF = edge defense"
  5. Rate-Based Rules: "HTTP Flood defense"

Exam Tip

Sample Exam Question: "Your web application is experiencing SQL injection attacks. How do you defend?" → Answer: Apply AWS WAF with SQL injection managed rules (connect to CloudFront or ALB)

Frequently Asked Questions

Q: Is Shield Standard sufficient?

For most common DDoS attacks, Shield Standard is sufficient. Only consider Shield Advanced when you need protection against large-scale attacks, SRT expert support, or cost protection.

Q: Can WAF be applied directly to NLB?

No. WAF can only be applied to L7 (HTTP/HTTPS) services. NLB is L4, so direct application is not possible. Consider placing CloudFront in front of NLB or switching to ALB.

Q: Does Shield Advanced activation include WAF?

Yes. Shield Advanced includes WAF usage costs. WAF Web ACL, rules, and request costs are included in the Shield Advanced subscription.

Q: How do I test WAF rules?

Set the rule action to Count mode to record match counts without actual blocking. After sufficient testing, change to Block.

Q: When should I use Firewall Manager?

When you need to consistently apply WAF rules or Shield Advanced across multiple AWS accounts. For a single account, it's simpler to configure WAF directly without Firewall Manager.

References