]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
Adds test for http.request_header and http.response_header keywords 1638/head
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 9 Feb 2024 16:30:29 +0000 (17:30 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 10 Feb 2024 20:10:34 +0000 (21:10 +0100)
Ticket: 6736

tests/http-request-header/README.md [new file with mode: 0644]
tests/http-request-header/input.pcap [new file with mode: 0644]
tests/http-request-header/test.rules [new file with mode: 0644]
tests/http-request-header/test.yaml [new file with mode: 0644]

diff --git a/tests/http-request-header/README.md b/tests/http-request-header/README.md
new file mode 100644 (file)
index 0000000..8e3320e
--- /dev/null
@@ -0,0 +1,12 @@
+# Test Description
+
+Test `http.request_header` and `http.response_header` keyword
+
+## PCAP
+
+From https://redmine.openinfosecfoundation.org/issues/6736
+
+
+## Related issues
+
+https://redmine.openinfosecfoundation.org/issues/6736
diff --git a/tests/http-request-header/input.pcap b/tests/http-request-header/input.pcap
new file mode 100644 (file)
index 0000000..c84b2df
Binary files /dev/null and b/tests/http-request-header/input.pcap differ
diff --git a/tests/http-request-header/test.rules b/tests/http-request-header/test.rules
new file mode 100644 (file)
index 0000000..8c6d0ae
--- /dev/null
@@ -0,0 +1,4 @@
+alert http any any -> any any (msg:"request_header"; flow:established,to_server; http.request_header; content:"Connection|3a 20|"; classtype:bad-unknown; sid:1; rev:1;)
+alert http any any -> any any (msg:"response_header"; flow:established,to_client; http.response_header; content:"Connection|3a 20|"; classtype:bad-unknown; sid:2; rev:1;)
+alert http any any -> any any (msg:"request_header"; flow:established,to_server; http.request_header; content:"User-Agent|3a 20|"; classtype:bad-unknown; sid:3; rev:1;)
+alert http any any -> any any (msg:"response_header"; flow:established,to_client; http.response_header; content:"Date|3a 20|"; classtype:bad-unknown; sid:4; rev:1;)
diff --git a/tests/http-request-header/test.yaml b/tests/http-request-header/test.yaml
new file mode 100644 (file)
index 0000000..940e13e
--- /dev/null
@@ -0,0 +1,27 @@
+requires:
+  min-version: 7
+
+args:
+  - -k none
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 2
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 3
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 4