Skip to content

09. Edge Security: WAF and DDoS Defense ​

Last Updated: November 19, 2026 Lab boundary: Desk exercise only. You write a count-mode rule plan on paper; this workbook creates no web ACL, distribution, Shield subscription, load balancer or Kubernetes object, and sends no attack or load traffic to any system. Verification status: The AWS WAF, AWS Shield and Amazon CloudFront developer guides, the AWS WAF API reference, the AWS whitepaper on DDoS resiliency, RFC 4987 and the OWASP Top 10 2021 page were checked. No rule was deployed and no traffic was measured; the numbers in the exercise are a worked scenario, not observations.

After this workbook, you should be able to name the layer an attack targets, say where on the path it is stopped and by which control, build an AWS WAF rule plan that starts in count mode with measured expectations and a rollback trigger, and explain why an origin that the internet can reach on its own makes every edge control optional for the attacker.

This chapter builds on the edge-to-origin path from workbook 08 (CloudFront → VPC origin → internal ALB) and does not re-teach it. Host firewalls on the server itself are in beginner 06. WAF placement, rule-ordering pitfalls, request-body inspection limits, forwarded client IPs and the full log field list are in WAF, Edge and API Security; this workbook links those sections instead of repeating them. Pod-level rules are in Network Policies, and the Ingress side is in AWS Load Balancer Controller. The controller document's examples use alb.ingress.kubernetes.io/scheme: internet-facing; in this course's edge design the ALB is internal (alb.ingress.kubernetes.io/scheme: internal) and sits behind a CloudFront VPC origin, so read those examples with that one value changed. Anycast routing with BGP is in workbook 02, and the TCP handshake in Network Fundamentals Part 2.

Readiness: a text editor and the AWS documentation. No AWS account is needed. Building the design yourself incurs AWS WAF charges (per web ACL, per rule and per million requests, plus extra fees for Bot Control, account takeover prevention, the Anti-DDoS rule group (unless covered by Shield Advanced), CAPTCHA and Challenge, capacity above 1,500 WCUs and logging), CloudFront and load balancer charges, and, if you subscribe, AWS Shield Advanced (the pricing page lists a monthly fee starting at $3,000 with a one-year term). That cost and the cleanup are the learner's own. Never test with attack traffic, including against your own resources, outside a written and approved test plan.

1. Read with a question to answer ​

Exam scope only chooses what to read. Numbers and behavior come from the official pages in the first column.

ReadExam scope it maps toQuestion to answer in your own words
AWS Shield Standard overview, Shield mitigation logic for CloudFront and Route 53ANS-C01 Domain 4 Network Security, Compliance, and Governance, Task 4.1 (securing inbound traffic flows with AWS WAF and AWS Shield)Why does a SYN flood aimed at a CloudFront distribution not become a SYN flood at the origin?
Using rule actions, Rate-based rule settings, Web request labelingDomain 4, Task 4.1 (threat models, mitigation strategies)Which actions end the evaluation of a request, and which let later rules see it?
AWS Shield Advanced capabilities, Anti-DDoS managed rule groupDomain 4, Task 4.1What does Shield Advanced add that Shield Standard does not, and what does it require first?
Testing and tuning protections, Logging web ACL traffic, Viewing sampled requestsDomain 4, Task 4.2 (validate and audit security with monitoring and logging)Which log field shows that a rule in Count mode would have matched?
OWASP Top 10 2021Domain 4, Task 4.1 (common security threats)Which of the ten categories can an edge WAF reduce, and which can only the application fix?

After reading, draw the path from the client to the Pod and mark on it where each attack in section 2 stops. A design review that cannot point to the stopping place for an attack has not covered that attack.

2. Threat layers: what each attack exhausts ​

Attacks are easier to place when you ask what resource they try to use up: link bandwidth, connection state, CPU for TLS, or application work.

