]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
Adds a test about flow.pkts_toclient keyword
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 20 Jun 2023 13:56:19 +0000 (15:56 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Nov 2023 20:36:29 +0000 (21:36 +0100)
And the similar keywords about packets and bytes of a flow

tests/detect-flow-pkts/README.md [new file with mode: 0644]
tests/detect-flow-pkts/test.rules [new file with mode: 0644]
tests/detect-flow-pkts/test.yaml [new file with mode: 0644]

diff --git a/tests/detect-flow-pkts/README.md b/tests/detect-flow-pkts/README.md
new file mode 100644 (file)
index 0000000..6691a2c
--- /dev/null
@@ -0,0 +1,10 @@
+Test
+====
+
+Test `flow.pkts_toclient` and alike (bytes, server) keywords
+
+PCAP
+====
+
+Pcap found in the Bro github https://github.com/bro/bro/blob/master/testing/btest/Traces/tunnels/Teredo.pcap
+
diff --git a/tests/detect-flow-pkts/test.rules b/tests/detect-flow-pkts/test.rules
new file mode 100644 (file)
index 0000000..d808c07
--- /dev/null
@@ -0,0 +1 @@
+alert ip any any -> any any (msg:"Flow has 10 packets"; flow.pkts_toclient:10; flow.pkts_toserver:10; flow.bytes_toserver:<3000; flow.bytes_toclient:>8000; sid:1;)
diff --git a/tests/detect-flow-pkts/test.yaml b/tests/detect-flow-pkts/test.yaml
new file mode 100644 (file)
index 0000000..6e2df08
--- /dev/null
@@ -0,0 +1,14 @@
+requires:
+  min-version: 7
+
+pcap: ../decode-teredo-01/input.pcap
+
+args:
+- -k none
+
+checks:
+- filter:
+    count: 1
+    match:
+      event_type: alert
+      alert.signature_id: 1