0Pricing
AWS Security Academy · Lesson

Rules, Rule Groups, and Web ACLs

Learn how matching rules combine into a deployable policy.

Rules, Rule Groups, and Web ACLs is a free AWS Security Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Building Blocks

AWS WAF organizes protection into three layers: rules, rule groups, and a web ACL. A rule is a single condition and action; a rule group bundles related rules; a web ACL is the deployable container that you attach to a resource and that ties everything together.

What a Rule Is

A rule combines a match statement (such as a string match on the URI) with an action (allow, block, count, CAPTCHA). Rules can also combine statements with AND, OR, and NOT logic, letting you express conditions like block this path unless the request comes from a trusted IP set.

Rule Groups

A rule group is a reusable collection of rules you can attach to multiple web ACLs. Groups can be AWS managed, sold by vendors in the Marketplace, or customer managed. Reuse keeps policy consistent across many applications without duplicating individual rules.

The Web ACL

A web ACL (access control list) is the top-level object you associate with a CloudFront distribution, ALB, or API Gateway. It contains an ordered list of rules and rule groups plus a default action. Only resources linked to a web ACL are actually protected by WAF.

Priority and Order

Rules in a web ACL are evaluated in priority order, lowest number first. The first rule whose action terminates evaluation (block or allow) wins. Count actions do not terminate, so evaluation continues. Getting priority right is critical: a broad block early can shadow more specific rules.

# Web ACL evaluation
Priority 0: IP allow-list  -> Allow (terminates)
Priority 1: AWS managed SQLi -> Block
Priority 2: Rate limit       -> Block

Web ACL Capacity Units

If no rule reaches a terminating action, the web ACL applies its default action (allow or block). Each web ACL also has a complexity budget measured in WCUs (WAF Capacity Units), default maximum 1,500. Complex rules and large rule groups consume more WCUs; exceeding the budget means simplifying rules or requesting an increase, so plan capacity when combining many managed groups.

Scope Matters

A web ACL has a scope: CLOUDFRONT (global, created in us-east-1) or REGIONAL (for ALB, API Gateway, AppSync in a specific Region). A regional web ACL cannot protect CloudFront, so you must create the web ACL in the correct scope from the start.

Labels for Coordination

Rules can add labels to a request that later rules inspect. A managed rule group might label a request as a likely bot, and your custom rule can then decide whether to block or challenge it. Labels let managed and custom logic cooperate without duplicating detection.

Overriding Managed Rules

Within a managed rule group you can override individual rules to count instead of block, or exclude them entirely. This is how you tune a managed group that causes false positives without abandoning the whole group, preserving the rest of its protection.

Versioning and Reuse

Managed rule groups are versioned by AWS so updates do not silently change behavior. You can pin a version or follow the latest. Customer-managed rule groups let your security team centralize policy and share it across application teams as a single maintained unit.

Putting It Together

A typical web ACL chains an IP allow-list, one or two AWS managed groups (core rule set, known bad inputs), a rate-based rule, and a few custom rules, ending in a default allow. Understanding how these layers and priorities interact is core to deploying WAF effectively.

Quick Check

Test your grasp of WAF structure.

Recap

WAF nests rules inside rule groups inside a web ACL that you attach to a resource. Rules combine match statements and actions; rule groups are reusable and can be AWS managed, Marketplace, or custom. Web ACLs evaluate rules in priority order with a default action, are bounded by WCUs, and have a CLOUDFRONT or REGIONAL scope. Labels and per-rule overrides let managed and custom logic cooperate.

Frequently asked questions

Is the “Rules, Rule Groups, and Web ACLs” lesson free?

Yes — the full text of “Rules, Rule Groups, and Web ACLs” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “Rules, Rule Groups, and Web ACLs”?

Learn how matching rules combine into a deployable policy. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS Security Academy?

No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Rules, Rule Groups, and Web ACLs” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS Security Academy lesson?

Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. How AWS WAF Inspects Requests
  2. Rules, Rule Groups, and Web ACLs
  3. Managed Rules and Rate Limiting
  4. Attaching WAF to CloudFront and ALB
← Back to AWS Security Academy