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

This is a script-only change that unrolls File::Info records into multiple files.log entries if the same file was seen over different connections by single worker. Consequently, the File::Info record gets the commonly used uid and id fields added. These fields are optional for File::Info - a file may be analyzed without relation to a network connection (e.g by using Input::add_analysis()). The existing tx_hosts, rx_hosts and conn_uids fields of Files::Info are not meaningful after this change and removed by default. Therefore, files.log will have them removed, too. The tx_hosts, rx_hosts and conn_uids fields can be revived by using the policy script frameworks/files/deprecated-txhosts-rxhosts-connuids.zeek included in the distribution. However, with v6.1 this script will be removed.
16 lines
507 B
Text
16 lines
507 B
Text
# @TEST-DOC: Verify the files.log mat when Input::add_analysis() The fields info$id and info$uid are not expected to be set.
|
|
# @TEST-EXEC: zeek -b -r $TRACES/http/get.trace $SCRIPTS/file-analysis-test.zeek %INPUT
|
|
# @TEST-EXEC: btest-diff files.log
|
|
|
|
@load base/frameworks/files
|
|
|
|
event zeek_init()
|
|
{
|
|
local source: string = "./myfile";
|
|
Input::add_analysis([$source=source, $name=source]);
|
|
}
|
|
|
|
@TEST-START-FILE ./myfile
|
|
%PDF-1.5
|
|
This isn't an actual pdf, but it shows in files.log as such :-)
|
|
@TEST-END-FILE
|