Rules Directory#
Added in v0.5. Earlier InfraGuard releases shipped every scanner CIDR, bot
User-Agent, JA3 hash, and rDNS / header keyword hard-coded in Python.
Updating a signature meant a code release. As of v0.5 those lists
live in rules/*.txt at the repo root and are loaded from disk with
Python constants as a fallback.
Layout#
rules/
├── banned_ips.txt # plain IP/CIDR blocklist (was the only file pre-v0.5)
├── banned_headers.txt # request header value keyword blocklist
├── banned_rdns.txt # rDNS hostname keyword blocklist
├── cloud_cidrs.txt # grouped by [aws_common] / [azure_common] / ...
├── ja3_blocklist.txt # one MD5 hex per line
├── scanner_cidrs.txt # Shodan, Censys, Rapid7, Palo Alto, ...
└── scanner_uas.txt # sqlmap, Burp, nmap, curl, ...Format#
- One entry per line
- Blank lines and lines starting with
#are ignored - An inline
foo # notetrims the note offfoo - A
[group]header switches subsequent lines into a named bucket (used bycloud_cidrs.txt)
Reload without a code release#
Edit the file, then either:
# option A: send SIGHUP to the proxy
docker compose kill -s HUP proxy
# option B: hit the dashboard reload endpoint
curl -X POST -H "Authorization: Bearer $INFRAGUARD_API_TOKEN" \
https://your-dashboard/api/intel/reloadCustom rules directory#
Override the location with the INFRAGUARD_RULES_DIR environment
variable:
services:
proxy:
environment:
- INFRAGUARD_RULES_DIR=/etc/infraguard/rules
volumes:
- /etc/infraguard/rules:/etc/infraguard/rules:roIf the directory is missing or unreadable, InfraGuard falls back to the Python constants (identical to the historical behavior).
Consumers#
| Rules file | Consumed by |
|---|---|
banned_ips.txt | IntelManager |
scanner_cidrs.txt | IntelManager (SECURITY_VENDOR_CIDRS) |
cloud_cidrs.txt | IntelManager (CLOUD_PROVIDER_CIDRS) |
scanner_uas.txt | BotFilter |
banned_rdns.txt | DNSFilter |
banned_headers.txt | HeaderFilter |
ja3_blocklist.txt | TLSFilter |