LayerAttackMechanismWhat it exhausts
L3UDP reflectionThe attacker spoofs the victim's address as the source of small UDP requests to third-party servers (DNS, NTP, SSDP, CLDAP, Memcached, CharGen, QOTD), which send much larger responses to the victim. For DNS the AWS whitepaper gives an amplification factor of 28 to 54 timesLink and network capacity
L4SYN floodMany SYNs that never complete the three-way handshake (Part 2)The listener's backlog of half-open connections (RFC 4987 §2.2); the attack does not need to fill the link
L6TLS abuseUnreadable data presented as a handshake, endless renegotiation, or rapid session open and closeCPU on the side that terminates TLS
L7HTTP floodRequests that look like a valid user's, sometimes imitating human browsingApplication capacity; low volumes can be enough
L7Cache-bustingAn HTTP flood that varies the query string so the CDN must forward every request (workbook 08 section 5)Origin capacity behind the cache
L7Exploit attemptsPayloads for known vulnerability classes (section 4)Confidentiality and integrity, not capacity
L7Bots, scrapers, credential stuffingAutomated content theft and login attempts with leaked username and password pairsBusiness logic and accounts; the whitepaper notes these are not strictly DDoS but look like it

Two consequences follow. First, a reflection attack needs the ability to spoof source addresses, and networks that apply source address validation (BCP 38) remove it. Second, an L7 attack is well-formed traffic, so nothing that checks only packet validity can stop it: it needs a control that reads the request.

3. Where each attack is stopped ​

AttackStopped atMechanismOwner
UDP reflectionCloudFront edgeShield mitigations pass only traffic that is valid for web applications; CloudFront accepts only well-formed connectionsAWS (automatic)
SYN floodCloudFront edgeThe Shield TCP SYN proxy verifies the handshake (stateless SYN cookies) before a connection reaches the serviceAWS (automatic)
TLS abuseCloudFront edgeTLS terminates at the edge, so the origin sees only well-formed requests (workbook 08 section 7)AWS (automatic)
HTTP flood, cache-bustingWAF web ACL at the edgeRate-based rules, the Anti-DDoS managed rule group, ChallengeYou
Exploit attemptsWAF web ACL, then the applicationManaged rule groups as a first filter; input validation and authorization in the applicationYou
Credential stuffingWAF (account takeover prevention), then the applicationStolen-credential checks and login volume limits; MFA and lockout policy in the applicationYou
Anything aimed at the origin directlyNowhere, unless the origin has no public pathOrigin cloaking (section 8)You

SYN cookies let a listener keep no state for a connection in SYN-RECEIVED: the server encodes what it needs in the sequence number of its SYN-ACK and rebuilds the state when a valid ACK returns (RFC 4987 §3.6). The AWS whitepaper describes the edge services' stateless SYN flood mitigation as verifying incoming connections with SYN cookies before passing them on, and notes that modern operating systems enable SYN cookies by default. CloudFront also keeps persistent connections to the origin, so a viewer's new connection is not a new origin connection. Neither AWS WAF nor a security group replaces this: AWS WAF inspects HTTP requests, so it acts only after a connection exists, and a security group admits or denies by source, protocol and port without limiting the rate.

Absorption needs capacity larger than the flood. The AWS page on Shield mitigation for CloudFront says CloudFront uses a combination of DNS traffic direction and anycast routing to mitigate attacks close to the source and isolate faults. That is consistent with workbook 08: DNS steers each viewer to a POP, and the attack traffic lands on many POPs instead of one origin. Shield mitigation is integrated with the edge services, and the whitepaper states that this reduces the time to mitigate from minutes to under a second.

Cost of rejected traffic: the whitepaper states that you are not charged for HTTP requests or data transfer out for requests that CloudFront or AWS WAF rejects. A request that the WAF blocks costs WAF request inspection, not origin capacity.

