From: Philippe Antoine Date: Thu, 28 Apr 2022 14:38:05 +0000 (+0200) Subject: threshold: adds test for threshold.config with by_rule X-Git-Tag: suricata-5.0.10~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2f6fd8b7aae510ff60a751df8859557a0b3348b;p=thirdparty%2Fsuricata-verify.git threshold: adds test for threshold.config with by_rule --- diff --git a/tests/threshold-config-byrule/README.md b/tests/threshold-config-byrule/README.md new file mode 100644 index 000000000..a9a4cbde0 --- /dev/null +++ b/tests/threshold-config-byrule/README.md @@ -0,0 +1,5 @@ +# Threshold.config with by_rule + +This test checks threshold.config file using by_rule keyword + +The pcap file is from http-all-headers test diff --git a/tests/threshold-config-byrule/input.pcap b/tests/threshold-config-byrule/input.pcap new file mode 100644 index 000000000..bf5caebc4 Binary files /dev/null and b/tests/threshold-config-byrule/input.pcap differ diff --git a/tests/threshold-config-byrule/input.rules b/tests/threshold-config-byrule/input.rules new file mode 100644 index 000000000..4b313e20b --- /dev/null +++ b/tests/threshold-config-byrule/input.rules @@ -0,0 +1 @@ +alert http any any -> any any (msg:"toto"; sid: 1000001;) diff --git a/tests/threshold-config-byrule/test.yaml b/tests/threshold-config-byrule/test.yaml new file mode 100644 index 000000000..ca16235c5 --- /dev/null +++ b/tests/threshold-config-byrule/test.yaml @@ -0,0 +1,12 @@ +requires: + min-version: 7 + +args: +- --set threshold-file=${TEST_DIR}/threshold.config + +checks: + - filter: + count: 3 + match: + event_type: alert + alert.signature_id: 1000001 diff --git a/tests/threshold-config-byrule/threshold.config b/tests/threshold-config-byrule/threshold.config new file mode 100644 index 000000000..f2ec59727 --- /dev/null +++ b/tests/threshold-config-byrule/threshold.config @@ -0,0 +1 @@ +threshold gen_id 1, sig_id 1000001, type limit, track by_rule, count 3, seconds 1000