Skip to content

Commit

Permalink
test: adds test for header_lowercase transform
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Nov 19, 2023
1 parent 25d1b08 commit f337ab0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/transform-header-lowercase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Description

Test header_lowercase transform.
https://redmine.openinfosecfoundation.org/issues/6290

# PCAP

The pcap comes from test http2-range.
This pcap has both HTTP1 and HTTP2.
7 changes: 7 additions & 0 deletions tests/transform-header-lowercase/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
alert http any any -> any any (http.header; header_lowercase; content: "accept-ranges:";sid:1; )
alert http any any -> any any (http.header; content: "accept-ranges:";sid:2; )
alert http any any -> any any (http.header; content: "Accept-Ranges:";sid:3; )
alert http1 any any -> any any (http.header; content: "accept-ranges:";sid:4; )
alert http1 any any -> any any (http.header; content: "Accept-Ranges:";sid:5; )
alert http2 any any -> any any (http.header; content: "accept-ranges:";sid:6; )
alert http2 any any -> any any (http.header; content: "Accept-Ranges:";sid:7; )
40 changes: 40 additions & 0 deletions tests/transform-header-lowercase/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
requires:
min-version: 8.0.0

pcap: ../http2-range/http2-range.pcap

# disables checksum verification
args:
- -k none --set app-layer.protocols.http2.enabled=true

checks:
- filter:
count: 5
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 3
match:
event_type: alert
alert.signature_id: 2
- filter:
count: 2
match:
event_type: alert
alert.signature_id: 3
- filter:
count: 2
match:
event_type: alert
alert.signature_id: 5
- filter:
count: 3
match:
event_type: alert
alert.signature_id: 6
# we counted all alerts
- filter:
count: 15
match:
event_type: alert

0 comments on commit f337ab0

Please sign in to comment.