Appearance
Network Policy Configuration
Control network traffic at the kernel level with policy-based enforcement for IP addresses, CIDR blocks, and domain names.
Overview
Capabilities:
- Block malicious connections
- Intercept DNS queries
- Enforce zero-trust policies
- Log blocked traffic attempts
Default Location
bash
/etc/jibril/netpolicy.yamlOr the one specified in the configuration file.
Configuration Structure
yaml
network_policy:
# Default action: allow | deny
policy: allow
# Always allow these (optional)
allow:
- 127.0.0.0/8 # CIDR blocks
- 8.8.8.8 # IP addresses
- google.com # Domain names
# Always deny these (optional)
deny:
- 192.168.100.0/24 # CIDR blocks
- example.com # Domain namesPolicy Modes
Allow by Default
Allow all traffic by default, deny specific rules.
yaml
network_policy:
policy: allow
deny:
- malware-domain.com
- 203.0.113.0/24Use case: Most production environments Behavior: Traffic allowed unless explicitly denied
Deny by Default
Block all traffic by default, allow specific rules.
yaml
network_policy:
policy: deny
allow:
- 127.0.0.0/8
- 10.0.0.0/8
- trusted-api.comUse case: Zero-trust network model Behavior: Traffic blocked unless explicitly allowed
Rule Types
CIDR Blocks
IP address ranges.
yaml
allow:
- 127.0.0.0/8 # Localhost
- 192.168.0.0/16 # Private networks
- 10.0.0.0/8 # Private networks
- ::1/128 # IPv6 localhostIP Addresses
Specific IPv4 or IPv6 addresses.
yaml
deny:
- 203.0.113.5 # Specific IPv4
- 8.8.8.8 # DNS servers
- 2001:db8::1 # Specific IPv6Domain Names
Domain-based blocking.
yaml
deny:
- malware-site.com
- phishing-domain.net
- suspicious-tracker.orgJibril intercepts DNS queries and enforces policy at kernel level for the resolved IPs, as soon as they are known (this is a synchronous operation).
Rule Precedence
Explicit Rules Override Default
yaml
network_policy:
policy: allow
deny:
- 8.8.8.8 # Blocked despite default allowCIDR Specificity
More specific CIDR rules override broader ones.
yaml
allow:
- 192.168.0.0/16 # Allow entire range
deny:
- 192.168.1.100 # Block specific IP (takes precedence)Common Configurations
Standard Protection
Allow by default, block known threats.
yaml
network_policy:
policy: allow
allow:
# Internal networks
- 127.0.0.0/8
- 192.168.0.0/16
- 10.0.0.0/8
- 172.16.0.0/12
# DNS servers
- 8.8.8.8
- 1.1.1.1
deny:
# Known malicious domains
- malware-domain.com
- phishing-site.net
- cryptominer-pool.orgZero-Trust Mode
Deny by default, allow only trusted destinations.
yaml
network_policy:
policy: deny
allow:
# Localhost
- 127.0.0.0/8
# Internal infrastructure
- 10.0.1.0/24
- 10.0.2.0/24
# Trusted external services
- trusted-api.company.com
- cdn.example.com
- github.comEnable Network Policy
Configuration File
yaml
# /etc/jibril/config.yaml
features:
- netpolicy
feature_options:
netpolicy:
file: /etc/jibril/netpolicy.yaml
events:
- dropip # Log blocked connectionsPolicy Events
dropip Event
Generated whenever IP connection is blocked by policy.
What the dropip event contains
- The process that caused the block.
- The blocked IP address.
- The destination domain (if applicable).
- The source process information.
- All the process tree information.
- All files opened by the process.
And more...
Use Cases
Malware C2 Blocking
Block command-and-control servers.
yaml
deny:
- malware-c2.example.com
- 203.0.113.0/24 # Known C2 IP rangePhishing Protection
Block phishing domains.
yaml
deny:
- phishing-site.net
- fake-bank.com
- typosquatted-domain.orgData Loss Prevention
Control outbound connections.
yaml
policy: deny
allow:
- 10.0.0.0/8 # Internal only
- approved-saas.com # Approved servicesNetwork Segmentation
Enforce zero-trust segmentation.
yaml
policy: deny
allow:
- 10.0.1.0/24 # Database subnet
- 10.0.2.0/24 # API subnetBest Practices
Recommended
- Start with policy: allow to understand traffic patterns
- Always allow localhost and internal networks
- Allow your own IP addresses
- Allow necessary DNS servers
- Use threat intelligence feeds for deny lists
- Test policy changes in staging first
- Document each rule's purpose
- Monitor dropip events regularly
Avoid
- Using policy: deny without thorough testing
- Blocking internal networks accidentally
- Forgetting to allow DNS servers
- No documentation of deny rules
- Overly restrictive rules breaking applications
- Deploying to production without staging tests
- Ignoring dropip event patterns
Integration with Detections
Jibril includes 2 million+ malicious domains in built-in detection recipes. Those are generation-only; to block them at the network level, custom reactions can be programmed to do so. See reactions documentation for more information.