]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add dsize option signature tests
authorjason taylor <jtfas90@gmail.com>
Wed, 24 Aug 2022 15:48:38 +0000 (15:48 +0000)
committerVictor Julien <victor@inliniac.net>
Tue, 13 Sep 2022 09:42:14 +0000 (11:42 +0200)
Signed-off-by: jason taylor <jtfas90@gmail.com>
tests/test-dsize-values/README.md [new file with mode: 0644]
tests/test-dsize-values/input.pcap [new file with mode: 0644]
tests/test-dsize-values/test.rules [new file with mode: 0644]
tests/test-dsize-values/test.yaml [new file with mode: 0644]

diff --git a/tests/test-dsize-values/README.md b/tests/test-dsize-values/README.md
new file mode 100644 (file)
index 0000000..32b1a97
--- /dev/null
@@ -0,0 +1,10 @@
+# Description
+
+Test dsize keyword values against pcap.
+
+This test case has signatures with all the current possible
+dsize value options, all signatures should alert.
+
+# PCAP
+
+The pcap is a flowsynth generated pcap.
diff --git a/tests/test-dsize-values/input.pcap b/tests/test-dsize-values/input.pcap
new file mode 100644 (file)
index 0000000..8586780
Binary files /dev/null and b/tests/test-dsize-values/input.pcap differ
diff --git a/tests/test-dsize-values/test.rules b/tests/test-dsize-values/test.rules
new file mode 100644 (file)
index 0000000..0ba01e3
--- /dev/null
@@ -0,0 +1,13 @@
+alert tcp any any -> any any (msg:"dsize exact size"; dsize:10; sid:1; rev:1;)
+
+alert tcp any any -> any any (msg:"dsize less than value"; dsize:<10; sid:2; rev:1;)
+
+alert tcp any any -> any any (msg:"dsize less than or equal value"; dsize:<=10; sid:3; rev:1;)
+
+alert tcp any any -> any any (msg:"dsize greater than value"; dsize:>8; sid:4; rev:1;)
+
+alert tcp any any -> any any (msg:"dsize greater than or equal value"; dsize:>=10; sid:5; rev:1;)
+
+alert tcp any any -> any any (msg:"dsize range value"; dsize:8<>20; sid:6; rev:1;)
+
+alert tcp any any -> any any (msg:"dsize not equal value"; dsize:!9; sid:7; rev:1;)
diff --git a/tests/test-dsize-values/test.yaml b/tests/test-dsize-values/test.yaml
new file mode 100644 (file)
index 0000000..16c37ab
--- /dev/null
@@ -0,0 +1,35 @@
+args:
+- -k none
+
+requires:
+   min-version: 7.0.0
+
+checks:
+- filter:
+    count: 4
+    match:
+      alert.signature: dsize less than value
+- filter:
+    count: 5
+    match:
+      alert.signature: dsize less than or equal value
+- filter:
+    count: 1
+    match:
+      alert.signature: dsize exact size
+- filter:
+    count: 1
+    match:
+      alert.signature: dsize greater than value
+- filter:
+    count: 1
+    match:
+      alert.signature: dsize greater than or equal value
+- filter:
+    count: 1
+    match:
+      alert.signature: dsize range value
+- filter:
+    count: 1
+    match:
+      alert.signature: dsize not equal value