CLI Reference#
InfraGuard ships a Click-based CLI. All commands accept -c / --config <path> to specify the config file.
Top-Level Commands#
infraguard --help
infraguard --version
infraguard run Start the redirector
infraguard dashboard Start the dashboard standalone
infraguard command-post Multi-instance aggregator dashboard
infraguard tui Launch the terminal UI
infraguard config Config management subcommands
infraguard token Token management subcommands
infraguard api Query the management API
infraguard profile C2 profile utilities (parse, convert, transpile)
infraguard decoy Decoy-site management (industries, generate)
infraguard simulate-beacon Fire a profile-shaped request through the pipeline
infraguard drop-preview Render the drop response without sending traffic
infraguard events tail Stream tracking DB events as JSON lines
infraguard test-request Dry-run a request through the filter pipeline
infraguard report Generate an HTML engagement report
infraguard ingest Ingest .htaccess / robots.txt into blocklists
infraguard validate Validate an InfraGuard config file
infraguard generate Generate nginx / caddy / apache config
infraguard deploy Provision and destroy redirector infrastructure
infraguard rotate Blue-green infrastructure rotation
infraguard schedule Manage automated rotation policies
infraguard preflight Adversary-emulation self-test (nmap / nuclei / curl)
infraguard wizard Interactive wizards for common tasks
infraguard completions Output shell completion scriptsinfraguard run#
Start the redirector.
infraguard run --config config/config.yaml
infraguard run -c config/config.yaml --log-level DEBUG| Flag | Default | Description |
|---|---|---|
-c / --config | config.yaml | Path to config file |
--log-level | INFO | Logging level (DEBUG, INFO, WARNING, ERROR) |
--reload | off | Enable hot reload on config file change |
--ollama-url | (env: INFRAGUARD_OLLAMA_URL) | Ollama API URL for the AI assistant |
infraguard dashboard#
Start the dashboard as a standalone web server, separate from the proxy.
infraguard dashboard -c config.yaml
infraguard dashboard -c config.yaml --ollama-url http://localhost:11434| Flag | Default | Description |
|---|---|---|
-c / --config | config.yaml | Path to config file |
--ollama-url | (env: INFRAGUARD_OLLAMA_URL) | Ollama API URL for the AI assistant |
When running standalone, set INFRAGUARD_PROXY_API so the dashboard can forward config mutations (profile hot-swaps, domain changes) to the proxy.
infraguard config#
Config management. All mutating commands write a .bak backup before modifying.
config show#
infraguard config show -c config.yaml
infraguard config show -c config.yaml --section pipeline
infraguard config show -c config.yaml --section domainsconfig set#
Set an arbitrary config value by dotted path:
infraguard config set pipeline.block_score_threshold 0.65 -c config.yaml
infraguard config set logging.level DEBUG -c config.yamlinfraguard config domain#
Domain management subcommands.
infraguard config domain list -c config.yaml
infraguard config domain add phish.example.com -c config.yaml
infraguard config domain remove phish.example.com -c config.yaml
infraguard config domain set-upstream cdn.example.com https://10.0.0.1:443 -c config.yaml
infraguard config domain set-drop cdn.example.com redirect https://jquery.com -c config.yamldomain add-route#
Add a content route to a domain:
infraguard config domain add-route cdn.example.com \
--path "/assets/update.js" \
--backend-type mythic_file \
--backend-target "https://10.0.0.1:7443" \
--file-id "${MYTHIC_STAGE2_FILE_ID}" \
--require-beacon-ip \
--require-token \
--rate-limit 1 3600 \
-c config.yamldomain remove-route#
infraguard config domain remove-route cdn.example.com "/assets/update.js" -c config.yamldomain list-routes#
infraguard config domain list-routes cdn.example.com -c config.yamlinfraguard config intel#
Intel and blocklist management.
# Show current intel config
infraguard config intel show -c config.yaml
# Country blocking
infraguard config intel block-country RU -c config.yaml
infraguard config intel unblock-country RU -c config.yaml
infraguard config intel allow-country US -c config.yaml # explicit allowlist
infraguard config intel unallow-country US -c config.yaml
# ASN blocking
infraguard config intel block-asn 15169 -c config.yaml # Google
infraguard config intel unblock-asn 15169 -c config.yaml
# IP blocking
infraguard config intel block-ip 1.2.3.4 -c config.yamlinfraguard config pipeline#
Pipeline filter management.
# Show pipeline config
infraguard config pipeline show -c config.yaml
# Enable/disable filters
infraguard config pipeline enable sandbox_filter -c config.yaml
infraguard config pipeline disable replay_filter -c config.yaml
# Set score threshold
infraguard config pipeline set-threshold 0.65 -c config.yaml
# JA3 management
infraguard config pipeline ja3 block e7d705a3286e19ea42f587b344ee6865 -c config.yaml
infraguard config pipeline ja3 unblock e7d705a3286e19ea42f587b344ee6865 -c config.yaml
infraguard config pipeline ja3 allow b386946a5a44d1ddcc843bc75336dfce -c config.yaml # add to allowlist
infraguard config pipeline ja3 list -c config.yamlinfraguard token#
Payload token management.
# List all issued tokens
infraguard token list -c config.yaml
# Revoke a token
infraguard token revoke <token-hex> -c config.yaml
# Manually issue a token for an IP
infraguard token issue 10.0.0.5 -c config.yaml
# Generate an HMAC campaign token
infraguard token generate --secret $HMAC_SECRET --ttl 604800infraguard api#
Query the management API (must be running).
# Request log
infraguard api requests -c config.yaml
infraguard api requests --limit 50 --domain cdn.example.com -c config.yaml
infraguard api requests --blocked-only -c config.yaml
# Whitelist
infraguard api whitelist -c config.yaml
infraguard api whitelist add 10.0.0.5 -c config.yaml
infraguard api whitelist remove 10.0.0.5 -c config.yaml
# Blocklist
infraguard api blocklist -c config.yaml
infraguard api blocklist add 1.2.3.4 -c config.yaml
# Burn indicators
infraguard api burns -c config.yamlinfraguard deploy#
Provision, destroy, and manage redirector infrastructure. See Deployment for full guides.
deploy run#
infraguard deploy run \
--domain cdn.example.com \
--upstream https://10.0.0.5:8443 \
--provider do \
--engine pulumi \
--c2-profile profiles/jquery.profile \
--ssh-key ~/.ssh/id_ed25519.pub \
--operator-ip 1.2.3.4/32| Flag | Default | Description |
|---|---|---|
--domain | (required) | Domain for the redirector |
--upstream | (required) | C2 teamserver URL |
--provider | (required) | Cloud provider (do, aws, azure, hetzner, cloudflare) |
--engine | terraform | IaC engine (terraform or pulumi) |
--c2-profile | (required) | Path to C2 profile file |
--ssh-key | (required) | Path to operator SSH public key |
--operator-ip | (required) | Operator IP in CIDR notation |
--region | provider default | Cloud region |
--instance-size | provider default | Instance type/size |
--state-key | (none) | age public key for encrypting Terraform state |
deploy destroy#
infraguard deploy destroy --engine terraform
infraguard deploy destroy --engine pulumi| Flag | Default | Description |
|---|---|---|
--engine | terraform | IaC engine (terraform or pulumi) |
infraguard completions#
Output shell completion scripts for bash, zsh, or fish.
infraguard completions bash
infraguard completions zsh
infraguard completions fish
infraguard completions # auto-detect from $SHELL| Argument | Description |
|---|---|
shell | Shell type: bash, zsh, or fish. Auto-detected if omitted. |
See Shell Completions for installation instructions.
infraguard profile#
C2 profile utilities.
# Parse and show normalized profile
infraguard profile parse --type cobalt_strike profiles/my.profile
infraguard profile parse --type mythic profiles/mythic-httpx.json
infraguard profile parse --type nighthawk profiles/nighthawk.json
infraguard profile parse --type poshc2 profiles/config.yaml
# Validate profile against a sample request
infraguard profile validate --type cobalt_strike profiles/my.profile \
--method GET --path "/jquery-3.7.1.min.js" \
--header "X-Requested-With: XMLHttpRequest"
# Transpile a profile between C2 frameworks (via the shared IR)
infraguard profile transpile \
--from-kind cobalt_strike --to-kind mythic_http \
--in cs.profile --out mythic.jsonprofile transpile#
Convert a profile between frameworks using the shared IR added in v0.5.
Native emitters exist for cobalt_strike, sliver, and mythic_http.
Any other target kind falls back to InfraGuard’s own JSON with a header
comment naming the intended target.
| Flag | Description |
|---|---|
--from-kind | Source profile kind (cobalt_strike, mythic, sliver, …) |
--to-kind | Target profile kind |
--in | Source profile file |
--out | Output path (default: stdout) |
--name | Override profile name in the output |
infraguard simulate-beacon#
Introduced in v0.5. Constructs a fully profile-shaped request (headers, cookie, transforms) and pushes it through the router. Prints the pipeline verdict plus a per-filter breakdown so you can see exactly which invariant a beacon would fail.
infraguard simulate-beacon -c config.yaml --domain cdn.example.com
infraguard simulate-beacon -c config.yaml --domain cdn.example.com --verb POST --body-size 512| Flag | Default | Description |
|---|---|---|
-c / --config | required | Config file path |
--domain | required | Target domain (must be in config) |
--verb | GET | Which transaction to mirror (GET or POST) |
--ip | 203.0.113.42 | Simulated client IP |
--ja3 | none | Optional JA3 hash to inject |
--body-size | 64 | Bytes of fake beacon metadata to encode |
If the profile filter blocks the simulated beacon, the config’s
http_get / http_post transaction does not match what a real beacon of
that framework would send. Fix headers, cookie name, or transforms and
re-run.
infraguard drop-preview#
Render the drop response for a domain without sending traffic. Useful
when tuning drop_action (redirect / reset / decoy / tarpit / proxy).
infraguard drop-preview -c config.yaml --domain cdn.example.com
infraguard drop-preview -c config.yaml --domain cdn.example.com --body-preview 400| Flag | Default | Description |
|---|---|---|
-c / --config | required | Config file path |
--domain | required | Domain whose drop_action to preview |
--reason | preview | Reason string passed to handle_drop |
--body-preview | 200 | Bytes of body to print (0 to skip) |
infraguard events tail#
Stream tracking DB events as JSON lines to stdout. Pipe into jq or a
SIEM. Follows by default (poll interval configurable).
infraguard events tail -c config.yaml
infraguard events tail --db infraguard.db --filter-result block
infraguard events tail -c config.yaml | jq -c '{ts:.timestamp, d:.domain, r:.filter_reason}'| Flag | Default | Description |
|---|---|---|
-c / --config | none | Config file (reads tracking.db_path) |
--db | none | SQLite DB path (overrides config) |
-n / --limit | 20 | Trailing rows to emit before polling |
--follow / --no-follow | follow | Poll for new rows |
--interval | 1.0 | Poll interval in seconds |
--filter-result | none | Filter to allow, block, or suspect |
--domain | none | Filter to a single domain |
infraguard decoy#
Data-driven decoy site management (v0.5).
infraguard decoy industries # list available industries
infraguard decoy generate --industry banking -o pages/NewBankBlog/
infraguard decoy generate --industry healthcare -o pages/ClinicBlog/ --forceIndustry data files live under pages/_templates/industries/*.yaml.
Shipped: banking, financial, healthcare, hospital, infrashield.
Add a new industry by dropping a YAML file with the same schema in that
directory; the loader picks it up automatically.
infraguard wizard#
Interactive wizards for common tasks.
infraguard wizard init # step-through starter config
infraguard wizard deploy run # provision a new cloud redirector
infraguard wizard deploy rotate # rotate an existing redirector
infraguard wizard profile # convert a raw C2 profile to InfraGuard JSONEach prompt validates input and offers sensible defaults. Path prompts handle Windows-style paste (quoted paths from Explorer’s “Copy as path”, trailing whitespace, WSL / drive-letter mismatches) with clear diagnostics when a path does not exist.
infraguard command-post#
Start the multi-instance Command Post dashboard that aggregates stats, requests, and live events from several InfraGuard proxies.
infraguard command-post -c config/command-post.yaml
infraguard command-post --instance "prod|https://ig1:8080|TOKEN" \
--instance "dev|https://ig2:8080|TOKEN"| Flag | Description |
|---|---|
-c / --config | YAML config listing instances |
--instance | Inline instance `name |
--host / --port | Override bind address |
--ssl-cert / --ssl-key | Serve TLS with these certs |
infraguard tui#
Launch the terminal UI. Requires the tui extra (installs textual).
infraguard tui -c config.yaml
infraguard tui --url http://127.0.0.1:8080 --token $INFRAGUARD_API_TOKENinfraguard preflight#
Introduced in v0.5. Runs the local scanner suite (curl, nmap,
nuclei when installed) against a target and cross-references the
tracking DB to show which filter caught which probe. Writes a
Markdown report.
infraguard preflight --scan self -c config.yaml
infraguard preflight --target https://phish.example.com --db infraguard.db
infraguard preflight --scan self --out /tmp/preflight.md| Flag | Default | Description |
|---|---|---|
--scan | self | self targets https://127.0.0.1:443; target requires --target |
--target | none | Explicit URL (overrides --scan) |
-c / --config | none | Config file (used to resolve tracking DB path) |
--db | none | SQLite DB path (overrides config) |
-o / --out | infraguard-preflight.md | Report output path |
The report has one row per scanner (“ran” / “skipped: not installed”)
followed by a table cross-referencing every request the pipeline
handled during the scan with its filter verdict. Any probe with
verdict allow is a tuning bug worth investigating.