Filter concepts by levelShowing all levels.

AWS · WAF and Edge Security

WAF and Edge Security

Web ACLs and rule groups, rate and bot controls with logging, and where Shield fits

  • Web ACL = rules + default actionAllow/Block terminate, Count does not
  • Rate-based rules act on volumethe aggregation key need not be the IP
  • Enable WAF logging firsta blocked request never reaches your app logs
  • Shield Standard is automatic and freelayer 7 floods still need WAF rules

1.Web ACLs, Rules, and Rule Groups

AWS WAF inspects HTTP(S) requests before they reach your application. You write a web ACL — a list of rules, each with inspection criteria and an action — and associate it with a resource such as a CloudFront distribution, an Application Load Balancer, or an API Gateway REST API. That resource forwards each request to AWS WAF first, and the web ACL decides whether the request goes through.

Key features

  • A web ACL holds rules and one default action (allow or block) applied to requests that no rule already allowed or blocked
  • Rule actions are Allow, Block, Count, or a CAPTCHA / silent browser Challenge check
  • Rules live directly in the web ACL or in reusable rule groups (yours, AWS Managed Rules, or Marketplace) — a rule is not a standalone AWS resource, but web ACLs and rule groups are
  • Web ACL capacity units (WCUs) meter how much processing the rules require, and bound how much you can put in one web ACL
  • Protected resource types: CloudFront distribution, API Gateway REST API, Application Load Balancer, AppSync GraphQL API, Cognito user pool, App Runner service, Bedrock AgentCore Gateway, Verified Access instance, and AWS Amplify
  • Scope is CLOUDFRONT or REGIONAL — for CloudFront you must use the US East (N. Virginia) endpoint (`--scope=CLOUDFRONT --region=us-east-1`)

Rule actions and what they do to evaluation

Rule actions and what they do to evaluation
ActionEffect on the requestEffect on remaining rules
AllowSent on to the protected resourceTerminating — no further rules run
BlockRejected, by default with HTTP 403 or a custom responseTerminating — no further rules run
CountNothing; the match is only talliedNon-terminating — evaluation continues
CAPTCHAA puzzle is served unless a valid, unexpired token is presentContinues when the token is valid; otherwise terminates with the CAPTCHA response
ChallengeA silent browser check is run unless a valid token is presentContinues when the token is valid; otherwise terminates with the challenge
A request through a web ACL
arrives atforwarded forinspectionevaluates toallowedrequests only

Client request

Protected resource

CloudFront / ALB / API Gateway

Web ACL

rules in priority order

Allow / Block / Count / CAPTCHA

first terminating match wins

Your application

  • Client request
    • leads to Protected resource (arrives at)
  • Protected resource — CloudFront / ALB / API Gateway
    • leads to Web ACL (forwarded for inspection)
  • Web ACL — rules in priority order
    • leads to Allow / Block / Count / CAPTCHA (evaluates to)
  • Allow / Block / Count / CAPTCHA — first terminating match wins
    • leads to Your application (allowed requests only)
  • Your application

Signature

web ACL { rules[priority] → Allow | Block | Count | CAPTCHA | Challenge, default action } → protected resource

A web ACL = rules (each with criteria + an action) plus one default action, attached to a protected resource. Allow and Block are terminating; Count only tallies. Rule groups make rules reusable — AWS Managed Rules is the usual starting point. CloudFront-scoped web ACLs live in us-east-1.

2.IP Sets, Rate-Based Rules, Bot Control, and Logging

Signature rules catch requests that look malicious. The rules in this concept catch requests that are individually fine but wrong in aggregate — too many from one address, or coming from an automated client pretending to be a browser. IP sets match known addresses, rate-based rules count requests per key over a time window, and Bot Control identifies and labels automated traffic. WAF logging is what tells you which of them fired and on what.

Key features

  • An IP set is a reusable list of addresses or CIDR ranges a rule can reference, so an allow-list or block-list is edited in one place
  • A rate-based rule counts requests matching its scope per aggregation key over a sliding window and acts once the count crosses your limit
  • The aggregation key does not have to be the source IP — it can be a header, a cookie, a query argument, a label, or a combination, which is what makes per-tenant or per-API-key limits possible
  • Bot Control and the other intelligent threat mitigation rule groups label requests (verified crawler, likely automated client) so later rules can act on the label; CAPTCHA and Challenge issue a token so the check is not re-run on every request in a session
  • WAF logs record the matched rule, the action, and the request attributes, and can be delivered to CloudWatch Logs, S3, or Kinesis Data Firehose
  • Behind CloudFront, evaluate IP and rate rules at the CloudFront distribution — an ALB behind it sees the edge address, not the viewer's

Which control answers which abuse pattern

