]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add tx_cnt tests 2452/head
authorEric Leblond <el@stamus-networks.com>
Mon, 31 Mar 2025 09:14:10 +0000 (11:14 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 18 Apr 2025 10:52:21 +0000 (12:52 +0200)
tests/flow-tx-cnt/README.md [new file with mode: 0644]
tests/flow-tx-cnt/test.rules [new file with mode: 0644]
tests/flow-tx-cnt/test.yaml [new file with mode: 0644]

diff --git a/tests/flow-tx-cnt/README.md b/tests/flow-tx-cnt/README.md
new file mode 100644 (file)
index 0000000..d3fae0c
--- /dev/null
@@ -0,0 +1,7 @@
+# Description
+
+Check presence and value of tx_id and tx_cnt in events.
+
+# PCAP
+
+The pcap contains smb traffic with a smb share to match on
diff --git a/tests/flow-tx-cnt/test.rules b/tests/flow-tx-cnt/test.rules
new file mode 100644 (file)
index 0000000..de762d4
--- /dev/null
@@ -0,0 +1,2 @@
+alert ssh $HOME_NET any -> any any (msg:"pcre without content and no match"; pcre:"/rabbit/"; sid:1; rev:1;)
+alert smb $HOME_NET any -> any any (msg:"smb share content with match"; smb.share; content:"C"; sid:2; rev:1;)
diff --git a/tests/flow-tx-cnt/test.yaml b/tests/flow-tx-cnt/test.yaml
new file mode 100644 (file)
index 0000000..d89aacc
--- /dev/null
@@ -0,0 +1,22 @@
+requires:
+  min-version: 8
+
+pcap: ../smb-filename/input.pcap
+
+checks:
+  - filter:
+      count: 29
+      match:
+        event_type: flow
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        src_port: 49455
+        flow.tx_cnt: 22
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        src_port: 49452
+        flow.tx_cnt: 43