Network Policy
Network policy configuration file explanation and example.
The Network Policy Plugin allows users to define and enforce traffic policies based on CIDRs (IP ranges) and domain resolutions. It supports advanced configurations for alerting, enforcing, and bypassing traffic rules, ensuring flexible network control.
Jibril execution:
Enable the Network Policy Plugin
:
Enable the alert events:
in case alert
or both
modes are enabled.
Configuration Example
Configuration Overview
cidr_mode
Defines the mode for handling traffic based on CIDRs.
Possible values: bypass
, alert
, enforce
, both
.
cidr_policy
Determines the default policy for CIDRs.
Possible values: allow
, deny
.
resolve_mode
Defines the mode for handling domain resolutions.
Possible values: bypass
, alert
, enforce
, both
.
resolve_policy
Determines the default policy for domain resolutions.
Possible values: allow
, deny
.
rules
List of custom rules for specific CIDRs or domains.
Modes and Policies
CIDR Modes
bypass
Allow all traffic to and from the specified CIDRs.
alert
Alert when traffic violates CIDR rules but does not block it.
enforce
Block traffic that violates CIDR rules.
both
Both alert and block traffic that violates CIDR rules.
CIDR Policy
allow
Allow traffic to CIDRs by default.
deny
Block traffic to CIDRs by default.
Resolve Modes
bypass
Allow all domain resolutions.
alert
Alert when domain resolution violates rules but does not block it.
enforce
Block domain resolutions that violate rules.
both
Both alert and block domain resolutions that violate rules.
Resolve Policy
allow
Allow domain resolutions by default.
deny
Block domain resolutions by default.
Rule Details
CIDR Rules
127.0.0.0/8
allow
Allow all traffic to localhost.
::1/128
allow
Allow IPv6 localhost traffic.
192.168.0.0/16
allow
Allow traffic within the internal network.
172.16.0.0/16
allow
Allow traffic within the internal network.
10.0.0.0/8
allow
Allow traffic within the internal network.
8.8.8.8/32
allow
Allow traffic to Google Public DNS.
8.8.4.4/32
allow
Allow traffic to Google Public DNS.
1.1.1.1/32
allow
Allow traffic to Cloudflare DNS.
9.9.9.9/32
allow
Allow traffic to Quad9 DNS.
Domain Rules
org
allow
Allow resolution of all .org
domains.
google.com
allow
Allow resolution of google.com
.
example.com
deny
Block resolution of example.com
.
uol.com.br
deny
Block resolution of uol.com.br
.
Key Features
Alert and Enforce Modes Flexibly alert or block traffic and domain resolutions based on custom rules.
Granular Rule Definition Define specific CIDRs or domains to allow or deny traffic.
Default Policy Configuration Set default allow or deny policies for both CIDRs and domains.
Independent Rules Domain resolution rules operate independently of CIDR traffic rules for fine-grained control.
Testing Support Easily configure test rules, such as whitelisting all traffic, for development and debugging purposes.
Ensure that CIDR and domain rules are carefully managed to avoid unintended access or blocking.
Last updated
Was this helpful?