Security · AWS SERVICE CHEATSHEET

AWS WAF (Web Application Firewall) (WAF)

Attaches directly to Application Load Balancers (ALB), Amazon CloudFront distributions, Amazon API Gateways, and AWS AppSync GraphQL endpoints. Inspects full HTTP/HTTPS request bodies, headers, URIs, and query strings against AWS Managed Rule Sets (AMRs) and custom regex rules to block OWASP Top 10 exploits, SQL injections, XSS, rate-limiting floods, and automated bot scrapers.

Open Interactive WAF Sandbox → Simulate in Architecture Studio

AWS Container Placement

Regional / Global Managed Scope (Outside VPC Subnets)

Summary

Layer-7 web application firewall monitoring HTTP/HTTPS requests forwarded to protected web applications.

When to Use (SAA-C03)

Place in front of CloudFront, API Gateway, or ALB whenever requirements mention SQL injection, XSS, geo-blocking, or rate limiting.

Allowed Ingress Connections & Ports

Source ServiceProtocolPortArchitectural Rationale
WEBCLIENTHTTP, HTTPS80, 443Public web browsers and API consumers sending web traffic
CLOUDFRONTHTTPS443CloudFront edge distribution forwarding requests through Web ACL inspection

Allowed Egress Targets & Ports

Target ServiceProtocolPortData Flow Rationale
ALBHTTP, HTTPS80, 443Application Load Balancer receiving clean, verified HTTP traffic
APIGWHTTPS443Amazon API Gateway receiving inspected REST/WebSocket API calls
CLOUDFRONTHTTPS443CloudFront cache engine receiving clean viewer requests

Key Configuration Parameters & AWS Best Practices

ParameterFormat / ExamplePurpose & Rationale
Scope (scope / wafScope) (Required)REGIONALSpecifies whether the Web ACL is deployed for regional resources (ALB, API Gateway, AppSync) or globally for Amazon CloudFront. Why: AWS WAF requires scope at creation; CloudFront Web ACLs must be created in us-east-1, while Regional Web ACLs exist in the local AWS region.
Default Action (defaultAction) (Required)ALLOWDetermines what AWS WAF does with a request if it does not match any of the rules in the Web ACL. Why: Defines the foundational baseline policy (default allow for open sites, default block for strict private APIs).
Associated Resource (wafAssociatedResourceId) (Required)arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/...The AWS resource protected by this Web ACL. Why: A Web ACL has no protective effect until associated with an entry point.
Managed Rule Group (managedRuleGroup) (Required)AWSManagedRulesCommonRuleSetTurnkey rule group maintained by AWS Threat Research defending against common web attacks. Why: Provides instant protection against OWASP Top 10 exploits without authoring custom regex expressions.
Rate Limit Threshold (wafRateLimitRps)500Maximum allowable requests from a single IP address over an evaluation window before triggering a block. Why: Protects backend servers against Layer-7 DDoS attacks and aggressive crawlers.
Block SQL Injection (wafBlockSqlInjection)trueInspects query strings, request bodies, and headers for SQL injection syntax. Why: Protects relational databases from malicious queries and data exfiltration.
Blocked Path Prefixes (wafBlockedPathPrefixes)/admin, /.env, /wp-login.phpURIs that are immediately blocked without evaluating backend routing. Why: Stops automated bots from probing WordPress logins, administrative portals, and exposed environment variables.
CloudWatch Metrics (cloudwatch_metrics_enabled)trueEmits real-time WAF rule metric counts to CloudWatch metrics for alerting and dashboards. Why: Enables monitoring of blocked request spikes and DDoS alarms.

Practice Labs Using AWS WAF (Web Application Firewall)

SAA-07

Global Video Streaming: CloudFront OAC Origin Shielding & S3 Leak

Enable Origin Access Control (OAC) on CloudFront and enable Block Public Access on the origin S3 bucket.…

BUILD-13

Build: Multi-Region CloudFront Edge + WAF + S3 OAC

Design from scratch: Route 53 DNS -> AWS WAF -> CloudFront CDN -> Private S3 Bucket.…

Frequently Asked Questions

Where does AWS WAF (Web Application Firewall) live inside an AWS VPC architecture?

Valid container placement: Regional / Global Managed Scope (Outside VPC Subnets). Attaches directly to Application Load Balancers (ALB), Amazon CloudFront distributions, Amazon API Gateways, and AWS AppSync GraphQL endpoints. Inspects full HTTP/HTTPS request bodies, headers, URIs, and query strings against AWS Managed Rule Sets (AMRs) and custom regex rules to block OWASP Top 10 exploits, SQL injections, XSS, rate-limiting floods, and automated bot scrapers.

When should I use AWS WAF (Web Application Firewall) on the AWS SAA-C03 exam?

Place in front of CloudFront, API Gateway, or ALB whenever requirements mention SQL injection, XSS, geo-blocking, or rate limiting.

Can I simulate AWS WAF (Web Application Firewall) packet routing without an AWS account?

Yes. CloudTracer simulates AWS WAF (Web Application Firewall) along with 53 AWS services directly in your browser and exports production Terraform HCL.

More Security Cheatsheets

Security Group → Network ACL → IAM Roles & Policies → KMS Encryption Keys → AWS Shield DDoS → Network Firewall →