Add app-layer fields to pgsql alerts.
Related to
Bug #7066
# Description
-Tests that alerts for the pgsql app-proto will include pgsql app-proto metadata.
+Tests that alerts for the pgsql app-proto will not include pgsql app-proto metadata
+if this setting is disabled in the configuration file.
## PCAP
- pgsql:
enabled: yes
passwords: yes
- - alert
+ - alert:
+ enabled: yes
+ metadata: no
app-layer:
protocols:
match:
event_type: alert
alert.signature_id: 1
-- filter:
- min-version: 8
- count: 1
- match:
- event_type: alert
- flow.pkts_toserver: 10
- flow.pkts_toclient: 10
+ not-has-key: flow
+ not-has-key: pgsql
match:
event_type: pgsql
- filter:
+ # in ips mode, as this rule inspects the stream only (no pgsql keywords), we end up getting two alerts instead of one
count: 2
match:
event_type: alert
alert.signature_id: 1
+- filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1
+ pgsql.request.simple_query: "select * from rules where sid = 2021701;"
+ pgsql.response.field_count: 10