Skip to content

Instantly share code, notes, and snippets.

@mpurzynski
Created October 10, 2017 00:19
Show Gist options
  • Select an option

  • Save mpurzynski/6ad07448ef001041f21735d82dc5ca49 to your computer and use it in GitHub Desktop.

Select an option

Save mpurzynski/6ad07448ef001041f21735d82dc5ca49 to your computer and use it in GitHub Desktop.
filter_noise_files.bro
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contributor(s):
# Michal Purzynski [email protected]
#
module LogFilter;
event bro_init()
{
Log::remove_default_filter(Files::LOG);
Log::add_filter(Files::LOG, [$name = "files-noise",
$pred(rec: Files::Info) = {
local result = T;
for (tx_host in rec$tx_hosts) {
if (Site::is_local_addr(tx_host) == T) {
if ((rec?$mime_type) && (/^application\/pkix-cert$/ in rec$mime_type))
result = F;
}
else
result = T;
}
return result;
}
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment