From: Juliana Fajardini Date: Fri, 15 Sep 2023 01:30:48 +0000 (-0300) Subject: tests: add rule type check for iptops X-Git-Tag: suricata-6.0.15~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2fa5647aefabcb66f6260b86a12b2d90ea08541;p=thirdparty%2Fsuricata-verify.git tests: add rule type check for iptops Related to Task #6348 --- diff --git a/tests/rules/ipopts/test.rules b/tests/rules/ipopts/test.rules new file mode 100644 index 000000000..b01282383 --- /dev/null +++ b/tests/rules/ipopts/test.rules @@ -0,0 +1,10 @@ +alert ip any any -> any any (msg:"source route rr"; ipopts:rr; sid:1;) +alert ip any any -> any any (msg:"source route eol"; ipopts:eol; sid:2;) +alert ip any any -> any any (msg:"source route nop"; ipopts:nop; sid:3;) +alert ip any any -> any any (msg:"source route ts"; ipopts:ts; sid:4;) +alert ip any any -> any any (msg:"source route sec"; ipopts:sec; sid:5;) +alert ip any any -> any any (msg:"source route esec"; ipopts:esec; sid:6;) +alert ip any any -> any any (msg:"source route lsrr"; ipopts:lsrr; sid:7;) +alert ip any any -> any any (msg:"source route ssrr"; ipopts:ssrr; sid:8;) +alert ip any any -> any any (msg:"source route satid"; ipopts:satid; sid:9;) +alert ip any any -> any any (msg:"source route any"; ipopts:any; sid:10;) diff --git a/tests/rules/ipopts/test.yaml b/tests/rules/ipopts/test.yaml new file mode 100644 index 000000000..cabddca16 --- /dev/null +++ b/tests/rules/ipopts/test.yaml @@ -0,0 +1,78 @@ +requires: + min-version: 7.0.0 + pcap: false + +args: + - --engine-analysis + +checks: +- filter: + filename: rules.json + count: 1 + match: + id: 1 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "rr" +- filter: + filename: rules.json + count: 1 + match: + id: 2 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "eol" +- filter: + filename: rules.json + count: 1 + match: + id: 3 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "nop" +- filter: + filename: rules.json + count: 1 + match: + id: 4 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "ts" +- filter: + filename: rules.json + count: 1 + match: + id: 5 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "sec" +- filter: + filename: rules.json + count: 1 + match: + id: 6 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "esec" +- filter: + filename: rules.json + count: 1 + match: + id: 7 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "lsrr" +- filter: + filename: rules.json + count: 1 + match: + id: 8 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "ssrr" +- filter: + filename: rules.json + count: 1 + match: + id: 9 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "satid" +- filter: + filename: rules.json + count: 1 + match: + id: 10 + lists.packet.matches[0].name: "ipopts" + lists.packet.matches[0].ipopts.option: "any"