mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
NetControl: allow reasons in remove_rule calls.
This adds the capability for the user to attach a reason when removing or destroying a rule. The message will both be logged in netcontrol.log and forwarded to the responsible plugins. Addresses BIT-1655
This commit is contained in:
parent
9d9c7bafd3
commit
4f1a2c7b62
21 changed files with 129 additions and 115 deletions
|
@ -46,7 +46,7 @@ export {
|
|||
};
|
||||
|
||||
global broker_add_rule: event(id: count, r: Rule);
|
||||
global broker_remove_rule: event(id: count, r: Rule);
|
||||
global broker_remove_rule: event(id: count, r: Rule, reason: string);
|
||||
|
||||
global broker_rule_added: event(id: count, r: Rule, msg: string);
|
||||
global broker_rule_removed: event(id: count, r: Rule, msg: string);
|
||||
|
@ -155,12 +155,12 @@ function broker_add_rule_fun(p: PluginState, r: Rule) : bool
|
|||
return T;
|
||||
}
|
||||
|
||||
function broker_remove_rule_fun(p: PluginState, r: Rule) : bool
|
||||
function broker_remove_rule_fun(p: PluginState, r: Rule, reason: string) : bool
|
||||
{
|
||||
if ( ! broker_check_rule(p, r) )
|
||||
return F;
|
||||
|
||||
Broker::send_event(p$broker_config$topic, Broker::event_args(broker_remove_rule, p$broker_id, r));
|
||||
Broker::send_event(p$broker_config$topic, Broker::event_args(broker_remove_rule, p$broker_id, r, reason));
|
||||
return T;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue