forked from OISF/suricata-verify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/pgsql: add checks and test for bug 6092
Ensure that pgsql metadata flags (for now, just setting whether passwords should be logged or not) are properly processed by Suri and logging functions. Related to Bug #6092
- Loading branch information
1 parent
b03a6ac
commit b14ff0b
Showing
10 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/pgsql/pgsql-bug-6092-log-flags-and-metadata-01/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Description | ||
|
||
Tests that when PostgreSQL (pgsql) EVE log config is set to not log out password | ||
messages, it doesn't. | ||
|
||
## PCAP | ||
|
||
Pcap file reused from pgsql-ssl-rejected-md5-auth-simple-query | ||
|
||
## Redmine ticket | ||
|
||
https://redmine.openinfosecfoundation.org/issues/6092 |
18 changes: 18 additions & 0 deletions
18
tests/pgsql/pgsql-bug-6092-log-flags-and-metadata-01/suricata.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular | ||
filename: eve.json | ||
types: | ||
- pgsql: | ||
enabled: yes | ||
#passwords: no # enable output of passwords Default is false | ||
- flow | ||
|
||
app-layer: | ||
protocols: | ||
pgsql: | ||
enabled: yes |
39 changes: 39 additions & 0 deletions
39
tests/pgsql/pgsql-bug-6092-log-flags-and-metadata-01/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
requires: | ||
# Pgsql was released on version 7.0 | ||
min-version: 7.0 | ||
|
||
pcap: ../pgsql-ssl-rejected-md5-auth-simple-query/input.pcap | ||
|
||
args: | ||
- -k none | ||
|
||
checks: | ||
# subtest 1 | ||
- filter: | ||
count: 1 | ||
match: | ||
dest_ip: 10.16.1.11 | ||
dest_port: 5432 | ||
event_type: pgsql | ||
pcap_cnt: 25 | ||
proto: TCP | ||
src_ip: 10.16.1.10 | ||
src_port: 40816 | ||
pgsql.tx_id: 2 | ||
pgsql.request.protocol_version: '3.0' | ||
pgsql.request.startup_parameters.optional_parameters[0].database: indexer | ||
pgsql.request.startup_parameters.user: indexer | ||
pgsql.response.authentication_md5_password: "\\x9fi\x1A\\x8e" | ||
# subtest 2 | ||
- filter: | ||
count: 1 | ||
match: | ||
dest_ip: 10.16.1.11 | ||
dest_port: 5432 | ||
event_type: pgsql | ||
pcap_cnt: 29 | ||
pgsql.tx_id: 3 | ||
not-has-key: pgsql.request.password | ||
pgsql.response.message: authentication_ok | ||
pgsql.response.process_id: 61 | ||
pgsql.response.secret_key: 3152142766 |
12 changes: 12 additions & 0 deletions
12
tests/pgsql/pgsql-bug-6092-log-flags-and-metadata-02/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Description | ||
|
||
Tests that when PostgreSQL (pgsql) EVE log config is set to log password | ||
messages, it does. | ||
|
||
## PCAP | ||
|
||
Pcap file reused from pgsql-ssl-rejected-md5-auth-simple-query | ||
|
||
## Redmine ticket | ||
|
||
https://redmine.openinfosecfoundation.org/issues/6092 |
18 changes: 18 additions & 0 deletions
18
tests/pgsql/pgsql-bug-6092-log-flags-and-metadata-02/suricata.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
outputs: | ||
- eve-log: | ||
enabled: yes | ||
filetype: regular | ||
filename: eve.json | ||
types: | ||
- pgsql: | ||
enabled: yes | ||
passwords: yes | ||
- flow | ||
|
||
app-layer: | ||
protocols: | ||
pgsql: | ||
enabled: yes |
19 changes: 19 additions & 0 deletions
19
tests/pgsql/pgsql-bug-6092-log-flags-and-metadata-02/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
requires: | ||
# Pgsql was released on version 7.0 | ||
min-version: 7.0 | ||
|
||
pcap: ../pgsql-ssl-rejected-md5-auth-simple-query/input.pcap | ||
|
||
args: | ||
- -k none | ||
|
||
checks: | ||
- filter: | ||
count: 1 | ||
match: | ||
dest_ip: 10.16.1.11 | ||
dest_port: 5432 | ||
event_type: pgsql | ||
pcap_cnt: 29 | ||
has-key: pgsql.request.password | ||
pgsql.response.message: authentication_ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters