Skip to content

Commit

Permalink
flow/pkts: add rules w new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
inashivb committed Dec 3, 2024
1 parent 5fe298c commit a1e0152
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/detect-flow-pkts/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test
====

Test `flow.pkts_toclient` and alike (bytes, server) keywords
Test `flow.pkts:toclient`.. and alike (bytes, server) keywords

PCAP
====
Expand Down
3 changes: 2 additions & 1 deletion tests/detect-flow-pkts/test.rules
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
alert ip any any -> any any (msg:"Flow has 10 packets"; flow.pkts_toclient:10; flow.pkts_toserver:10; flow.bytes_toserver:<3000; flow.bytes_toclient:>8000; sid:1;)
alert ip any any -> any any (msg:"Flow has 10 packets"; flow.pkts:toclient,=10; flow.pkts:toserver,=10; flow.bytes:toserver,<3000; flow.bytes:toclient,>8000; sid:1;)
alert ip any any -> any any (msg:"Flow has 10 packets (old syntax)"; flow.pkts_toclient:10; flow.pkts_toserver:10; flow.bytes_toserver:<3000; flow.bytes_toclient:>8000; sid:2;)
5 changes: 5 additions & 0 deletions tests/detect-flow-pkts/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ checks:
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2

0 comments on commit a1e0152

Please sign in to comment.