0Pricing
AWS Security Academy · Lesson

Stateful Rule Groups and Suricata Rules

Define deep-inspection rules that match malicious patterns.

Stateful Rule Groups and Suricata Rules 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.

Rule Group Types

Network Firewall organizes rules into rule groups, which are either stateless or stateful. Stateless groups apply fast, connectionless packet rules; stateful groups track connection state and run deeper, signature-based inspection. A firewall policy references both kinds.

Stateless Rule Groups

Stateless rule groups evaluate each packet independently on basic attributes like source, destination, port, and protocol, then pass, drop, or forward to stateful inspection. They are fast and cheap, ideal for coarse filtering before the deeper stateful engine examines what remains.

Stateful Rule Groups

Stateful rule groups understand connections and can match on protocol behavior, domains, and threat signatures. They are where advanced detection lives, supporting three formats: 5-tuple rules, domain-list rules, and Suricata-compatible rules. This is the heart of Network Firewall intrusion prevention.

5-Tuple Rules

5-tuple stateful rules match on protocol, source and destination IP, and source and destination port, with a direction and action (pass, drop, alert). They resemble traditional firewall rules but run in the stateful engine, so they understand established connections.

Domain-List Rules

Domain-list rules allow or deny traffic based on the destination domain name, inspecting the SNI in TLS or the Host header in HTTP. This is the simplest way to build domain allow-lists or deny-lists for egress control without writing complex signatures.

# Domain allow-list (concept)
Allow HTTP/HTTPS to: .amazonaws.com, .example.com
Deny all other domains

Suricata-Compatible Rules

Network Firewall accepts open-source Suricata intrusion detection rule syntax, a widely used IDS/IPS standard. This lets you reuse community and commercial threat signatures to detect malware, exploits, and protocol anomalies, bringing mature IPS capability into your AWS VPC.

Pass, Drop, Alert, Reject

Stateful rule actions include pass (allow and stop further stateful evaluation), drop (silently discard), alert (log without blocking, like WAF count), and reject (drop and send a TCP reset). Alert mode is invaluable for testing signatures before enforcing them.

Rule Evaluation Order

You can set the stateful engine to evaluate rules by default action order or strict order. Strict order lets you control precedence precisely and set a default drop, which is essential for a deny-by-default egress policy where only explicitly permitted traffic passes.

Managed Threat Signatures

AWS offers managed rule groups for Network Firewall containing curated, regularly updated threat signatures (for example, against known malware command-and-control and botnets). Like WAF managed rules, they let you adopt expert-maintained protection without authoring every Suricata rule yourself.

Logging Alerts

Stateful rules that use the alert action write to the firewall alert log, showing exactly which signature matched and the traffic involved. Reviewing alert logs is how you validate new rules, investigate suspicious traffic, and tune away false positives before switching alerts to drops.

Building a Policy

A practical policy uses stateless rules for coarse pass/drop, a domain-list stateful group for egress allow-listing, and Suricata or managed signature groups for intrusion prevention, with strict order and a default drop. This layered rule design delivers both performance and depth.

Quick Check

Match the rule format to the need.

Recap

Network Firewall uses stateless (fast, per-packet) and stateful (connection-aware) rule groups. Stateful formats are 5-tuple, domain-list, and Suricata-compatible, with actions pass, drop, alert, and reject. Use strict rule order with a default drop for deny-by-default egress. AWS managed signature groups add curated threat detection, and alert logs let you test rules before enforcing them.

Frequently asked questions

Is the “Stateful Rule Groups and Suricata Rules” lesson free?

Yes — the full text of “Stateful Rule Groups and Suricata Rules” 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 “Stateful Rule Groups and Suricata Rules”?

Define deep-inspection rules that match malicious patterns. 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 “Stateful Rule Groups and Suricata Rules” 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. What AWS Network Firewall Provides
  2. Stateful Rule Groups and Suricata Rules
  3. Domain Filtering and Egress Control
  4. Securing the CloudFront Edge
← Back to AWS Security Academy