Skip to content

Commit

Permalink
tests: add rule type check for tcp-window
Browse files Browse the repository at this point in the history
Ticket: 6352
  • Loading branch information
Nancyenos committed Oct 25, 2024
1 parent 3c38988 commit 56a79c4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/rules/tcp_window/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert tcp any any -> any any (msg:"TCP window size"; window:30336; sid:1;)
alert tcp any any -> any any (msg:"TCP window size"; tcp.window:!1024; sid:2;)
25 changes: 25 additions & 0 deletions tests/rules/tcp_window/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
requires:
min-version: 8.0
pcap: false

args:
- --engine-analysis

checks:
- filter:
filename: rules.json
count: 1
match:
id: 1
lists.packet.matches[0].name: "tcp.window"
lists.packet.matches[0].window.size: 30336
lists.packet.matches[0].window.negated: false

- filter:
filename: rules.json
count: 1
match:
id: 2
lists.packet.matches[0].name: "tcp.window"
lists.packet.matches[0].window.size: 1024
lists.packet.matches[0].window.negated: true

0 comments on commit 56a79c4

Please sign in to comment.