mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Report PostgreSQL login success only after ReadyForQuery
Previously, Zeek treated the receipt of `AuthenticationOk` as a successful login. However, according to the PostgreSQL Frontend/Backend Protocol, the startup phase is not complete until the server sends `ReadyForQuery`. It is still possible for the server to emit an `ErrorResponse` (e.g. ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION) after `AuthenticationOk` but before `ReadyForQuery`. This change updates the PostgreSQL analyzer to defer reporting login success until `ReadyForQuery` is observed. This prevents false positives in cases where authentication succeeds but session startup fails.
This commit is contained in:
parent
a3983cc939
commit
e4e56789db
5 changed files with 28 additions and 4 deletions
|
@ -0,0 +1,12 @@
|
|||
# @TEST-DOC: Test Zeek parsing a trace file through the PostgreSQL analyzer.
|
||||
#
|
||||
# @TEST-REQUIRES: ${SCRIPTS}/have-spicy
|
||||
# @TEST-EXEC: zeek -b -r ${TRACES}/postgresql/psql-login-no-role.pcap %INPUT >output
|
||||
# @TEST-EXEC: zeek-cut -m ts uid id.orig_h id.orig_p id.resp_h id.resp_p service < conn.log > conn.cut
|
||||
# @TEST-EXEC: zeek-cut -m < postgresql.log > postgresql.cut
|
||||
#
|
||||
# @TEST-EXEC: btest-diff conn.cut
|
||||
# @TEST-EXEC: btest-diff postgresql.cut
|
||||
|
||||
@load base/protocols/conn
|
||||
@load base/protocols/postgresql
|
Loading…
Add table
Add a link
Reference in a new issue