]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
threshold-config: New test for issue in 2190
authorJeff Lucovsky <jeff@lucovsky.org>
Sat, 5 Dec 2020 14:43:12 +0000 (09:43 -0500)
committerJason Ish <jason.ish@oisf.net>
Tue, 6 Jul 2021 21:46:29 +0000 (15:46 -0600)
This commit adds a test case for large IP address handling in the
threshold.config file.

tests/bug-2190/input.pcap [new file with mode: 0644]
tests/bug-2190/test.rules [new file with mode: 0644]
tests/bug-2190/test.yaml [new file with mode: 0644]
tests/bug-2190/threshold.config [new file with mode: 0644]

diff --git a/tests/bug-2190/input.pcap b/tests/bug-2190/input.pcap
new file mode 100644 (file)
index 0000000..170b5e8
Binary files /dev/null and b/tests/bug-2190/input.pcap differ
diff --git a/tests/bug-2190/test.rules b/tests/bug-2190/test.rules
new file mode 100644 (file)
index 0000000..4c0d517
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (http.request_body; url_decode; content:"mail=test@oisf.net"; sid:1;)
diff --git a/tests/bug-2190/test.yaml b/tests/bug-2190/test.yaml
new file mode 100644 (file)
index 0000000..8101392
--- /dev/null
@@ -0,0 +1,15 @@
+requires:
+    min-version: 6
+
+exit-code: 0
+
+command: |
+  ${SRCDIR}/src/suricata --set classification-file="${SRCDIR}/etc/classification.config"    \
+      --set reference-config-file="${SRCDIR}/etc/reference.config" -l ${OUTPUT_DIR}         \
+      --set threshold-file="${TEST_DIR}/threshold.config"                                   \
+      -c "${SRCDIR}/suricata.yaml" -r ${TEST_DIR}/input.pcap -S ${TEST_DIR}/test.rules 
+
+checks:
+    - shell:
+        args: grep "SC_ERR_PCRE_" suricata.log | wc -l | xargs
+        expect: 0
diff --git a/tests/bug-2190/threshold.config b/tests/bug-2190/threshold.config
new file mode 100644 (file)
index 0000000..fb8e9d7
--- /dev/null
@@ -0,0 +1 @@
+suppress gen_id 0, sig_id 0, track by_src, ip [123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32,123.123.123.123/32]