Signed-off-by: jason taylor <jtfas90@gmail.com>
--- /dev/null
+%YAML 1.1
+---
+
+logging:
+ default-log-level: info
+ outputs:
+ - file:
+ enabled: yes
+ filename: eve.json
+ type: json
--- /dev/null
+alert tcp any any -> any any (msg:"Byte_Extract Example Using depth"; content:"Alice"; depth:d; byte_extract:2,1,size; content:"Bob"; sid:1111;)
--- /dev/null
+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: "unknown byte_extract var seen in depth - d."
+
+ - filter:
+ count: 1
+ match:
+ event_type: engine
+ engine.error: "SC_ERR_NO_RULES_LOADED"
--- /dev/null
+%YAML 1.1
+---
+
+logging:
+ default-log-level: info
+ outputs:
+ - file:
+ enabled: yes
+ filename: eve.json
+ type: json
--- /dev/null
+alert tcp any any -> any any (msg:"bad depth value rule"; content:"first"; depth:-5; byte_extract:2,0,size; sid:111232; rev:1;)
--- /dev/null
+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 value for depth: -5."
+
+ - filter:
+ count: 1
+ match:
+ event_type: engine
+ engine.error: "SC_ERR_NO_RULES_LOADED"