mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

Introduce two new events for analyzer confirmation and analyzer violation reporting. The current analyzer_confirmation and analyzer_violation events assume connection objects and analyzer ids are available which is not always the case. We're already passing aid=0 for packet analyzers and there's not currently a way to report violations from file analyzers using analyzer_violation, for example. These new events use an extensible Info record approach so that additional (optional) information can be added later without changing the signature. It would allow for per analyzer extensions to the info records to pass analyzer specific info to script land. It's not clear that this would be a good idea, however. The previous analyzer_confirmation and analyzer_violation events continue to exist, but are deprecated and will be removed with Zeek 6.1.
18 lines
629 B
Text
18 lines
629 B
Text
# @TEST-DOC: IPv6 connection from external ipv6.pcap triggering FTP analyzer violation. Check dpd.log contains the right packet_segment
|
|
# @TEST-EXEC: zeek -r $TRACES/ftp/ipv6-violation.trace %INPUT
|
|
# @TEST-EXEC: btest-diff dpd.log
|
|
|
|
@load frameworks/dpd/packet-segment-logging
|
|
|
|
event analyzer_violation(c: connection, atype: AllAnalyzers::Tag, aid: count, reason: string)
|
|
{
|
|
print "analyzer_violation", c$id, atype, aid, reason;
|
|
}
|
|
|
|
@if ( Version::at_least("5.1") )
|
|
event analyzer_violation_info(tag: AllAnalyzers::Tag, info: AnalyzerViolationInfo)
|
|
{
|
|
print "reason", info$reason;
|
|
print "data", fmt("%s", info$data);
|
|
}
|
|
@endif
|