]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add test for issue 4220
authorVictor Julien <victor@inliniac.net>
Wed, 21 Jan 2026 12:34:12 +0000 (13:34 +0100)
committerVictor Julien <vjulien@oisf.net>
Wed, 28 Jan 2026 20:21:02 +0000 (20:21 +0000)
Not showing a problem, behavior is as expected.

tests/issue-4220-01-ids/1flowB.pcap [new file with mode: 0644]
tests/issue-4220-01-ids/README.md [new file with mode: 0644]
tests/issue-4220-01-ids/suricata.rules [new file with mode: 0644]
tests/issue-4220-01-ids/test.yaml [new file with mode: 0644]
tests/issue-4220-02-ips/README.md [new file with mode: 0644]
tests/issue-4220-02-ips/suricata.rules [new file with mode: 0644]
tests/issue-4220-02-ips/test.yaml [new file with mode: 0644]

diff --git a/tests/issue-4220-01-ids/1flowB.pcap b/tests/issue-4220-01-ids/1flowB.pcap
new file mode 100644 (file)
index 0000000..4dc5584
Binary files /dev/null and b/tests/issue-4220-01-ids/1flowB.pcap differ
diff --git a/tests/issue-4220-01-ids/README.md b/tests/issue-4220-01-ids/README.md
new file mode 100644 (file)
index 0000000..a34df14
--- /dev/null
@@ -0,0 +1,3 @@
+Show that a broken TCP session is still correctly processed in the more liberal IDS mode.
+
+https://redmine.openinfosecfoundation.org/issues/4220
diff --git a/tests/issue-4220-01-ids/suricata.rules b/tests/issue-4220-01-ids/suricata.rules
new file mode 100644 (file)
index 0000000..7e50111
--- /dev/null
@@ -0,0 +1 @@
+alert smtp any any -> $SMTP_SERVERS any (msg:"inline-test"; flow:established; content:"|0D 0A 0D 0A|TV"; content:"AAAAAAAAAAAAAAAA"; within:200; classtype:bad-unknown; sid:1000009; rev:1;)
diff --git a/tests/issue-4220-01-ids/test.yaml b/tests/issue-4220-01-ids/test.yaml
new file mode 100644 (file)
index 0000000..802fac3
--- /dev/null
@@ -0,0 +1,11 @@
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1000009
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        app_proto: smtp
diff --git a/tests/issue-4220-02-ips/README.md b/tests/issue-4220-02-ips/README.md
new file mode 100644 (file)
index 0000000..87ef8a6
--- /dev/null
@@ -0,0 +1,3 @@
+Show that a broken TCP session is correctly dropped.
+
+https://redmine.openinfosecfoundation.org/issues/4220
diff --git a/tests/issue-4220-02-ips/suricata.rules b/tests/issue-4220-02-ips/suricata.rules
new file mode 100644 (file)
index 0000000..7e50111
--- /dev/null
@@ -0,0 +1 @@
+alert smtp any any -> $SMTP_SERVERS any (msg:"inline-test"; flow:established; content:"|0D 0A 0D 0A|TV"; content:"AAAAAAAAAAAAAAAA"; within:200; classtype:bad-unknown; sid:1000009; rev:1;)
diff --git a/tests/issue-4220-02-ips/test.yaml b/tests/issue-4220-02-ips/test.yaml
new file mode 100644 (file)
index 0000000..124d0be
--- /dev/null
@@ -0,0 +1,16 @@
+pcap: ../issue-4220-01-ids/1flowB.pcap
+
+checks:
+  - filter:
+      count: 0
+      match:
+        event_type: alert
+        alert.signature_id: 1000009
+  - filter:
+      count: 1
+      match:
+        stats.ips.accepted: 3
+        stats.ips.blocked: 1355
+        stats.ips.drop_reason.stream_error: 1355
+        stats.flow.end.tcp_state.syn_recv: 1
+        stats.flow.end.state.new: 1