Practical point: the edge stops volume; it does not decide who may do what. AWS WAF reduces the exploit and abuse surface, but authorization stays in the application (section 1 of that chapter). A design where the WAF is the only check on a business action has a single point of failure.

4. OWASP Top 10 2021 and what an edge WAF can do ​

The OWASP Top 10 2021 has ten web application risk categories, A01 to A10. OWASP has since published a 2025 edition; this workbook uses the 2021 list. AWS describes its core rule set as protection against "some of the high risk and commonly occurring vulnerabilities" described in OWASP publications such as the Top 10. Treat managed rules as a filter for known request patterns, not as coverage of a category.

2021 categoryEdge WAF contribution (AWS managed rule group examples)What only the application or platform can do
A01 Broken Access ControlLittle: the request looks legitimateObject-level authorization on every request
A02 Cryptographic FailuresNone at the WAFTLS on every leg (workbook 08 section 7), key and data handling
A03 InjectionSQL injection rules (AWSManagedRulesSQLiRuleSet, 200 WCU), cross-site scripting rules in the core rule setParameterized queries, output encoding
A04 Insecure DesignNoneThreat modeling, business limits
A05 Security MisconfigurationIndirectConfiguration review; a publicly reachable origin is a misconfiguration of the edge design (section 8)
A06 Vulnerable and Outdated ComponentsKnown bad inputs (AWSManagedRulesKnownBadInputsRuleSet, 200 WCU), for example the Log4j and Java deserialization patternsPatching; a WAF rule only buys time
A07 Identification and Authentication FailuresAccount takeover prevention (AWSManagedRulesATPRuleSet, 50 WCU, paid)MFA, lockout, session handling
A08 Software and Data Integrity FailuresNoneSigned artifacts, supply-chain controls
A09 Security Logging and Monitoring FailuresWAF logs and metrics are one input (section 9)Correlation and alerting across layers
A10 Server-Side Request Forgery (SSRF)Core rule set rules that look for attempts to exfiltrate EC2 metadata (EC2MetaDataSSRF_*)Egress control and URL validation in the application

The core rule set (AWSManagedRulesCommonRuleSet) costs 700 WCU. It also enforces size limits, for example SizeRestrictions_BODY blocks request bodies over 8 KB, which is a common source of false positives for upload paths (section 10).

5. The AWS WAF model ​

Web ACL. The AWS WAF console now calls a web ACL a protection pack (web ACL); this workbook uses "web ACL". A web ACL holds rules and rule groups and a default action (Allow or Block) for any request that no rule terminates. Each resource is associated with at most one web ACL, and one web ACL can protect many resources.

Scope. A web ACL for CloudFront is global: it has the hard-coded Region US East (N. Virginia). Through the CLI you pass --scope=CLOUDFRONT --region=us-east-1, and through the API and SDKs you use the us-east-1 endpoint. A web ACL associated with a CloudFront distribution cannot also be associated with another resource type; a regional resource such as an ALB needs a separate REGIONAL web ACL in its own Region.

Rules, rule groups and order. A rule is a statement plus an action. A rule group is a reusable set of rules, either your own or a managed rule group (AWS Managed Rules, AWS Marketplace sellers). AWS WAF evaluates rules from the lowest numeric priority up until a rule terminates the evaluation or the rules run out; inside a rule group it uses that group's own priorities. Ordering pitfalls (a broad early Allow, exempting a whole group) are in security/14 section 3.

Actions:

ActionEnds evaluation?Behavior
AllowYesForwards the request to the protected resource; your own rules can insert custom request headers
BlockYesThe protected resource answers 403 (Forbidden) by default; your own rules can define a custom response
CountNoCounts the match and continues with the next rule; can add labels and custom request headers
CAPTCHADepends on the tokenValid, unexpired token: behaves like Count. Missing, invalid or expired token: blocks and sends a CAPTCHA puzzle when the client can show it
ChallengeDepends on the tokenSame token logic, with a silent browser challenge instead of a puzzle

