mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
add Pacf plugin for the internal Bro PacketFilter (not BPF)
This commit is contained in:
parent
ed65fdb6ba
commit
73d22a2dbd
4 changed files with 146 additions and 0 deletions
18
testing/btest/scripts/base/frameworks/pacf/packetfilter.bro
Normal file
18
testing/btest/scripts/base/frameworks/pacf/packetfilter.bro
Normal file
|
@ -0,0 +1,18 @@
|
|||
# @TEST-EXEC: bro -r $TRACES/smtp.trace %INPUT
|
||||
# @TEST-EXEC: btest-diff conn.log
|
||||
|
||||
@load base/frameworks/pacf
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
local pacf_packetfilter = Pacf::create_packetfilter();
|
||||
Pacf::activate(pacf_packetfilter, 0);
|
||||
}
|
||||
|
||||
event connection_established(c: connection)
|
||||
{
|
||||
local e = Pacf::Entity($ty=Pacf::ADDRESS, $ip=addr_to_subnet(c$id$orig_h));
|
||||
local r = Pacf::Rule($ty=Pacf::DROP, $target=Pacf::MONITOR, $entity=e, $expire=10min);
|
||||
|
||||
Pacf::add_rule(r);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue