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

next/sv/508/20240628/v1 #1947

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Threshold.config with by_flow

This test checks threshold.config file using by_flow tracking

The pcap file is from http-all-headers test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
drop tcp any any -> any any (dsize:0; sid: 1000001;)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json
types:
- alert
- drop:
flows: all
alerts: true
- http
- anomaly
30 changes: 30 additions & 0 deletions tests/threshold/threshold-config-rate-filter-alert-flow/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pcap: ../../http-all-headers/input.pcap

requires:
min-version: 8

args:
- --set threshold-file=${TEST_DIR}/threshold.config
- --simulate-ips

checks:
- filter:
count: 3
match:
event_type: alert
alert.signature_id: 1000001
alert.action: blocked
- filter:
count: 16
match:
event_type: alert
alert.signature_id: 1000001
alert.action: allowed
- filter:
count: 3
match:
event_type: drop
- filter:
count: 1
match:
event_type: http
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rate_filter gen_id 1, sig_id 1000001, track by_flow, count 3, seconds 60, new_action alert, timeout 1000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again confused a bit, why should a drop rule be allowed to change action?
Related to #1893 (review), perhaps for later discussion, what a terminating action for packet should be.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know of a good use case for it, but I think the rate_filter does support it. It's coming from the Snort language, so not sure if this case was considered at the time.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Threshold.config with by_flow

This test checks threshold.config file using by_flow keyword

The pcap file is from http-all-headers test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert tcp any any -> any any (dsize:0; sid: 1000001;)
15 changes: 15 additions & 0 deletions tests/threshold/threshold-config-threshold-both-flow/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json
types:
- alert
- drop:
flows: all
alerts: true
- http
- anomaly
19 changes: 19 additions & 0 deletions tests/threshold/threshold-config-threshold-both-flow/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pcap: ../../http-all-headers/input.pcap

requires:
min-version: 8

args:
- --set threshold-file=${TEST_DIR}/threshold.config
- --simulate-ips

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1000001
- filter:
count: 1
match:
event_type: http
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
threshold gen_id 1, sig_id 1000001, type both, track by_flow, count 5, seconds 60
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Threshold.config with by_flow

This test checks threshold.config file using by_flow keyword

The pcap file is from http-all-headers test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert tcp any any -> any any (dsize:0; sid: 1000001;)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json
types:
- alert
- drop:
flows: all
alerts: true
- http
- anomaly
19 changes: 19 additions & 0 deletions tests/threshold/threshold-config-threshold-limit-flow/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pcap: ../../http-all-headers/input.pcap

requires:
min-version: 8

args:
- --set threshold-file=${TEST_DIR}/threshold.config
- --simulate-ips

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1000001
- filter:
count: 1
match:
event_type: http
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
threshold gen_id 1, sig_id 1000001, type limit, track by_flow, count 1, seconds 60
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Threshold.config with by_flow

This test checks threshold.config file using by_flow keyword

The pcap file is from http-all-headers test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert tcp any any -> any any (dsize:0; sid: 1000001;)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json
types:
- alert
- drop:
flows: all
alerts: true
- http
- anomaly
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pcap: ../../http-all-headers/input.pcap

requires:
min-version: 8

args:
- --set threshold-file=${TEST_DIR}/threshold.config
- --simulate-ips

checks:
- filter:
count: 3
match:
event_type: alert
alert.signature_id: 1000001
- filter:
count: 1
match:
event_type: http
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
threshold gen_id 1, sig_id 1000001, type threshold, track by_flow, count 5, seconds 60