]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
detect: adds test with bsize:0
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 27 Apr 2023 09:52:07 +0000 (11:52 +0200)
committerJason Ish <jason.ish@oisf.net>
Fri, 12 May 2023 17:23:45 +0000 (11:23 -0600)
tests/detect-bsize-0/README.md [new file with mode: 0644]
tests/detect-bsize-0/input.pcap [new file with mode: 0644]
tests/detect-bsize-0/test.rules [new file with mode: 0644]
tests/detect-bsize-0/test.yaml [new file with mode: 0644]

diff --git a/tests/detect-bsize-0/README.md b/tests/detect-bsize-0/README.md
new file mode 100644 (file)
index 0000000..7274ec9
--- /dev/null
@@ -0,0 +1,9 @@
+# Description
+
+Test `bsize` keyword with 0 value
+cf https://redmine.openinfosecfoundation.org/issues/6025
+
+# PCAP
+
+Pcap crafted with dummy HTTP server anc nc client to have an empty user-agent
+
diff --git a/tests/detect-bsize-0/input.pcap b/tests/detect-bsize-0/input.pcap
new file mode 100644 (file)
index 0000000..b8cfce0
Binary files /dev/null and b/tests/detect-bsize-0/input.pcap differ
diff --git a/tests/detect-bsize-0/test.rules b/tests/detect-bsize-0/test.rules
new file mode 100644 (file)
index 0000000..5f76041
--- /dev/null
@@ -0,0 +1,2 @@
+alert http any any -> any any (http.user_agent; bsize: 0; sid:46;)
+alert http any any -> any any (http.user_agent; content: !"u"; sid:47;)
diff --git a/tests/detect-bsize-0/test.yaml b/tests/detect-bsize-0/test.yaml
new file mode 100644 (file)
index 0000000..25de3e1
--- /dev/null
@@ -0,0 +1,17 @@
+requires:
+    min-version: 7
+
+args:
+ - -k none
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 46
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 47