The Admin API provides powerful runtime control over Helios, including the ability to add/remove backends and change load balancing strategies. To secure this API, Helios supports multiple layers of protection.
All Admin API endpoints (except /v1/health) require a JWT token passed via the Authorization: Bearer <token> header.
Configuration:
admin_api:
enabled: true
port: 9091
auth_token: "your-secret-token-here"Usage:
curl -H "Authorization: Bearer your-secret-token-here" \
http://localhost:9091/v1/backends- Never use the default token
change-mein production - Use a strong, randomly generated token (minimum 32 characters)
- Rotate tokens regularly
- Store tokens securely (environment variables, secrets management)
IP filtering provides an additional layer of security by restricting Admin API access based on client IP addresses. This is particularly useful for:
- Restricting access to internal networks only
- Blocking known malicious IPs
- Implementing defense-in-depth security
IP filtering supports two types of lists:
- Allow List (Whitelist): Only specified IPs can access the API
- Deny List (Blacklist): Specified IPs are blocked from accessing the API
Example Configuration:
admin_api:
enabled: true
port: 9091
auth_token: "your-secret-token"
ip_allow_list:
- "127.0.0.1" # Allow localhost
- "192.168.1.0/24" # Allow local network
- "10.0.0.0/8" # Allow private network
ip_deny_list:
- "203.0.113.0/24" # Block specific subnet
- "198.51.100.50" # Block specific IP-
Deny List Priority: Deny list is checked first. If an IP matches the deny list, it's blocked immediately.
-
Allow List Logic:
- If
ip_allow_listis empty: All IPs are allowed (except those in deny list) - If
ip_allow_listis specified: Only IPs in the list are allowed
- If
-
CIDR Notation Support:
- Single IP:
192.168.1.100 - IPv4 CIDR:
192.168.1.0/24 - IPv6 CIDR:
2001:db8::/32 - Large subnets:
10.0.0.0/8
- Single IP:
-
Blocked Requests: Return HTTP 403 (Forbidden) with message "Forbidden: IP address not allowed"
admin_api:
ip_allow_list:
- "127.0.0.1"
- "::1" # IPv6 localhostadmin_api:
ip_allow_list:
- "10.0.0.0/8" # Private network
- "172.16.0.0/12" # Private network
- "192.168.0.0/16" # Private networkadmin_api:
ip_allow_list:
- "203.0.113.10" # Admin workstation 1
- "203.0.113.11" # Admin workstation 2
- "198.51.100.0/24" # Admin subnetadmin_api:
ip_deny_list:
- "203.0.113.0/24" # Known attack source
- "198.51.100.50" # Specific malicious IPadmin_api:
# Empty allow list = allow all
ip_deny_list:
- "203.0.113.0/24" # Block this subnetYou can test IP filtering using curl with different source IPs:
# Test from allowed IP (should succeed)
curl -H "Authorization: Bearer token" \
--interface 192.168.1.100 \
http://localhost:9091/v1/backends
# Test from blocked IP (should return 403)
curl -H "Authorization: Bearer token" \
--interface 10.0.0.1 \
http://localhost:9091/v1/backendsWhen an IP is blocked, Helios logs a warning message:
WRN IP blocked by filter client_ip=10.0.0.1 path=/v1/backends
This helps with:
- Security monitoring
- Debugging access issues
- Identifying potential attacks
- IP filtering uses efficient CIDR matching with
net.IPNet - Minimal overhead (microseconds per request)
- No impact on main proxy traffic (only affects Admin API)
- Scales well with large allow/deny lists
-
Use Both Authentication and IP Filtering: Combine JWT tokens with IP filtering for defense-in-depth
-
Principle of Least Privilege: Only allow IPs that need access
-
Regular Audits: Review and update IP lists regularly
-
Monitor Logs: Watch for blocked access attempts
-
Use HTTPS: Always use TLS for Admin API in production
-
Network Segmentation: Place Admin API on a separate network if possible
Check:
- Is your IP in the allow list?
- Is your IP in the deny list?
- Are you using the correct token?
- Check logs for "IP blocked by filter" messages
Solution:
# Check your current IP
curl ifconfig.me
# Add it to the allow list
admin_api:
ip_allow_list:
- "YOUR_IP_HERE"Remember: Deny list only works if the IP would otherwise be allowed. If you have an allow list, the IP must be in the allow list first before the deny list is checked.
admin_api:
enabled: true
port: 9091
auth_token: "use-a-strong-random-token-here-min-32-chars"
# Allow only internal network
ip_allow_list:
- "127.0.0.1" # Localhost
- "192.168.1.0/24" # Internal network
- "10.0.0.0/8" # VPN network
# Block known bad actors
ip_deny_list:
- "203.0.113.0/24" # Known attack subnet
- "198.51.100.50" # Specific malicious IP