Which control answers which abuse pattern
PatternControlWhy the others do not fit
A known bad address rangeIP set referenced by a Block ruleA rate rule would only act after the abuse volume arrives
Credential stuffing on POST /loginRate-based rule scoped to that URIEach individual request is a valid login attempt
One tenant exhausting a shared APIRate-based rule keyed on the API-key headerKeying on IP groups a whole office behind one NAT address
A scraper imitating ChromeBot Control rule group, acting on its labelsThe requests are well-formed and come from many addresses
Automated traffic with no session stateChallenge actionBlocking outright also refuses legitimate clients from that network

Signature

IP set (known addresses) · rate-based rule (volume per key) · Bot Control (labels) · logs → CloudWatch Logs | S3 | Firehose

IP sets match known addresses; rate-based rules act on volume per aggregation key (which does not have to be the IP); Bot Control labels automated traffic so other rules can act on it. Enable WAF logging first — a blocked request leaves no trace in your application logs.

3.DDoS Protection and the Role of Shield

A DDoS attack floods a target from many compromised systems so real users cannot get through. AWS Shield defends against that, in two tiers: Shield Standard is on automatically for every AWS customer at no extra charge, and Shield Advanced is a paid subscription adding deeper application-layer protection and support. Shield handles the flood; AWS WAF is what expresses the application-specific rules underneath it.

Key features

  • Shield protects against DDoS at the network and transport layers (layers 3 and 4) and at the application layer (layer 7)
  • Shield Standard is provided automatically at no extra charge when you use AWS; Shield Advanced is a paid subscription
  • Network volumetric attacks (layer 3) try to saturate network capacity; network protocol attacks (layer 4), such as a TCP SYN flood, exhaust connection state; application layer attacks (layer 7) flood you with individually valid requests
  • AWS documents Shield as covering known and zero-day attack vectors — detection is designed to work on threats not explicitly known at the time
  • Layer 7 floods are made of valid requests, which is why AWS WAF rate-based rules — not raw bandwidth defenses — are the tool that shapes them
  • Terminating traffic at the edge (CloudFront, Route 53, Global Accelerator) is itself a DDoS design choice: the absorbing capacity is AWS's, not your origin's

Shield Standard vs Shield Advanced

Shield Standard vs Shield Advanced
AspectShield StandardShield Advanced
How you get itAutomatic for every AWS customerPaid subscription you opt into
CostNo extra chargeA monthly subscription plus data transfer
CoverageCommon layer 3 and 4 attacksAdds deeper detection and mitigation, including layer 7 for protected resources
SupportOrdinary AWS supportAccess to the AWS Shield Response Team and attack diagnostics
Typical fitEvery workload, by defaultPublic workloads where an outage has direct revenue or safety cost
What defends against what

Layer 3 — volumetric flood

Saturates network capacity · absorbed by Shield

Layer 4 — protocol abuse

TCP SYN flood exhausting connection state · absorbed by Shield

Layer 7 — request flood

Individually valid HTTP requests · shaped by AWS WAF rate-based rules

Application logic

Your handlers, your database — the thing being protected

  1. Layer 3 — volumetric flood — Saturates network capacity · absorbed by Shield
  2. Layer 4 — protocol abuse — TCP SYN flood exhausting connection state · absorbed by Shield
  3. Layer 7 — request flood — Individually valid HTTP requests · shaped by AWS WAF rate-based rules
  4. Application logic — Your handlers, your database — the thing being protected

Command

text
# The layered shape of a DDoS-resistant public entry point
Route 53  ->  CloudFront (+ web ACL: managed rules, rate-based rules)
          ->  ALB in private subnets
          ->  application

Shield Standard is automatic and free and handles common layer 3/4 floods. Shield Advanced is a paid subscription with deeper layer 7 protection and response-team access. A layer 7 flood is valid requests, so the actual control is an AWS WAF rate-based rule at the edge.

Remember

  • Roll a managed rule group out in Count mode, read the logs, then remove the override rule by rule.
  • Behind CloudFront, the ALB sees the edge address — evaluate IP and rate rules at the distribution.
  • A CloudFront-scoped web ACL must be created against us-east-1 (`--scope=CLOUDFRONT --region=us-east-1`).
  • Shield stops the flood; AWS WAF expresses the application-specific policy. Neither replaces the other.

Pro tip

  • Challenge degrades where Block refuses — a real browser answers it transparently, a script cannot, and an office sharing one NAT address is not locked out.
  • Set a rate limit from the peak legitimate traffic per key, not the average; averages hide the office and the mobile carrier gateway.

Next up

  • Monitoring — CloudWatch
  • CloudFront and Edge Delivery
  • AWS Security Services

Sources

  • How AWS WAF works — docs.aws.amazon.com/waf/latest/developerguide/how-aws-waf-works.html
  • AWS WAF protected resource types — docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html
  • How AWS Shield and Shield Advanced work — docs.aws.amazon.com/waf/latest/developerguide/ddos-overview.html
  • wafv2 create-web-acl --scope — docs.aws.amazon.com/cli/latest/reference/wafv2/create-web-acl.html
  • Checked against official AWS documentation 2026-08-29

Spotted a mistake on this page? Tell us.