From: jason taylor Date: Sun, 19 May 2019 01:14:35 +0000 (-0400) Subject: tests: add invalid content quotes usage X-Git-Tag: suricata-6.0.4~430 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98ce87e900c3199ed007cdc8f9f412fc9cae84f5;p=thirdparty%2Fsuricata-verify.git tests: add invalid content quotes usage Signed-off-by: jason taylor --- diff --git a/tests/test-bad-content-quotes-rule-1/suricata.yaml b/tests/test-bad-content-quotes-rule-1/suricata.yaml new file mode 100644 index 000000000..dcaae57fe --- /dev/null +++ b/tests/test-bad-content-quotes-rule-1/suricata.yaml @@ -0,0 +1,10 @@ +%YAML 1.1 +--- + +logging: + default-log-level: info + outputs: + - file: + enabled: yes + filename: eve.json + type: json diff --git a/tests/test-bad-content-quotes-rule-1/test.rules b/tests/test-bad-content-quotes-rule-1/test.rules new file mode 100644 index 000000000..855b198c0 --- /dev/null +++ b/tests/test-bad-content-quotes-rule-1/test.rules @@ -0,0 +1 @@ +alert tcp any any -> any any (msg:"invalid quotes in content"; content:"thisisbad""; sid:1234546; rev:1;) diff --git a/tests/test-bad-content-quotes-rule-1/test.yaml b/tests/test-bad-content-quotes-rule-1/test.yaml new file mode 100644 index 000000000..2d62a249b --- /dev/null +++ b/tests/test-bad-content-quotes-rule-1/test.yaml @@ -0,0 +1,23 @@ +requires: + min-version: 5.0.0 + + features: + - HAVE_LIBJANSSON + +command: | + ${SRCDIR}/src/suricata --set classification-file="${SRCDIR}/classification.config" --set reference-config-file="${SRCDIR}/reference.config" -l ${OUTPUT_DIR} -c ${TEST_DIR}/suricata.yaml -r ${TEST_DIR}/ -S ${TEST_DIR}/test.rules + +checks: + # check that we have the following entres in eve.json + # match 1 specific rule load failure reason + - filter: + count: 1 + match: + event_type: engine + engine.message: "Invalid unescaped double quote within content section." + + - filter: + count: 1 + match: + event_type: engine + engine.error: "SC_ERR_NO_RULES_LOADED"