From: jason taylor Date: Wed, 15 May 2019 15:22:23 +0000 (-0400) Subject: tests: add invalid depth within usage X-Git-Tag: suricata-6.0.4~447 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12a0bcb44fb1d3c4fee18976e1ead36b05264779;p=thirdparty%2Fsuricata-verify.git tests: add invalid depth within usage Signed-off-by: jason taylor --- diff --git a/tests/test-bad-depth-within-rule-2/suricata.yaml b/tests/test-bad-depth-within-rule-2/suricata.yaml new file mode 100644 index 000000000..dcaae57fe --- /dev/null +++ b/tests/test-bad-depth-within-rule-2/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-depth-within-rule-2/test.rules b/tests/test-bad-depth-within-rule-2/test.rules new file mode 100644 index 000000000..297a11937 --- /dev/null +++ b/tests/test-bad-depth-within-rule-2/test.rules @@ -0,0 +1 @@ +alert udp any any -> any any (msg:"TEST SUCCESFULL - Depth/Within INVALID combination "; depth:50; within:5; sid:5555552; rev:1;) diff --git a/tests/test-bad-depth-within-rule-2/test.yaml b/tests/test-bad-depth-within-rule-2/test.yaml new file mode 100644 index 000000000..67bddd68b --- /dev/null +++ b/tests/test-bad-depth-within-rule-2/test.yaml @@ -0,0 +1,21 @@ +requires: + 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: "depth needs preceding content, uricontent option, http_client_body, http_server_body, http_header option, http_raw_header option, http_method option, http_cookie, http_raw_uri, http_stat_msg, http_stat_code, http_user_agent, http_host, http_raw_host or file_data\/dce_stub_data sticky buffer options" + + - filter: + count: 1 + match: + event_type: engine + engine.error: "SC_ERR_NO_RULES_LOADED"