]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add invalid content and dsize usage
authorjason taylor <jtfas90@gmail.com>
Wed, 15 May 2019 16:07:54 +0000 (12:07 -0400)
committerVictor Julien <victor@inliniac.net>
Fri, 17 May 2019 18:14:11 +0000 (20:14 +0200)
Signed-off-by: jason taylor <jtfas90@gmail.com>
tests/test-bad-content-dsize-rule-1/suricata.yaml [new file with mode: 0644]
tests/test-bad-content-dsize-rule-1/test.rules [new file with mode: 0644]
tests/test-bad-content-dsize-rule-1/test.yaml [new file with mode: 0644]

diff --git a/tests/test-bad-content-dsize-rule-1/suricata.yaml b/tests/test-bad-content-dsize-rule-1/suricata.yaml
new file mode 100644 (file)
index 0000000..dcaae57
--- /dev/null
@@ -0,0 +1,10 @@
+%YAML 1.1
+---
+
+logging:
+  default-log-level: info
+  outputs:
+  - file:
+      enabled: yes
+      filename: eve.json
+      type: json
diff --git a/tests/test-bad-content-dsize-rule-1/test.rules b/tests/test-bad-content-dsize-rule-1/test.rules
new file mode 100644 (file)
index 0000000..8dcb56e
--- /dev/null
@@ -0,0 +1 @@
+alert udp any any -> any any (msg:"TEST SUCCESFULL - Content Greater than Dsize INVALID combination "; dsize:10; content:"thisstringisgreaterthan10bytes"; sid:6666662; rev:1;)
diff --git a/tests/test-bad-content-dsize-rule-1/test.yaml b/tests/test-bad-content-dsize-rule-1/test.yaml
new file mode 100644 (file)
index 0000000..fd1fe58
--- /dev/null
@@ -0,0 +1,21 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+
+command: |
+  ${SRCDIR}/src/suricata --set classification-file="${SRCDIR}/classification.config" --set reference-config-file="${SRCDIR}/reference.config" -l ${OUTPUT_DIR} -c ${TEST_DIR}/suricata.yaml -r ${TEST_DIR}/ -S ${TEST_DIR}/test.rules
+
+checks:
+  # check that we have the following entres in eve.json
+  # match 1 specific rule load failure reason
+  - filter:
+      count: 1
+      match:
+        event_type: engine
+        engine.message: "signature can't match as content length 30 is bigger than dsize 10"
+
+  - filter:
+      count: 1
+      match:
+        event_type: engine
+        engine.error: "SC_ERR_NO_RULES_LOADED"