Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow bytes pkts either/v5 #2217

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/detect-flow-pkts-either/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Test
====

Test `flow.pkts:either`.. and `flow.bytes:either`.. keywords

PCAP
====

From existing s-v test.

Related tickets
==============
https://redmine.openinfosecfoundation.org/issues/5646
5 changes: 5 additions & 0 deletions tests/detect-flow-pkts-either/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alert ip any any -> any any (msg:"Flow has more than 3000 bytes and 10 pkts in either direction";flow.pkts:either,=10;flow.bytes:either,>3000; sid:1;)
alert ip any any -> any any (msg:"Flow has 10 pkts in toserver direction";flow.pkts:toserver,=10;sid:2;)
alert ip any any -> any any (msg:"Flow has 10 pkts in toclient direction";flow.pkts:toclient,=10;sid:3;)
alert ip any any -> any any (msg:"Flow has more than 3000 bytes in toserver direction";flow.bytes:toserver,>3000; sid:4;)
alert ip any any -> any any (msg:"Flow has more than 3000 bytes in toclient direction";flow.bytes:toclient,>3000; threshold: type backoff, track by_flow, count 2, multiplier 10; sid:5;)
38 changes: 38 additions & 0 deletions tests/detect-flow-pkts-either/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
requires:
min-version: 8

pcap: ../decode-teredo-01/input.pcap

args:
- -k none

checks:
- filter:
count: 3
match:
event_type: alert
alert.signature_id: 1

- filter:
count: 3
match:
event_type: alert
alert.signature_id: 2

- filter:
count: 1
match:
event_type: alert
alert.signature_id: 3

- filter:
count: 0
match:
event_type: alert
alert.signature_id: 4

- filter:
count: 2
match:
event_type: alert
alert.signature_id: 5
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
Loading