Skip to content

Commit

Permalink
Adds test for negated content and absent buffer
Browse files Browse the repository at this point in the history
Ticket: 2224
  • Loading branch information
catenacyber committed Nov 30, 2023
1 parent 4de2a8c commit 7892803
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/detect-negated-content-absent-buffer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Test rules with negated content on buffers that are absent

## PCAP

From the issue https://redmine.openinfosecfoundation.org/issues/2224

## Related issues

https://redmine.openinfosecfoundation.org/issues/2224
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/detect-negated-content-absent-buffer/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test to ensure it works without a negated content
# This signature should alert with _any_ pcap
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"TP test for URI"; flow:established,to_server; http.uri; bsize:1; content:"/"; sid:1;)

# Test to prove FN when Referer is not included
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"FN test for Referer"; flow:established,to_server; http.uri; bsize:1; content:"/"; http.referer; content:!"example"; sid:6;)
17 changes: 17 additions & 0 deletions tests/detect-negated-content-absent-buffer/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
requires:
min-version: 8

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: 6

0 comments on commit 7892803

Please sign in to comment.