Skip to content

Commit

Permalink
tests/pgsql: add test for bug 6983
Browse files Browse the repository at this point in the history
Related to
Bug #6983
  • Loading branch information
jufajardini committed Apr 25, 2024
1 parent 4f80fde commit b5f8b39
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/pgsql/pgsql-bug-6983/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Description

Tests that alerts for the pgsql app-proto will include pgsql app-proto metadata.

This shows what might be a bug - more investigation is needed: that we may be
logging not the transaction that triggered the alert itself, but maybe the
subsequent one - or none, if the alert was triggered with the last seen message
for PGSQL.

## PCAP

Pcap file reused from pgsql-ssl-rejected-md5-auth-simple-query

## Redmine ticket

https://redmine.openinfosecfoundation.org/issues/6983
16 changes: 16 additions & 0 deletions tests/pgsql/pgsql-bug-6983/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json
types:
- pgsql
- alert

app-layer:
protocols:
pgsql:
enabled: yes
1 change: 1 addition & 0 deletions tests/pgsql/pgsql-bug-6983/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert pgsql any any -> any any (msg:"PGSQL Test Rule"; pkt_data; content:"|58|"; sid:1; rev:1;)
24 changes: 24 additions & 0 deletions tests/pgsql/pgsql-bug-6983/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
requires:
min-version: 7.0

pcap: ../pgsql-ssl-rejected-md5-auth-simple-query/input.pcap

args:
- -k none

checks:
- filter:
count: 7
match:
event_type: pgsql
- filter:
count: 2
match:
event_type: alert
alert.signature_id: 1
- filter:
min-version: 8
count: 2
match:
event_type: alert
has-key: pgsql.request

0 comments on commit b5f8b39

Please sign in to comment.