Test that a default app policy with alert logs an alert when an explicit rule
exists for the same hook but does not match.
--- /dev/null
+Test that a default app policy with alert logs an alert when an explicit rule
+exists for the same hook but does not match. This exercises the
+fw_last_for_progress miss path.
--- /dev/null
+accept:hook tcp:all any any -> any any (sid:100;)
+
+# Our PCAP has a GET, so this fast_pattern selects this as a candidate.
+# However, this PCAP does not have a POST, so it never matches.
+# We expect the default policy to take over, which is drop:flow,alert
+accept:hook http1:request_line any any -> any any (http.method; content:"GET"; fast_pattern; content:"POST"; sid:102;)
--- /dev/null
+%YAML 1.1
+---
+
+stats:
+ enabled: yes
+ interval: 8
+
+outputs:
+ - eve-log:
+ enabled: yes
+ filetype: regular
+ filename: eve.json
+ types:
+ - stats
+ - alert
+ - flow
+ - http
+ - drop:
+ alerts: yes
+ flows: all
+
+firewall:
+ policies:
+ http:
+ request-started: ["accept:hook"]
+ request-line: ["drop:flow", "alert"]
--- /dev/null
+requires:
+ min-version: 9
+
+pcap: ../../flowbit-oring/input.pcap
+
+args:
+ - --simulate-ips
+ - -k none
+
+checks:
+
+# We see the first drop.
+- filter:
+ count: 1
+ match:
+ event_type: drop
+ pcap_cnt: 4
+ drop.reason: "firewall default app policy"
+
+# Confirm that we see this alert.
+- filter:
+ count: 1
+ match:
+ event_type: alert
+ pcap_cnt: 4
+ alert.signature_id: 2201001