From: jason taylor Date: Wed, 24 Aug 2022 15:48:38 +0000 (+0000) Subject: tests: add dsize option signature tests X-Git-Tag: suricata-6.0.8~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84357215f4efba328c9916a68a3cbf209523b49a;p=thirdparty%2Fsuricata-verify.git tests: add dsize option signature tests Signed-off-by: jason taylor --- diff --git a/tests/test-dsize-values/README.md b/tests/test-dsize-values/README.md new file mode 100644 index 000000000..32b1a9741 --- /dev/null +++ b/tests/test-dsize-values/README.md @@ -0,0 +1,10 @@ +# Description + +Test dsize keyword values against pcap. + +This test case has signatures with all the current possible +dsize value options, all signatures should alert. + +# PCAP + +The pcap is a flowsynth generated pcap. diff --git a/tests/test-dsize-values/input.pcap b/tests/test-dsize-values/input.pcap new file mode 100644 index 000000000..858678082 Binary files /dev/null and b/tests/test-dsize-values/input.pcap differ diff --git a/tests/test-dsize-values/test.rules b/tests/test-dsize-values/test.rules new file mode 100644 index 000000000..0ba01e315 --- /dev/null +++ b/tests/test-dsize-values/test.rules @@ -0,0 +1,13 @@ +alert tcp any any -> any any (msg:"dsize exact size"; dsize:10; sid:1; rev:1;) + +alert tcp any any -> any any (msg:"dsize less than value"; dsize:<10; sid:2; rev:1;) + +alert tcp any any -> any any (msg:"dsize less than or equal value"; dsize:<=10; sid:3; rev:1;) + +alert tcp any any -> any any (msg:"dsize greater than value"; dsize:>8; sid:4; rev:1;) + +alert tcp any any -> any any (msg:"dsize greater than or equal value"; dsize:>=10; sid:5; rev:1;) + +alert tcp any any -> any any (msg:"dsize range value"; dsize:8<>20; sid:6; rev:1;) + +alert tcp any any -> any any (msg:"dsize not equal value"; dsize:!9; sid:7; rev:1;) diff --git a/tests/test-dsize-values/test.yaml b/tests/test-dsize-values/test.yaml new file mode 100644 index 000000000..16c37ab7f --- /dev/null +++ b/tests/test-dsize-values/test.yaml @@ -0,0 +1,35 @@ +args: +- -k none + +requires: + min-version: 7.0.0 + +checks: +- filter: + count: 4 + match: + alert.signature: dsize less than value +- filter: + count: 5 + match: + alert.signature: dsize less than or equal value +- filter: + count: 1 + match: + alert.signature: dsize exact size +- filter: + count: 1 + match: + alert.signature: dsize greater than value +- filter: + count: 1 + match: + alert.signature: dsize greater than or equal value +- filter: + count: 1 + match: + alert.signature: dsize range value +- filter: + count: 1 + match: + alert.signature: dsize not equal value