If a password message was seen while logging passwords was disabled
for pgsql, this would lead to an empty request being logged.
Instead of simply not logging anything when there is a password message
and this is disabled, however, log instead that said password is
redacted.
Bug #7647
* "startup_message": message sent to start a new PostgreSQL connection
* "password_message": if password output for PGSQL is enabled in suricata.yaml,
carries the password sent during Authentication phase
+* "password_redacted": set to true in case there is a password message, but its
+ logging is disabled
* "simple_query": issued SQL command during simple query subprotocol. PostgreSQL
identifies specific sets of commands that change the set of expected messages
to be exchanged as subprotocols.
"password_message": {
"type": "string"
},
+ "password_redacted": {
+ "type": "boolean",
+ "description": "indicates if a password message was received but not logged due to Suricata settings"
+ },
"process_id": {
"type": "integer"
},
}) => {
if flags & PGSQL_LOG_PASSWORDS != 0 {
js.set_string_from_bytes("password", payload)?;
+ } else {
+ js.set_bool("password_redacted", true)?;
}
}
PgsqlFEMessage::SASLResponse(RegularPacket {
- pgsql:
enabled: no
# passwords: yes # enable output of passwords. Disabled by default
+ # If a password message is seen but this setting
+ # is disabled, "password_redacted": true is logged
- stats:
totals: yes # stats for all threads merged together
threads: no # per thread stats