mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00

Netcontrol log now includes more information; before that, it had not quite caught up to the new capabilities (like flow modifying and redirection, as well as mac addresses). Furthermore, this fixes a number of bugs with cluster mode (like duplicate events), test failures due to updates in Bro, etc.
27 lines
757 B
Text
27 lines
757 B
Text
# @TEST-EXEC: bro -r $TRACES/tls/ecdhe.pcap %INPUT
|
|
# @TEST-EXEC: btest-diff netcontrol.log
|
|
|
|
@load base/frameworks/netcontrol
|
|
|
|
event bro_init()
|
|
{
|
|
local netcontrol_debug = NetControl::create_debug(T);
|
|
NetControl::activate(netcontrol_debug, 0);
|
|
}
|
|
|
|
event connection_established(c: connection)
|
|
{
|
|
local id = c$id;
|
|
NetControl::shunt_flow([$src_h=id$orig_h, $src_p=id$orig_p, $dst_h=id$resp_h, $dst_p=id$resp_p], 30sec);
|
|
NetControl::drop_address(id$orig_h, 15sec);
|
|
NetControl::whitelist_address(id$orig_h, 15sec);
|
|
NetControl::redirect_flow([$src_h=id$orig_h, $src_p=id$orig_p, $dst_h=id$resp_h, $dst_p=id$resp_p], 5, 30sec);
|
|
}
|
|
|
|
hook NetControl::rule_policy(r: NetControl::Rule)
|
|
{
|
|
if ( r$expire == 15sec )
|
|
break;
|
|
|
|
r$entity$flow$src_h = 0.0.0.0/0;
|
|
}
|