base/frameworks/netcontrol/types.zeek¶
-
NetControl¶
This file defines the types that are used by the NetControl framework.
The most important type defined in this file is NetControl::Rule,
which is used to describe all rules that can be expressed by the NetControl framework.
- Namespace
NetControl
Summary¶
Runtime Options¶
The default priority that is used when creating rules. |
Redefinable Options¶
The default priority that is used when using the high-level functions to
push whitelist entries to the backends ( |
Types¶
Type defining the entity a rule is operating on. |
|
Type defining the entity that a rule applies to. |
|
Flow is used in |
|
Information of a flow that can be provided by switches when the flow times out. |
|
Type for defining a flow modification action. |
|
A rule for the framework to put in place. |
|
Type of rules that the framework supports. |
|
Type defining the target of a rule. |
Detailed Interface¶
Runtime Options¶
Redefinable Options¶
-
NetControl::whitelist_priority¶ -
The default priority that is used when using the high-level functions to push whitelist entries to the backends (
NetControl::whitelist_addressandNetControl::whitelist_subnet).Note that this priority is not automatically used when manually creating rules that have a
NetControl::RuleTypeofNetControl::WHITELIST.
Types¶
-
NetControl::Entity¶ - Type
-
- ty:
NetControl::EntityType Type of entity.
- conn:
conn_id&optional Used with
NetControl::CONNECTION.- flow:
NetControl::Flow&optional Used with
NetControl::FLOW.- ip:
subnet&optional Used with
NetControl::ADDRESSto specifiy a CIDR subnet.- mac:
string&optional Used with
NetControl::MAC.
- ty:
Type defining the entity a rule is operating on.
-
NetControl::EntityType¶ - Type
-
-
NetControl::ADDRESS¶ Activity involving a specific IP address.
-
NetControl::CONNECTION¶ Activity involving all of a bi-directional connection’s activity.
-
NetControl::FLOW¶ Activity involving a uni-directional flow’s activity. Can contain wildcards.
-
NetControl::MAC¶ Activity involving a MAC address.
-
Type defining the entity that a rule applies to.
-
NetControl::Flow¶ - Type
-
- src_h:
subnet&optional The source IP address/subnet.
- src_p:
port&optional The source port number.
- dst_h:
subnet&optional The destination IP address/subnet.
- dst_p:
port&optional The destination port number.
- src_m:
string&optional The source MAC address.
- dst_m:
string&optional The destination MAC address.
- src_h:
Flow is used in
NetControl::Entitytogether withNetControl::FLOWto specify a uni-directional flow that a rule applies to.If optional fields are not set, they are interpreted as wildcarded.
-
NetControl::FlowInfo¶ - Type
Information of a flow that can be provided by switches when the flow times out. Currently this is heavily influenced by the data that OpenFlow returns by default. That being said - their design makes sense and this is probably the data one can expect to be available.
-
NetControl::FlowMod¶ - Type
Type for defining a flow modification action.
-
NetControl::Rule¶ - Type
-
- ty:
NetControl::RuleType Type of rule.
- target:
NetControl::TargetType Where to apply rule.
- entity:
NetControl::Entity Entity to apply rule to.
- expire:
interval&optional Timeout after which to expire the rule.
- priority:
int&default=NetControl::default_priority&optional Priority if multiple rules match an entity (larger value is higher priority).
- location:
string&optional Optional string describing where/what installed the rule.
- out_port:
count&optional Argument for
NetControl::REDIRECTrules.- mod:
NetControl::FlowMod&optional Argument for
NetControl::MODIFYrules.- id:
string&default=""&optional Internally determined unique ID for this rule. Will be set when added.
- cid:
count&default=0&optional Internally determined unique numeric ID for this rule. Set when added.
- _plugin_ids:
set[count]&default={ }&optional (present if base/frameworks/netcontrol/main.zeek is loaded)
Internally set to the plugins handling the rule.
- _active_plugin_ids:
set[count]&default={ }&optional (present if base/frameworks/netcontrol/main.zeek is loaded)
Internally set to the plugins on which the rule is currently active.
- _no_expire_plugins:
set[count]&default={ }&optional (present if base/frameworks/netcontrol/main.zeek is loaded)
Internally set to plugins where the rule should not be removed upon timeout.
- _added:
bool&default=F&optional (present if base/frameworks/netcontrol/main.zeek is loaded)
Track if the rule was added successfully by all responsible plugins.
- ty:
A rule for the framework to put in place. Of all rules currently in place, the first match will be taken, sorted by priority. All further rules will be ignored.
-
NetControl::RuleType¶ - Type
-
-
NetControl::DROP¶ Stop forwarding all packets matching the entity.
No additional arguments.
-
NetControl::MODIFY¶ Modify all packets matching entity. The packets will be modified according to the mod entry of the rule.
-
NetControl::REDIRECT¶ Redirect all packets matching entity to a different switch port, given in the out_port argument of the rule.
-
NetControl::WHITELIST¶ Whitelists all packets of an entity, meaning no restrictions will be applied. While whitelisting is the default if no rule matches, this type can be used to override lower-priority rules that would otherwise take effect for the entity.
-
Type of rules that the framework supports. Each type lists the extra
NetControl::Rulefields it uses, if any.Plugins may extend this type to define their own.
-
NetControl::TargetType¶ -
Type defining the target of a rule.
Rules can either be applied to the forward path, affecting all network traffic, or on the monitor path, only affecting the traffic that is sent to Zeek. The second is mostly used for shunting, which allows Zeek to tell the networking hardware that it wants to no longer see traffic that it identified as benign.