]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add rule to check for http.response_body 1791/head
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 18 Apr 2024 12:57:46 +0000 (14:57 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 19 Apr 2024 18:51:23 +0000 (20:51 +0200)
Ticket: 6948

tests/rules/http_request_body/test.rules [new file with mode: 0644]
tests/rules/http_request_body/test.yaml [new file with mode: 0644]

diff --git a/tests/rules/http_request_body/test.rules b/tests/rules/http_request_body/test.rules
new file mode 100644 (file)
index 0000000..16e963b
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (http.response_body; content:"one"; sid:1;)
diff --git a/tests/rules/http_request_body/test.yaml b/tests/rules/http_request_body/test.yaml
new file mode 100644 (file)
index 0000000..95fbc00
--- /dev/null
@@ -0,0 +1,23 @@
+requires:
+    min-version: 8
+    pcap: false
+
+args:
+    - --engine-analysis
+
+checks:
+- filter:
+    filename: rules.json
+    count: 1
+    match:
+      id: 1
+      mpm.buffer: "file_data"
+      mpm.pattern: "one"
+      # checks that all engines are toclient
+      engines[0].name: "file_data"
+      engines[0].direction: "toclient"
+      engines[0].app_proto: "http2"
+      engines[1].name: "file_data"
+      engines[1].direction: "toclient"
+      engines[1].app_proto: "http"
+      engines.__len: 2