zeek/scripts/policy/frameworks/intel/whitelist.bro
Jan Grashoefer cb33028702 Added hook to allow extending the intel log.
The extension mechanism is basically the one that Seth introduced with
his intel extensions. The main difference lies in using a hook instead
of an event. An example policy implements whitelisting.
2016-05-11 23:59:46 +02:00

30 lines
473 B
Text

@load base/frameworks/intel
@load base/frameworks/notice
module Intel;
export {
redef record Intel::MetaData += {
## Add a field to indicate if this is a whitelisted item.
whitelist: bool &default=F;
};
}
hook Intel::extend_match(info: Info, s: Seen, items: set[Item]) &priority=9
{
local whitelisted = F;
for ( item in items )
{
if ( item$meta$whitelist )
{
whitelisted = T;
break;
}
}
if ( whitelisted )
# Prevent logging
break;
}