CAPTCHA and Challenge run only when browsers access HTTPS endpoints in a secure context, and both carry extra fees. An API client that is not a browser cannot answer them, so test machine APIs separately; AWS WAF also provides application integration SDKs that add tokens to requests from apps. AWS has also added a Monetize action (HTTP 402 Payment Required, CloudFront web ACLs only, terminating, not allowed in rate-based rules); it is outside this workbook's scope.

Rate-based rules. A rate-based rule counts requests for each aggregation instance (for example each source IP) over an evaluation window of 60, 120, 300 or 600 seconds (default 300) and applies its action to further matching requests from an instance that exceeds the limit (minimum 10). The action can be anything except Allow. A scope-down statement limits which requests are counted and acted on, for example only POST to /login. The behavior to design around:

  • AWS WAF estimates the rate with an algorithm that weights recent requests more, so it limits near the configured value, not exactly at it.
  • The guide says the rate is checked frequently and independently of the window; the API reference says about every 10 seconds. Requests can arrive too fast for up to several minutes before limiting starts, and limiting can continue after the rate falls, usually for under 30 seconds.
  • Changing the limit, window, aggregation, forwarded IP configuration or scope resets the counts and can pause rate limiting for up to a minute.
  • A rate-based statement cannot be nested inside another statement (for example a NotStatement), but its scope-down statement can contain one.
  • With aggregation on IP alone, GetRateBasedStatementManagedKeys lists the addresses currently being limited.

Which client address to aggregate on along CloudFront → ALB → Ingress is covered in security/14 section 5.

Labels. A label is metadata that a matching rule adds to the request; it remains for the rest of that web ACL's evaluation, and later rules read it with a label match statement. Your labels have the form awswaf:<account id>:<rulegroup or webacl>:<name>:<namespace>:...:<label name>, and managed rule group labels the form awswaf:managed:<vendor>:<rule group name>:..., for example awswaf:managed:aws:core-rule-set:NoUserAgent_Header. All AWS Managed Rules rule groups add labels. The main pattern is: set a rule to Count so it only labels, then add a later rule that decides on the label combination. Labels also produce CloudWatch label metrics.

Overriding managed rules. Two different switches exist:

OverrideWhat happensUse for testing?
Rule action override (RuleActionOverrides, per rule inside the group)Matching requests are handled exactly as if that rule's action were the override, for example Count; the group keeps evaluating its other rulesYes, this is the documented way to test a rule group
Rule group return action override to CountThe group evaluates normally and stops at its first terminating match; only the result returned to the web ACL becomes CountNo: the guide says it does not change how the group evaluates, so later rules in the group never run for that request

RuleActionOverrides replaced the older ExcludedRules setting in October 2022.

Capacity (WCU). Web ACL capacity units measure the operating resources rules need; they do not change how traffic is inspected. Simple statements cost less than, for example, regex pattern sets or JSON body inspection. A rule group has an immutable capacity set at creation (maximum 5,000 WCU), and using a group in a web ACL costs that capacity, not its current content. A web ACL can use up to 5,000 WCU; the base price includes 1,500, and capacity above that has tiered extra fees. The CheckCapacity API returns the capacity of a rule list before you deploy it.

Propagation. Changes take from a few seconds to a number of minutes to reach every location, so for a short time one location can apply the new action while another still applies the old one.

6. AWS Shield Standard and Shield Advanced ​

