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

The "orig_fuids", "orig_filenames", "orig_mime_types" http.log fields as well as their "resp" counterparts are now limited to having "HTTP::max_files_orig" or "HTTP::max_files_resp" entries, which are 15 by default. The limit can also be ignored case-by-case via the "HTTP::max_files_policy" hook. Fixes GH-289
23 lines
758 B
Text
23 lines
758 B
Text
# @TEST-EXEC: bro -C -r $TRACES/http/multipart.trace
|
|
# @TEST-EXEC: btest-diff http.log
|
|
# @TEST-EXEC: bro -C -r $TRACES/http/multipart.trace %INPUT >out-limited
|
|
# @TEST-EXEC: mv http.log http-limited.log
|
|
# @TEST-EXEC: btest-diff http-limited.log
|
|
# @TEST-EXEC: btest-diff out-limited
|
|
# @TEST-EXEC: bro -C -r $TRACES/http/multipart.trace %INPUT ignore_http_file_limit=T >out-limit-ignored
|
|
# @TEST-EXEC: mv http.log http-limit-ignored.log
|
|
# @TEST-EXEC: btest-diff http-limit-ignored.log
|
|
# @TEST-EXEC: btest-diff out-limit-ignored
|
|
|
|
option ignore_http_file_limit = F;
|
|
|
|
redef HTTP::max_files_orig = 1;
|
|
redef HTTP::max_files_resp = 1;
|
|
|
|
hook HTTP::max_files_policy(f: fa_file, is_orig: bool)
|
|
{
|
|
print "max_files reached";
|
|
|
|
if ( ignore_http_file_limit )
|
|
break;
|
|
}
|