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
- 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.