GeoIP
GeoIP integration
What it does
Maps source IPs to ISO country codes and applies GEOIP_BLOCK / GEOIP_ALLOW rules. Lookup is admin-only (POST /api/v1/geoip/lookup). Agents can pull config/database for local detection.
Edition
SHARED. Enterprise writes may be license-gated.
Prerequisites
- Manager with
security.geoipconfigured - MaxMind or DB-IP MMDB file at
database_path - Optional MaxMind account id + license key for auto-update
- Admin JWT for API
Required permissions / credentials
- Filesystem read of the MMDB
- MaxMind license key if
auto_update(secret) - Admin role for rule CRUD and lookup
Configuration
security.geoip.*: enabled, database_type (maxmind or db-ip), database_path, maxmind_account_id, maxmind_license_key, update_interval, auto_update, cache_size, allow_on_lookup_failure.
Agent: geoip.enabled / geoip.database_path for local DB, or pull via Agent sync APIs.
Setup
- Place MMDB on the Manager host; set
database_path. - Set
enabled: true; keep license key in systemd credentials. - Restart Manager.
- Create a rule:
{"rule_type":"GEOIP_BLOCK","country_code":"CN","action":"block","enabled":true,"scope":"global"}- Lookup a documentation IP:
{"ip":"203.0.113.10"}(may be unallocated; use a known public IP in lab only if policy allows).
Verification
GET /api/v1/geoip/settings→database_statusloadedorerrorGET /api/v1/geoip/status→enabled,database_loaded,rules_countGET /api/v1/geoip/ruleslists countries
Settings probe uses lookup of 8.8.8.8 internally to test DB load.
Expected signals / results
Blocked countries generate GeoIP-related security logs on enforcement Agents after sync. allow_on_lookup_failure fail-opens on DB errors.
Failure modes
Scroll sideways to see the full table. Use the arrow keys when focused.
| Symptom | Meaning |
|---|---|
| 503 GeoIP service not available | lookup service nil |
| 503 GeoIP lookup failed | DB missing/corrupt |
| 400 country code | not 2-letter ISO |
database_status: not_loaded | path/permissions |
Troubleshooting
- Confirm file readable by
zwall-manager - Disable auto-update if MaxMind HTTP is blocked
- Agents:
GET /api/v1/agent-geoip-databasewith Agent JWT
Security considerations
Lookup is admin-only. Do not publish it as an unauthenticated geolocation API. License keys are secrets. Account id may appear in settings JSON.
Limitations
- Not a full MaxMind Insights product
- Country rules are coarse; RFC1918 lookups depend on DB content
- No published accuracy SLA