Skip to content

Commit

Permalink
WIP tests: http rule hooks test
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Jan 28, 2025
1 parent 8e6c8ea commit c4a0dd8
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/rule-hooks/http-body-hook-01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PCAP
====

Pcap from https://redmine.openinfosecfoundation.org/issues/2369
Binary file added tests/rule-hooks/http-body-hook-01/input.pcap
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/rule-hooks/http-body-hook-01/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
alert http1:response_not_started any any -> any any (sid:1;)
alert http1:response_line any any -> any any (sid:2;)
alert http1:response_headers any any -> any any (sid:3;)
alert http1:response_body any any -> any any (sid:4;)
alert http1:response_trailer any any -> any any (sid:5;)
alert http1:response_complete any any -> any any (sid:6;)
39 changes: 39 additions & 0 deletions tests/rule-hooks/http-body-hook-01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
requires:
min-version: 8

checks:
- filter:
count: 1
match:
event_type: http
http.url: "/~regit/ids-suricata-esiea.pdf"
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1 # not started
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2 # request_line
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 3 # header
- filter:
count: 443
match:
event_type: alert
alert.signature_id: 4 # body update
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 5 # trailer
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 6 # complete

0 comments on commit c4a0dd8

Please sign in to comment.