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 # note trims the note off foo
  • A [group] header switches subsequent lines into a named bucket (used by cloud_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/reload

Custom 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:ro

If the directory is missing or unreadable, InfraGuard falls back to the Python constants (identical to the historical behavior).

Consumers#

Rules fileConsumed by
banned_ips.txtIntelManager
scanner_cidrs.txtIntelManager (SECURITY_VENDOR_CIDRS)
cloud_cidrs.txtIntelManager (CLOUD_PROVIDER_CIDRS)
scanner_uas.txtBotFilter
banned_rdns.txtDNSFilter
banned_headers.txtHeaderFilter
ja3_blocklist.txtTLSFilter