Shield StandardShield Advanced
Cost and activationAutomatic for every AWS customer at no additional chargeSubscription; the pricing page lists a monthly fee starting at $3,000 with a one-year term that renews automatically. Protects only the resources you add explicitly (or through an AWS Firewall Manager Shield Advanced policy)
CoverageThe most common, frequently occurring network and transport layer attacks; CloudFront distributions, Route 53 hosted zones and Global Accelerator standard accelerators receive protection against all known network and transport layer attacksCloudFront, Route 53 hosted zones, Global Accelerator standard accelerators, Elastic IP addresses (and the EC2 instances and NLBs behind them), ALBs and Classic Load Balancers
Application layer (L7)None by itself; L7 is the WAF's jobUses AWS WAF web ACLs; standard WAF fees for protected resources are covered up to 1,500 WCU and the default body size. Bot Control, CAPTCHA, capacity above 1,500 WCU and larger body inspection are not covered. The subscription also includes the Anti-DDoS rule group at no additional cost and covers AWS WAF request fees up to 50 billion requests a month per payer (then $0.15 per million)
Automatic L7 mitigationNoneSee the next paragraph
Response teamNoneShield Response Team (SRT) for help during an attack and custom mitigations; requires a Business Support or Enterprise Support plan (the DDoS resiliency whitepaper words it as Business Support+ or Enterprise Support)
DetectionAutomaticHealth-based detection with Route 53 health checks, which proactive engagement (the SRT contacts you) requires
Cost protectionNoneShield Advanced service credits for some scaling charges caused by an attack
VisibilityNone beyond service metricsEvent details through the console, API and CloudWatch metrics; protection groups

Automatic L7 mitigation in 2026. Since March 26, 2026, the Anti-DDoS managed rule group (AWSManagedRulesAntiDDoSRuleSet, 50 WCU; extra fees under plain AWS WAF, included at no additional cost with a Shield Advanced subscription) is AWS's default solution for HTTP request floods, and it supersedes Shield Advanced's Layer 7 automatic mitigation, which existing customers can keep using. The rule group compares traffic with the resource's baseline, labels every request during an event (awswaf:managed:aws:anti-ddos:event-detected) and suspected sources by confidence (low-, medium-, high-suspicion-ddos-request), sends a silent Challenge as a soft mitigation (only GET requests can be labelled challengeable), and blocks as a hard mitigation. The legacy Shield Advanced feature adds a 150 WCU rule group, needs 24 hours to 30 days to learn a baseline, can count or block, and works less well on an ALB behind a CDN because the CDN may not forward the original client attributes; AWS recommends enabling it on the CloudFront distribution instead.

7. Defense in depth on the reference path ​

Edge security animation. ① A botnet sends an L3/L4 flood (UDP reflection and SYN flood) at the CloudFront edge; Shield absorbs it there and nothing reaches the origin. ② A bot sends a well-formed HTTPS flood on /login; it passes the L3/L4 checks, but a rate-based rule in the WAF web ACL, example name rate-login, blocks it and the client receives 403 Forbidden. ③ A legitimate GET passes Shield, and because no WAF rule terminates its evaluation, the web ACL default action Allow forwards it. ④ CloudFront connects through a VPC origin: a service-managed ENI in a private subnet, 10.0.11.25, opens a connection to an internal ALB, 10.0.12.40, whose security group admits only CloudFront-VPCOrigins-Service-SG or the origin-facing prefix list. ⑤ The ALB, created from an Ingress with scheme internal, forwards to a Pod IP, 10.0.13.31, whose NetworkPolicy admits only the ALB subnet, and the Pod returns 200. There is no internet-facing load balancer and no inbound rule that admits a public CIDR.

LayerControlAdmitsEvidence it worked
Edge networkShield Standard, CloudFront (DNS steering, anycast, SYN proxy, TLS at the edge)Well-formed HTTP(S) connectionsOrigin load unchanged during a network-layer event; Shield Advanced event data if subscribed
Edge applicationGlobal web ACL (CLOUDFRONT scope, us-east-1)Requests no rule terminates, then the default actionWAF logs terminatingRuleId, action, labels
Origin pathVPC origin to an internal ALB (workbook 08)Only CloudFront; the ALB has private addresses onlyNo internet route exists to test against
ALB security groupInbound only from CloudFront-VPCOrigins-Service-SG (your distribution) or the managed prefix list com.amazonaws.global.cloudfront.origin-facing (any distribution)CloudFront's VPC origin ENIsSecurity group rules; expect ALB access logs to show only addresses from the VPC origin subnet
IngressAWS Load Balancer Controller with alb.ingress.kubernetes.io/scheme: internal and target-type: ip (AWS Load Balancer Controller)Listener rules you definedIngress events, target health
PodNetworkPolicy ingress from an ipBlock with the ALB subnets (Network Policies)Connections from the ALB nodesDenied connections in the CNI's policy logs, if enabled
HostHost firewall (beginner 06)Ports the node must serveFirewall counters
ApplicationAuthentication and authorizationThe user's permitted actionsApplication audit log

