]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add http.host capitalization test
authorjason taylor <jtfas90@gmail.com>
Tue, 14 Jun 2022 21:13:02 +0000 (21:13 +0000)
committerVictor Julien <victor@inliniac.net>
Thu, 18 Aug 2022 11:56:34 +0000 (13:56 +0200)
Signed-off-by: jason taylor <jtfas90@gmail.com>
tests/test-bad-http-host-rule-1/suricata.yaml [new file with mode: 0644]
tests/test-bad-http-host-rule-1/test.rules [new file with mode: 0644]
tests/test-bad-http-host-rule-1/test.yaml [new file with mode: 0644]

diff --git a/tests/test-bad-http-host-rule-1/suricata.yaml b/tests/test-bad-http-host-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-http-host-rule-1/test.rules b/tests/test-bad-http-host-rule-1/test.rules
new file mode 100644 (file)
index 0000000..4a5ac69
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (msg:"TEST SUCCESFULL - http host capitalizaed "; http.host; content:"ALLCAPS.COM"; sid:1111; rev:1;)
diff --git a/tests/test-bad-http-host-rule-1/test.yaml b/tests/test-bad-http-host-rule-1/test.yaml
new file mode 100644 (file)
index 0000000..49b0ab5
--- /dev/null
@@ -0,0 +1,17 @@
+requires:
+  min-version: 7.0.0
+
+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: "rule 1111: A pattern with uppercase chararacters detected for http.host. The hostname buffer is normalized to lowercase, please specify a lowercase pattern."
+
+  - filter:
+      count: 1
+      match:
+        event_type: engine
+        engine.error: "SC_ERR_NO_RULES_LOADED"