AWS WAF and AWS Shield sit in front of most internet-facing AWS workloads, yet many deployments run managed rules in count mode for years, rate limits that never trigger, and a Shield Advanced subscription whose response team has no way into the account. AWS WAF inspects HTTP requests to CloudFront distributions, Application Load Balancers, API Gateway REST APIs and other resources against a web ACL; Shield adds network and transport layer DDoS protection and, with Shield Advanced, detection, response support and automatic application layer mitigation. This guide covers who should control web ACLs and Shield, the roles and service principals involved, logging and detection, and a hardening baseline with real rule group names, rate-based rule settings and Shield Advanced configuration. It is for cloud security and platform engineers running AWS edge protection. Vendor-neutral WAF concepts are in the Web Application Firewall Guide and attack-level DDoS planning is in the DDoS Protection Guide; this page stays on the AWS specifics, using the AWS WAF Developer Guide and the WAFV2 and Shield API references as checked in October 2026.
Key takeaways
- A web ACL is only as strong as its default action and rule order. Each web ACL has a default action (allow or block) for requests no rule matches, and rules run in priority order with Count, Allow, Block, CAPTCHA and Challenge actions. Review both, not just the list of rule groups.
- Managed rules are a baseline, not a finished policy. The Core rule set (AWSManagedRulesCommonRuleSet, 700 WCU) and Known bad inputs (AWSManagedRulesKnownBadInputsRuleSet, 200 WCU) cover common exploits, but body-inspecting rules stop at 8 KB on ALB and 16 KB by default on CloudFront and API Gateway.
- Rate-based rules need a realistic limit and the right key. The minimum limit is 10 requests per evaluation window of 60, 120, 300 or 600 seconds (300 by default), and WAF checks about every 10 seconds. Aggregating on the wrong IP behind a proxy rate limits your own CDN.
- Shield Advanced only helps if it is wired up. Protections must be created per resource, health checks associated for health-based detection, proactive engagement contacts set, and the Shield Response Team (SRT) role associated before an attack.
- Edge controls are identity controls too. Whoever can edit a web ACL can disable your perimeter, and the SRT role grants a third party write access to WAF. Treat both as privileged access with change control and alerting.
How identity and access work in AWS WAF and Shield
Both services are controlled by AWS IAM. Actions sit under the wafv2: and shield: prefixes, and resources are identified by ARNs for web ACLs, rule groups, IP sets and regex pattern sets. WAF has two scopes: REGIONAL for resources in a Region, and CLOUDFRONT for global resources, which must be managed through the US East (N. Virginia) endpoint (--scope=CLOUDFRONT --region=us-east-1). Policies that restrict WAF changes by Region must allow us-east-1 for CloudFront web ACLs, or administrators will be unable to change them.
| Resource WAF can protect | Scope | Default body inspection limit | Notes |
|---|---|---|---|
| CloudFront distribution (and Amplify) | CLOUDFRONT | 16 KB, configurable up to 64 KB | Blocks at the edge; Shield Advanced automatic application layer mitigation available |
| Application Load Balancer | REGIONAL | 8 KB fixed | Automatic application layer mitigation available; on-source DDoS protection mode |
| API Gateway REST API | REGIONAL | 16 KB, configurable | Combine with API Gateway throttling and authorisers |
| AppSync GraphQL API | REGIONAL | 8 KB fixed | Query depth and cost limits belong in AppSync, not WAF |
| Cognito user pool | REGIONAL | 16 KB, configurable | Useful with the ATP and ACFP fraud rule groups |
| App Runner, Verified Access, AgentCore Gateway | REGIONAL | 16 KB, configurable | Check service limits when you associate |
Raising the body inspection limit above 16 KB costs extra, so many teams leave it. That is a real gap: an attacker who pads a request body past the limit avoids body-inspecting rules, because the baseline rules use the Continue option for oversize content. Add an explicit size constraint rule that blocks oversized bodies on endpoints that never receive large payloads.
Admin roles and privileged access
Edge controls are a high-value target for an attacker who already has some access: switching a web ACL's default action to allow, setting a rule group override to count, or disassociating a web ACL removes protection without touching the application. Separate the duties.
| Role | Typical permissions | Guardrail |
|---|---|---|
| Edge security administrator | wafv2:* on web ACLs and rule groups, shield:* | Small named group via IAM Identity Center; MFA; changes through pipeline where possible |
| Application team | Read web ACLs; update IP sets or a team-owned rule group | No wafv2:DisassociateWebACL, no changes to managed rule group overrides |
| SOC analyst | wafv2:Get*, wafv2:List*, sampled requests, log access | Read only; emergency IP set updates through a documented runbook |
| Firewall Manager administrator | Organisation-wide WAF and Shield policies | Delegated administrator account, not the management account |
| Shield Response Team | Role trusted by drt.shield.amazonaws.com with AWSShieldDRTAccessPolicy | Associated before attacks; usage visible in CloudTrail |
- Use Firewall Manager for estates with many accounts: a Firewall Manager WAF policy places pre-process and post-process rule groups in every web ACL it manages, and account teams cannot alter them. Web ACLs and logging configurations created by Firewall Manager can only be changed by Firewall Manager. See the AWS Organizations and SCPs Guide.
- Deny the dangerous calls by SCP: restrict
wafv2:DeleteWebACL,wafv2:DisassociateWebACL,wafv2:DeleteLoggingConfiguration,shield:DeleteProtectionandshield:DeleteSubscriptionto the edge security role. - Version pinning is a privileged decision: a managed rule group without a fixed
Versionfollows the vendor's default version as it changes. Pinning gives change control but means you can fall behind on new protections, such as new Known bad inputs rules for recent remote code execution CVEs.
Integrations, API tokens and service accounts
- Shield Response Team access:
AssociateDRTRolelets the SRT inspect your WAF configuration and create or update WAF rules and web ACLs during an attack. Only one role ARN can be associated per subscription, it must carryAWSShieldDRTAccessPolicy, and it must trustdrt.shield.amazonaws.com. If the SRT needs to read logs in S3,AssociateDRTLogBucketgrants access to named buckets. Review these as you would any third-party access. - Logging service roles: when you enable logging with
PutLoggingConfiguration, WAF creates the role or resource policy it needs to write to the destination. Destinations are a CloudWatch Logs log group, an S3 bucket or a Kinesis Data Firehose stream, and the name must start withaws-waf-logs-. One destination is allowed per web ACL. - Automation identities: pipelines that update IP sets from threat intelligence, or deploy web ACLs with CloudFormation or Terraform, need narrow permissions on the specific IP set or web ACL ARNs. A pipeline role with
wafv2:*is a perimeter bypass waiting to happen. See the AWS IAM Policies and Roles Guide. - Tokens issued by WAF: CAPTCHA and Challenge actions issue a token to the client;
TokenDomainslets one token work across several protected domains. Keep that list to domains you control, because a token accepted across domains widens the effect of a solved challenge. - Fraud rule groups and credentials: the account takeover prevention group (AWSManagedRulesATPRuleSet) needs your login path and username and password fields; the account creation fraud group (AWSManagedRulesACFPRuleSet) needs registration paths. Use data protection or
RedactedFieldsso that passwords submitted to those pages do not land in WAF logs.
Logging and detection
Enable logging on every web ACL and send it to a central account. Use LoggingFilter to drop high-volume allowed traffic if cost is an issue, but keep all Block, CAPTCHA, Challenge and Count records, because count-mode matches are how you tune and how you spot probing. Each web ACL also publishes CloudWatch metrics through its VisibilityConfig and keeps sampled requests. For the log pipeline, see the Cloud Logging and Audit Trail Guide.
| Threat | MITRE ATT&CK | AWS control | What to alert on |
|---|---|---|---|
| Exploit of a public-facing application | T1190 Exploit Public-Facing Application | Core rule set, Known bad inputs, SQL database, OS and application rule groups | Block spikes on one rule label; Count matches on a rule you plan to enforce |
| Credential stuffing | T1110.004 Credential Stuffing | ATP rule group; rate-based rule scoped to the login path | Failed-login labels from ATP; rate rule triggers on /login |
| Scanning and reconnaissance | T1595 Active Scanning | Amazon IP reputation list, Anonymous IP list, Bot Control | New source ASNs with many 403s; admin path probes caught by Admin protection |
| HTTP floods | T1499.002 Service Exhaustion Flood, T1499.003 Application Exhaustion Flood | Rate-based rules, anti-DDoS rule group (AWSManagedRulesAntiDDoSRuleSet), Shield Advanced automatic mitigation | Shield detection events; request rate per distribution |
| Volumetric network attacks | T1498 Network Denial of Service | Shield Standard and Shield Advanced on CloudFront, Route 53, Global Accelerator, Elastic IPs | Shield Advanced attack notifications |
| Perimeter tampering | T1685 Disable or Modify Tools | CloudTrail on wafv2 and shield APIs | UpdateWebACL changing default action or overrides; DisassociateWebACL; DeleteLoggingConfiguration |
CloudTrail records WAF and Shield management API calls. The most useful configuration detections are a web ACL default action changed to allow, a managed rule group's override action changed to count, a rule action override on a specific rule, a web ACL disassociated from a production resource, logging deleted, and a Shield protection deleted. Feed these into AWS Config or Security Hub checks as well; see the AWS CloudTrail Guide and the AWS Security Hub Guide.
Measure whether it is working:
- Coverage: share of internet-facing CloudFront, ALB and API Gateway resources with a web ACL and logging enabled (target 100%).
- Enforcement: share of managed rule groups in block rather than count, and age of any rule still in count.
- Shield readiness: share of critical resources with a Shield Advanced protection, a health check and automatic application layer mitigation where supported.
- False positives: legitimate requests blocked per week, from support tickets matched to log labels.
- Response: time from attack detection to mitigation, from Shield events and the incident record.
Hardening baseline
Web ACL rules
| Rule or group | Name | Purpose and setting |
|---|---|---|
| IP reputation | AWSManagedRulesAmazonIpReputationList | First in order, blocks sources AWS threat intelligence marks as malicious |
| Anonymous IP list | AWSManagedRulesAnonymousIpList | Count first; block on login and admin paths if users do not need VPNs or hosting providers |
| Core rule set | AWSManagedRulesCommonRuleSet (700 WCU) | Size, XSS, LFI, RFI and EC2 metadata SSRF rules; override SizeRestrictions_BODY to count only on upload endpoints, not globally |
| Known bad inputs | AWSManagedRulesKnownBadInputsRuleSet (200 WCU) | Log4j and Java deserialisation patterns, ExploitablePaths_URIPATH; enforce everywhere |
| Admin protection | AWSManagedRulesAdminProtectionRuleSet (100 WCU) | Blocks administrative URI paths on public listeners |
| Use-case groups | SQL database, Linux, POSIX, Windows, PHP, WordPress groups | Add only those that match the stack, to save WCU and reduce false positives |
| Bot Control | AWSManagedRulesBotControlRuleSet | Common level for visibility; targeted level (with optional machine learning) on high-value paths, scoped down to control cost |
| Rate-based rules | RateBasedStatement | One broad per-IP rule, plus tighter rules scoped to login, search and expensive API paths |
Rate-based rule settings
- Limit and window: minimum limit 10; windows 60, 120, 300 (default) or 600 seconds. Changing a rule in use resets its counts and can pause rate limiting for up to a minute, so do not tune during an attack unless you must.
- Aggregation key:
IP,FORWARDED_IP,CONSTANTorCUSTOM_KEYS. Custom keys include header, cookie, query argument, query string, HTTP method, label namespace, URI path, JA3 and JA4 fingerprints and ASN; each custom key adds 30 WCU. - Forwarded IP: only use
ForwardedIPConfigwhen a trusted proxy sets the header; if the header is missing, WAF does not apply the rule at all, and a client-supplied X-Forwarded-For is trivially spoofed. - Scope-down: use a scope-down statement to apply a tight limit only to paths such as
/loginor/api/.
Shield
- Rely on Shield Standard as the floor. It applies automatically to AWS customers at no additional charge and covers common network and transport layer attacks on AWS edge services; it does not add response support or application layer mitigation.
- Subscribe to Shield Advanced where downtime is costly. In an AWS Organization the subscription is billed to the payer account. Create a protection for each CloudFront distribution, Route 53 hosted zone, Global Accelerator, Elastic IP (for EC2 and Network Load Balancers), ALB or Classic Load Balancer that matters.
- Add health-based detection. Define Route 53 health checks and associate them with each protection, which improves detection accuracy and responsiveness.
- Group related resources. Protection groups let Shield treat resources as a collective, which improves detection and reduces false positives.
- Enable automatic application layer mitigation on CloudFront and ALB protections. Shield creates, verifies and applies rules in a Shield rule group inside the associated web ACL; start in count mode and move to block after a review period.
- Prepare the response path. Associate the SRT role, set proactive engagement contacts (at least one phone number), and enable proactive engagement. Rehearse with the DDoS Response Playbook.
- Close the origin. Restrict ALB and origin security groups to CloudFront, and make sure origins cannot be reached directly; WAF on CloudFront is bypassed if the origin is public.
Rollout and rollback
- Deploy new rule groups with override action count, and new custom rules with action Count.
- Review two to four weeks of logs by rule label; add scope-down statements or rule action overrides for genuine false positives.
- Switch to block one rule group at a time, starting with Known bad inputs and IP reputation.
- Roll back by setting the rule group's override back to count, or by removing a single rule action override; keep the previous web ACL definition in source control for full rollback.
Framework mapping
| Capability | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | CIS Controls v8.1 | ISO/IEC 27001:2022 Annex A |
|---|---|---|---|---|
| Web ACLs and managed rules | SC-7, SI-4 | PR.IR-01 | Control 13 Network Monitoring and Defense | A.8.20 Networks security, A.8.23 Web filtering |
| Rate limits and Shield | SC-5 | PR.IR-04 | Control 13 | A.8.6 Capacity management |
| WAF logs and CloudTrail | AU-2, AU-6 | DE.CM-01, PR.PS-04 | Control 8 Audit Log Management | A.8.15 Logging, A.8.16 Monitoring activities |
| Admin separation and SRT role | AC-6, AC-2 | PR.AA-05 | Control 6 Access Control Management | A.8.2 Privileged access rights |
Common misconfigurations
- Managed rules left in count: a deployment that never moved past tuning gives logs but no protection. Track the age of every count-mode rule.
- Rate limiting the CDN: a per-IP rate rule on an ALB behind CloudFront without forwarded IP handling sees CloudFront edge addresses, not clients. Put the rule on the CloudFront web ACL, or use a trusted forwarded IP header.
- Origin reachable directly: attackers who find the ALB or EC2 address skip WAF entirely. Restrict origins to CloudFront.
- Oversized bodies uninspected: at the 8 KB ALB limit, a padded body slips past body rules. Add a size constraint block where large bodies are not expected.
- WAF treated as the only SSRF control: the Core rule set's EC2 metadata SSRF rules help, but the server-side flaw and the role's permissions remain. In the Capital One Breach 2019, a misconfigured firewall was the route to cloud role credentials; enforce IMDSv2 and least-privilege instance roles alongside WAF.
- Shield Advanced bought, not configured: no health checks, no SRT role and no contacts means slower detection and a response team that cannot help. Check readiness quarterly.
Practitioner checklist
- Inventory every internet-facing CloudFront, ALB, API Gateway, AppSync and Cognito resource and confirm a web ACL is associated.
- Enable WAF logging to an
aws-waf-logs-destination in a central account, with sensitive fields redacted. - Apply IP reputation, Core rule set and Known bad inputs, then the use-case groups that match your stack; move each to block after a count period.
- Add a broad per-IP rate rule and scoped rules for login and expensive paths; test limits against real traffic peaks.
- Restrict web ACL deletion, disassociation and logging changes to the edge security role by SCP, and alert on them in CloudTrail.
- Use Firewall Manager policies where you have many accounts, from a delegated administrator account.
- For Shield Advanced, create protections, health checks, protection groups and automatic application layer mitigation, and associate the SRT role and contacts.
- Lock origins to CloudFront and enforce IMDSv2 on instances behind ALBs.
- Review metrics monthly: coverage, count-mode age, false positives and attack mitigation time.
Standards and references
- AWS: Baseline Managed Rule Groups
- AWS: AWS Managed Rules Rule Groups List
- AWS: Rate-Based Rule Statement
- AWS: WAFV2 API Model (botocore)
- AWS: Shield Advanced API Model (botocore)
- MITRE ATT&CK: Endpoint Denial of Service
- MITRE ATT&CK: Exploit Public-Facing Application
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Web Application Firewall Guide · DDoS Protection Guide · Bot Management Guide · AWS Security Guide