Which source address the Pod sees. An ALB is a proxy: the ELB guide says server access logs contain only the load balancer's IP address, and the client's address arrives in X-Forwarded-For, which is trustworthy only when properly secured systems added it. A Pod IP target therefore sees the ALB node's private address, which is why the NetworkPolicy above names the ALB subnets. The Kubernetes documentation warns that whether address rewriting happens before or after NetworkPolicy processing depends on the network plugin, cloud provider and Service implementation, so confirm the observed source on your CNI before you rely on the rule, and recall that NetworkPolicy has no effect without a plugin that enforces it.

One web ACL or two. The CloudFront web ACL cannot also be associated with the ALB. If you add a regional web ACL on the ALB, it is a second, separate inspection with its own logs and costs; security/14 section 2 discusses when that is worth it.

8. Origin cloaking: why a reachable origin bypasses the edge ​

Every control in the edge rows of the table above applies only to requests that go through the distribution. If an attacker learns an address or DNS name at which the origin answers from the internet, they send requests there and skip Shield's edge absorption, the global web ACL, the rate-based rules and CloudFront's TLS termination all at once. The origin then faces raw SYN floods and HTTP floods with only its own capacity, and the WAF logs show nothing.

Cloaking means the origin has no internet path at all. In the reference design this is a routing property, not a filter: the internal ALB has only private addresses, so a looser security group later still does not make it reachable from the internet (workbook 08). Compare the weaker design that security/14 option A describes, a public ALB that admits the CloudFront prefix list and checks a secret header: the prefix list admits any CloudFront distribution, including one an attacker creates, and the header is a shared secret that stops working once disclosed. This course does not use that design.

Bypass inventory for a review: old DNS records that still point to an earlier public origin, other load balancers or Services of type LoadBalancer in the same cluster, NodePorts, management endpoints, and test environments that serve the same application. A private origin label on one path does not prove that no other path exists.

9. Logging and metrics: what each signal proves ​

