]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
threshold: adds test for threshold.config with by_rule
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 28 Apr 2022 14:38:05 +0000 (16:38 +0200)
committerJason Ish <jason.ish@oisf.net>
Mon, 11 Jul 2022 19:01:49 +0000 (13:01 -0600)
tests/threshold-config-byrule/README.md [new file with mode: 0644]
tests/threshold-config-byrule/input.pcap [new file with mode: 0644]
tests/threshold-config-byrule/input.rules [new file with mode: 0644]
tests/threshold-config-byrule/test.yaml [new file with mode: 0644]
tests/threshold-config-byrule/threshold.config [new file with mode: 0644]

diff --git a/tests/threshold-config-byrule/README.md b/tests/threshold-config-byrule/README.md
new file mode 100644 (file)
index 0000000..a9a4cbd
--- /dev/null
@@ -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 (file)
index 0000000..bf5caeb
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 (file)
index 0000000..4b313e2
--- /dev/null
@@ -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 (file)
index 0000000..ca16235
--- /dev/null
@@ -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 (file)
index 0000000..f2ec597
--- /dev/null
@@ -0,0 +1 @@
+threshold gen_id 1, sig_id 1000001, type limit, track by_rule, count 3, seconds 1000