From: Juliana Fajardini Date: Fri, 24 Jan 2025 18:23:16 +0000 (-0300) Subject: tests: add engine-analysis stream rule type tests X-Git-Tag: suricata-7.0.9~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b031e7e5783bf624c2500aa2f638012ea5f2fc1;p=thirdparty%2Fsuricata-verify.git tests: add engine-analysis stream rule type tests To accompany the Rule Types documentation. Related to Task #7031 --- diff --git a/tests/rules/rule-type-stream/test.rules b/tests/rules/rule-type-stream/test.rules new file mode 100644 index 000000000..5ea8490a5 --- /dev/null +++ b/tests/rules/rule-type-stream/test.rules @@ -0,0 +1,7 @@ +# Stream rules +alert tcp-stream any any -> any any (msg:"tcp-stream, simple content"; content:"abc"; sid:102;) +alert http any any -> any any (msg:"http, simple content"; content:"abc"; sid:602;) +alert tcp any any -> any any (msg:"byte_extract with dce"; byte_extract:4,0,var,dce; byte_test:4,>,var,4,little; sid:901;) +alert tcp any any -> any 443 (flow: to_server; content:"abc"; flowbits:set,tls_error; sid:1605; msg:"Allow TLS error handling (outgoing packet) with simple content - Stream rule";) +alert tcp any any -> any 443 (flow: to_server; content:"abc"; sid:160401; msg:"Allow TLS error handling (outgoing packet) - stream rule";) +alert tcp any any -> any 443 (content:"abc"; sid:160402; msg:"Allow TLS error handling (outgoing packet) - stream rule";) diff --git a/tests/rules/rule-type-stream/test.yaml b/tests/rules/rule-type-stream/test.yaml new file mode 100644 index 000000000..8c7e66849 --- /dev/null +++ b/tests/rules/rule-type-stream/test.yaml @@ -0,0 +1,44 @@ +requires: + min-version: 7 + pcap: false + +args: +- --engine-analysis + +checks: + - filter: + filename: rules.json + count: 1 + match: + id: 102 + type: stream + - filter: + filename: rules.json + count: 1 + match: + id: 602 + type: stream + - filter: + filename: rules.json + count: 1 + match: + id: 901 + type: stream + - filter: + filename: rules.json + count: 1 + match: + id: 1605 + type: stream + - filter: + filename: rules.json + count: 1 + match: + id: 160401 + type: stream + - filter: + filename: rules.json + count: 1 + match: + id: 160402 + type: stream