SignalWhereWhat it tells youLimit
WAF logsCloudWatch Logs log group, S3 bucket or Amazon Data Firehose stream whose name begins with aws-waf-logs-Per request: terminatingRuleId and action, Count matches in nonTerminatingMatchingRules, ruleGroupId, labelsCharged separately; you can filter which requests to keep and redact fields (shown as xxx)
CloudWatch metricsAWS WAF metricsMatches grouped by action (a Count rule's matches appear as Count metrics), label metrics for every labelCount-action rules inside rule groups do not emit web ACL dimension metrics, only Rule, RuleGroup and Region dimensions
Sampled requestsWeb ACL console tab or GetSampledRequestsUp to 100 requests that matched a rule and 100 that took the default action, from the previous three hours, with the rule, action and URINeeds sampling enabled; samples for Count rules inside rule groups are not shown in the web ACL view; redaction in logging does not apply to sampling
Traffic overview dashboardsWAF consoleNear real-time summaries of the CloudWatch metricsSummaries, not request evidence
Shield Advanced eventsShield console, API, CloudWatchDetected events and mitigations on protected resourcesSubscription only
CloudFront logsworkbook 08 section 10Status codes and result types per request at the edgeThe matching rule is in the WAF logs, so correlate the two

The full list of WAF log fields is in security/14 section 6. For rules in Count, logs and label metrics are the reliable evidence, because sampled requests and web ACL metrics can hide Count matches inside managed rule groups.

10. Exercise: a count-mode rule plan with a rollback trigger ​

Desk exercise. You write a plan that someone could execute later in an approved account; you do not deploy it. Mark the result worked scenario, not measured.

Scenario. A shop serves /assets/*, /login (POST, browser form), /api/* (a mobile app, not a browser) and /api/upload (images up to 5 MB) through the reference path in section 7. Seven days of CloudFront logs give this baseline:

PathVolumePer-IP peak in any 5 minutesNotes
POST /login1.2 million per day, success rate 96%p99 of 18 requests; one address, 198.51.100.20, peaks at 640198.51.100.20 is a partner's office NAT that many employees share
/api/upload40,000 per dayp99 of 6Every request body is larger than 8 KB
/api/* (other)9 million per dayp99 of 120Mobile app, cannot run Challenge or CAPTCHA

The web ACL's default action is Allow.

Plan (fill in or check each row):

PriorityRuleTrial actionExpected matches during the trialDecision before Block
10AWSManagedRulesCommonRuleSet with every rule overridden to Count through RuleActionOverridesCount (per rule)SizeRestrictions_BODY on essentially all 40,000 daily /api/upload requests (bodies over 8 KB); other rules near zero for real usersExclude /api/upload from the group with a scope-down statement, or keep SizeRestrictions_BODY in Count and add a label match rule for other paths
20AWSManagedRulesSQLiRuleSet, rules overridden to CountCount (per rule)Near zero from real usersInvestigate every match from a known client before promotion
30rate-login: rate-based, aggregate on IP, window 300 s, limit 100, scope-down POST and path starting /loginCountOrdinary users never match (p99 18 is far below 100); 198.51.100.20 matches whenever it exceeds 100: for one isolated 5-minute burst of 640 after a quiet period, about 540 counted requests (the ones beyond the limit); if it stays above 100 for longer, nearly all of its later requests are counted, because the rule keeps acting until the estimated rate falls below the limitFalse positive: add NOT (IP set containing 198.51.100.20) inside the scope-down, or a separate higher limit for that address

A fragment for row 30 follows. It shows the rule after the false-positive decision, with the PartnerNat exclusion added; during the trial described in the table the NotStatement is absent. It is one rule inside a web ACL, not a complete web ACL or a deployment command; PartnerNat is an IP set you would create.

json
{
  "Name": "rate-login",
  "Priority": 30,
  "Statement": {
    "RateBasedStatement": {
      "Limit": 100,
      "EvaluationWindowSec": 300,
      "AggregateKeyType": "IP",
      "ScopeDownStatement": {
        "AndStatement": {
          "Statements": [
            { "ByteMatchStatement": { "SearchString": "POST", "FieldToMatch": { "Method": {} },
                "TextTransformations": [{ "Priority": 0, "Type": "NONE" }], "PositionalConstraint": "EXACTLY" } },
            { "ByteMatchStatement": { "SearchString": "/login", "FieldToMatch": { "UriPath": {} },
                "TextTransformations": [{ "Priority": 0, "Type": "NONE" }], "PositionalConstraint": "STARTS_WITH" } },
            { "NotStatement": { "Statement": { "IPSetReferenceStatement": {
                "ARN": "arn:aws:wafv2:us-east-1:111122223333:global/ipset/PartnerNat/<id>" } } } }
          ]
        }
      }
    }
  },
  "Action": { "Count": {} },
  "VisibilityConfig": { "SampledRequestsEnabled": true, "CloudWatchMetricsEnabled": true, "MetricName": "rate-login" }
}

Tasks:

  1. Complete the plan: for each row write the evidence you will read (log field, metric or label), the trial length, and who decides.
  2. Explain why row 10 uses per-rule RuleActionOverrides and not the rule group return action override (section 5).
  3. Calculate the expected Count matches for rate-login with and without the PartnerNat exclusion, for one isolated burst and for a sustained peak, and state why the real number will differ (approximate counting, detection delay, limiting that continues briefly after the rate falls).
  4. Write a rollback trigger for each rule you promote to Block. It must contain a measurable threshold, a time window, an owner and the exact action. Example: "After rate-login moves to Block, if the /login success rate stays more than 2 percentage points below the 96% baseline for 10 consecutive minutes, or any request from the synthetic login check is blocked, the on-call engineer sets rate-login back to Count and records the change." Note that the rollback itself propagates over seconds to minutes and, for a rate-based rule, resets its counts.
  5. Decide what the mobile /api/* traffic gets instead of Challenge or CAPTCHA, and why.
  6. Decide whether the Anti-DDoS managed rule group belongs in the plan, and in what position relative to row 30.

Review criteria:

  • Every expected number is derived from the baseline table, with the arithmetic shown.
  • Each Block promotion has an evidence source that can see Count matches inside managed rule groups (logs or labels, not only sampled requests).
  • The plan changes one rule at a time and leaves time for propagation before judging the result.
  • Nothing in the plan exposes the origin, adds an internet-facing load balancer or admits a public CIDR.

11. Observing failure and recovery ​

This table is an exercise in which evidence confirms each diagnosis. If you later reproduce a scenario in an approved environment, collect exactly this evidence.

FailureExpected behaviorEvidenceWhat that evidence does not prove
A managed rule blocks legitimate uploads403 on /api/upload right after promotionWAF logs terminatingRuleId = the group, rule SizeRestrictions_BODY; CloudFront 403 rate upThat other rules in the group are safe
A rate limit was changed during an attackLimiting pauses for up to a minuteChange record; Count or Block metrics drop, then returnThat the new limit is right
Rollback from Block to CountSome locations still block for a short timeBlock metric declines over seconds to minutesThat every location has the new setting at a given instant
Direct requests to an exposed originOrigin overloaded while WAF metrics stay flatOrigin access logs show sources that are not CloudFront ENIsWhich path the attacker found (inventory from section 8)
L3/L4 flood on the distributionOrigin unaffectedOrigin metrics flat; Shield Advanced event if subscribedThat the application layer is safe
Anti-DDoS eventEvery request, legitimate or not, gets event-detectedLabel metricsThat a labelled request was malicious (only the suspicion labels say that)
Challenge applied to the mobile APIApp requests failWAF logs show the Challenge rule as the terminating rule for app traffic; app error rate risesThat the clients are bots

Recovery is a change, too. Each rollback is a web ACL update with the same propagation behavior as the change that caused the incident. Write the rollback command and its owner into the plan before the Block change, not during the incident.

12. Deliverables and completion criteria ​

DeliverableCompletion criteria
Threat mapEvery attack from section 2 placed on the path with its stopping control and owner
Shield decisionStandard only, or Advanced with the features you will use, their prerequisites (support plan, health checks) and cost
Rule planPriorities, trial actions, expected matches with arithmetic, false-positive decisions and per-rule rollback triggers
Origin path reviewCloaking confirmed for the reference path, the bypass inventory checked, and no internet-facing load balancer or public-CIDR ingress
Evidence planFor each rule, the log field or metric that proves it matched and its known blind spots

You are done when you can explain, with sources, which layer each attack targets and where it stops, how AWS WAF evaluates rules and actions, why count-mode testing uses per-rule overrides, what Shield Advanced adds over Standard, and why the origin must have no public path. Review the WAF placement in WAF, Edge and API Security, revisit the origin path in workbook 08, and take the quiz.

References ​

AWS WAF Developer Guide

AWS Shield (in the same guide)

Other AWS sources

Standards and other primary sources

Exam scope (used only to choose topics)

Ask the docs

Enter sends, Shift+Enter adds a line.