From: Victor Julien Date: Mon, 24 Jun 2024 12:18:08 +0000 (+0200) Subject: tests: add threshold backoff tests X-Git-Tag: suricata-7.0.7~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1939%2Fhead;p=thirdparty%2Fsuricata-verify.git tests: add threshold backoff tests --- diff --git a/tests/threshold/threshold-rule-flow-backoff-single-flow/test.rules b/tests/threshold/threshold-rule-flow-backoff-single-flow/test.rules new file mode 100644 index 000000000..38e4ebd05 --- /dev/null +++ b/tests/threshold/threshold-rule-flow-backoff-single-flow/test.rules @@ -0,0 +1,4 @@ +alert tcp any any -> any any (dsize:>0; sid:1;) +alert tcp any any -> any any (dsize:>0; threshold:type backoff, track by_flow, count 1, multiplier 2; sid:2;) +alert tcp any any -> any any (dsize:>0; threshold:type backoff, track by_flow, count 3, multiplier 2; sid:3;) +alert tcp any any -> any any (dsize:>0; threshold:type backoff, track by_flow, count 5, multiplier 5; sid:4;) diff --git a/tests/threshold/threshold-rule-flow-backoff-single-flow/test.yaml b/tests/threshold/threshold-rule-flow-backoff-single-flow/test.yaml new file mode 100644 index 000000000..dca2674f2 --- /dev/null +++ b/tests/threshold/threshold-rule-flow-backoff-single-flow/test.yaml @@ -0,0 +1,26 @@ +requires: + min-version: 8 + +pcap: ../../filestore-filecontainer-smb/filecontainer-smb.pcap + +checks: + - filter: + count: 6676 + match: + event_type: alert + alert.signature_id: 1 + - filter: + count: 13 + match: + event_type: alert + alert.signature_id: 2 + - filter: + count: 12 + match: + event_type: alert + alert.signature_id: 3 + - filter: + count: 5 + match: + event_type: alert + alert.signature_id: 4 diff --git a/tests/threshold/threshold-rule-flow-backoff/test.rules b/tests/threshold/threshold-rule-flow-backoff/test.rules new file mode 100644 index 000000000..16727efc1 --- /dev/null +++ b/tests/threshold/threshold-rule-flow-backoff/test.rules @@ -0,0 +1,4 @@ +alert tcp any any -> any any (dsize:>0; sid:1;) +alert tcp any any -> any any (dsize:>0; threshold:type backoff, track by_flow, count 1, multiplier 2; sid:2;) +alert tcp any any -> any any (dsize:>0; threshold:type backoff, track by_flow, count 3, multiplier 2; sid:3;) +alert tcp any any -> any any (dsize:>0; threshold:type backoff, track by_flow, count 1, multiplier 10; sid:4;) diff --git a/tests/threshold/threshold-rule-flow-backoff/test.yaml b/tests/threshold/threshold-rule-flow-backoff/test.yaml new file mode 100644 index 000000000..6a8f1c05b --- /dev/null +++ b/tests/threshold/threshold-rule-flow-backoff/test.yaml @@ -0,0 +1,26 @@ +requires: + min-version: 8 + +pcap: ../../bug-2482-01/proxyCONNECT_443.pcap + +checks: + - filter: + count: 1725 + match: + event_type: alert + alert.signature_id: 1 + - filter: + count: 707 + match: + event_type: alert + alert.signature_id: 2 + - filter: + count: 338 + match: + event_type: alert + alert.signature_id: 3 + - filter: + count: 257 + match: + event_type: alert + alert.signature_id: 4