Skip to content

Commit

Permalink
rules/test: add app-layer-protocol negated test
Browse files Browse the repository at this point in the history
To complement bug-7241 tests.
  • Loading branch information
jufajardini committed Sep 16, 2024
1 parent a51c90b commit 32051f5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/rules/app-layer-protocol/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
drop tcp any any -> any any (flow:established; app-layer-protocol:!tls; sid:1;)
drop tcp any any -> any any (flow:established; app-layer-protocol:!tls; prefilter; sid:2;)
24 changes: 24 additions & 0 deletions tests/rules/app-layer-protocol/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
requires:
min-version: 7.0
pcap: false

args:
- --engine-analysis
- --simulate-ips

checks:
- filter:
filename: rules.json
count: 1
match:
id: 1
app_proto: "unknown"
not-has-key: "prefilter"
- filter:
filename: rules.json
count: 1
match:
id: 2
app_proto: "unknown"
prefilter.buffer: "packet"
prefilter.name: app-layer-protocol

0 comments on commit 32051f5

Please sign in to comment.