]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: improve frame gap tests
authorVictor Julien <victor@inliniac.net>
Fri, 27 Jan 2023 13:38:30 +0000 (14:38 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 27 Jan 2023 17:14:58 +0000 (18:14 +0100)
Add detection.

tests/http-gap-simple-frames/test.rules [new file with mode: 0644]
tests/http-gap-simple-frames/test.yaml

diff --git a/tests/http-gap-simple-frames/test.rules b/tests/http-gap-simple-frames/test.rules
new file mode 100644 (file)
index 0000000..ea6c01d
--- /dev/null
@@ -0,0 +1,5 @@
+alert http any any -> any any (frame:http1.response; content:"|0d 0a|AAA"; sid:1;)
+alert http any any -> any any (frame:http1.response; content:"AAA"; endswith; sid:2;)
+alert http any any -> any any (frame:http1.stream; content:"AAA"; sid:3;)
+# shouldn't match
+alert http any any -> any any (frame:http1.response; content:"|0d 0a|AAA"; endswith; sid:4;)
index 78bcdcf1dbe37e227f839fed24c032f982be8de0..c13ac1340e918c77927e838015464256d00a030c 100644 (file)
@@ -42,7 +42,26 @@ checks:
         fileinfo.size: 70
         fileinfo.state: "TRUNCATED"
         fileinfo.gaps: true
-
+  - 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: 0
+      match:
+        event_type: alert
+        alert.signature_id: 4
   - filter:
       count: 1
       match: