Skip to main content

Overview

AWS WAF (Web Application Firewall) helps protect your web applications from common web exploits and bots that could affect availability, compromise security, or consume excessive resources. Think of WAF as a smart bouncer for your web application — it inspects every HTTP request before it reaches your servers and blocks anything suspicious (SQL injection, XSS, bot traffic, geographic origins you do not serve). Without WAF, your ALB or API Gateway accepts every request and passes it to your application, where a single SQL injection could dump your entire database. Think of WAF as the bouncer at your nightclub who checks IDs and pat-searches every person entering — it inspects every HTTP request against a list of rules (SQL injection patterns, known bad IPs, request rate limits) and either allows, blocks, or challenges suspicious requests before they ever reach your application code. Cost tip: WAF pricing has three components — 5/monthperWebACL,5/month per Web ACL, 1/month per rule, and 0.60permillionrequestsinspected.Atypicalproductionsetupwith1WebACL,10rules,and100Mrequests/monthcostsroughly0.60 per million requests inspected. A typical production setup with 1 Web ACL, 10 rules, and 100M requests/month costs roughly 75/month. The expensive surprise is Bot Control: the “Targeted” inspection level costs 10/Mrequestsvs10/M requests vs 1/M for “Common.” At 100M requests/month, that is 1,000vs1,000 vs 100 — choose the level that matches your actual bot threat.

Core Concepts

WAF Components

Rule Types

    Creating a Web ACL

    Basic Setup

    Terraform Configuration

    Advanced Features

    Bot Control

    CAPTCHA Challenge

    Custom Response

    Logging and Monitoring

    Enable Logging

    CloudWatch Metrics and Alarms

    Best Practices

    Security Checklist

    Cost Optimization

    Exam Tips