zeek/testing/btest/scripts/base/protocols/postgresql/dump-events.zeek
Arne Welzel 85ca59484b postgresql: Initial parser implementation
This adds a protocol parser for the PostgreSQL protocol and a new
postgresql.log similar to the existing mysql.log.

This should be considered preliminary and hopefully during 7.1 and 7.2
with feedback from the community, we can improve on the events and logs.
Even if most PostgreSQL communication is encrypted in the real-world, this
will minimally allow monitoring of the SSLRequest and hand off further
analysis to the SSL analyzer.

This originates from github.com/awelzel/spicy-postgresql, with lots of
polishing happening in the past two days.
2024-09-06 16:10:48 +02:00

17 lines
563 B
Text

# @TEST-DOC: Test that misc/dump events works.
#
# @TEST-REQUIRES: ${SCRIPTS}/have-spicy
# @TEST-EXEC: zeek -b -Cr ${TRACES}/postgresql/psql-select-now.pcap %INPUT >>output
# @TEST-EXEC: zeek -b -Cr ${TRACES}/postgresql/psql-insert-fail-drop-fail.pcap %INPUT >>output
#
# @TEST-EXEC: btest-diff output
@load base/protocols/postgresql/spicy-events.zeek
@load misc/dump-events
redef DumpEvents::dump_all_events = T;
redef DumpEvents::include=/^(PostgreSQL|analyzer_)/;
event zeek_init() {
Analyzer::register_for_port(Analyzer::ANALYZER_POSTGRESQL, 5432/tcp);
}