From: Victor Julien Date: Thu, 22 Dec 2022 18:17:47 +0000 (+0100) Subject: tests: add rules for flow drops X-Git-Tag: suricata-6.0.10~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a47bec54009d63d3073f3ccc8f84f19bbe349a9;p=thirdparty%2Fsuricata-verify.git tests: add rules for flow drops --- diff --git a/tests/detect-udp-flow-rule-01/test.rules b/tests/detect-udp-flow-rule-01/test.rules new file mode 100644 index 000000000..031f1bea5 --- /dev/null +++ b/tests/detect-udp-flow-rule-01/test.rules @@ -0,0 +1,2 @@ +alert tcp any any -> any any (flow:to_server; sid:1;) +alert udp any any -> any any (flow:to_server; sid:2;) diff --git a/tests/detect-udp-flow-rule-01/test.yaml b/tests/detect-udp-flow-rule-01/test.yaml new file mode 100644 index 000000000..7e1747d53 --- /dev/null +++ b/tests/detect-udp-flow-rule-01/test.yaml @@ -0,0 +1,16 @@ +pcap: ../sip-body-frames/public-cloudshark-sip-s0.pcap +args: +- --set app-layer.error-policy=ignore +- --simulate-ips +- -k none +checks: + - filter: + count: 0 + match: + event_type: alert + alert.signature_id: 1 + - filter: + count: 4 + match: + event_type: alert + alert.signature_id: 2 diff --git a/tests/detect-udp-flow-rule-02-ips/suricata.yaml b/tests/detect-udp-flow-rule-02-ips/suricata.yaml new file mode 100644 index 000000000..dfccb8afa --- /dev/null +++ b/tests/detect-udp-flow-rule-02-ips/suricata.yaml @@ -0,0 +1,27 @@ +%YAML 1.1 +--- + +outputs: + - eve-log: + enabled: yes + types: + - alert: + tagged-packets: yes + - anomaly: + enabled: yes + types: + decode: no + stream: yes + applayer: yes + - tls: + extended: yes # enable this for extended logging information + - drop: + alerts: yes # log alerts that caused drops + flows: all # start or all: 'start' logs only a single drop + # per flow direction. All logs each dropped pkt. + - flow +action-order: + - pass + - drop + - reject + - alert diff --git a/tests/detect-udp-flow-rule-02-ips/test.rules b/tests/detect-udp-flow-rule-02-ips/test.rules new file mode 100644 index 000000000..e665e6de6 --- /dev/null +++ b/tests/detect-udp-flow-rule-02-ips/test.rules @@ -0,0 +1,2 @@ +drop tcp any any -> any any (flow:to_server; sid:1;) +drop udp any any -> any any (flow:to_server; sid:2;) diff --git a/tests/detect-udp-flow-rule-02-ips/test.yaml b/tests/detect-udp-flow-rule-02-ips/test.yaml new file mode 100644 index 000000000..de477b74b --- /dev/null +++ b/tests/detect-udp-flow-rule-02-ips/test.yaml @@ -0,0 +1,19 @@ +pcap: ../sip-body-frames/public-cloudshark-sip-s0.pcap +args: +- --simulate-ips +- -k none +checks: + - filter: + count: 0 + match: + event_type: alert + alert.signature_id: 1 + - filter: + count: 4 + match: + event_type: alert + alert.signature_id: 2 + - filter: + count: 4 + match: + event_type: drop