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 scripts

infraguard run#

Start the redirector.

infraguard run --config config/config.yaml
infraguard run -c config/config.yaml --log-level DEBUG
FlagDefaultDescription
-c / --configconfig.yamlPath to config file
--log-levelINFOLogging level (DEBUG, INFO, WARNING, ERROR)
--reloadoffEnable 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
FlagDefaultDescription
-c / --configconfig.yamlPath 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 domains

config 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.yaml

infraguard 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.yaml

domain 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.yaml

domain remove-route#

infraguard config domain remove-route cdn.example.com "/assets/update.js" -c config.yaml

domain list-routes#

infraguard config domain list-routes cdn.example.com -c config.yaml

infraguard 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.yaml

infraguard 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.yaml

infraguard 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 604800

infraguard 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.yaml

infraguard 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
FlagDefaultDescription
--domain(required)Domain for the redirector
--upstream(required)C2 teamserver URL
--provider(required)Cloud provider (do, aws, azure, hetzner, cloudflare)
--engineterraformIaC 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
--regionprovider defaultCloud region
--instance-sizeprovider defaultInstance type/size
--state-key(none)age public key for encrypting Terraform state

deploy destroy#

infraguard deploy destroy --engine terraform
infraguard deploy destroy --engine pulumi
FlagDefaultDescription
--engineterraformIaC 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
ArgumentDescription
shellShell 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.json

profile 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.

FlagDescription
--from-kindSource profile kind (cobalt_strike, mythic, sliver, …)
--to-kindTarget profile kind
--inSource profile file
--outOutput path (default: stdout)
--nameOverride 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
FlagDefaultDescription
-c / --configrequiredConfig file path
--domainrequiredTarget domain (must be in config)
--verbGETWhich transaction to mirror (GET or POST)
--ip203.0.113.42Simulated client IP
--ja3noneOptional JA3 hash to inject
--body-size64Bytes 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
FlagDefaultDescription
-c / --configrequiredConfig file path
--domainrequiredDomain whose drop_action to preview
--reasonpreviewReason string passed to handle_drop
--body-preview200Bytes 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}'
FlagDefaultDescription
-c / --confignoneConfig file (reads tracking.db_path)
--dbnoneSQLite DB path (overrides config)
-n / --limit20Trailing rows to emit before polling
--follow / --no-followfollowPoll for new rows
--interval1.0Poll interval in seconds
--filter-resultnoneFilter to allow, block, or suspect
--domainnoneFilter 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/ --force

Industry 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 JSON

Each 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"
FlagDescription
-c / --configYAML config listing instances
--instanceInline instance `name
--host / --portOverride bind address
--ssl-cert / --ssl-keyServe 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_TOKEN

infraguard 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
FlagDefaultDescription
--scanselfself targets https://127.0.0.1:443; target requires --target
--targetnoneExplicit URL (overrides --scan)
-c / --confignoneConfig file (used to resolve tracking DB path)
--dbnoneSQLite DB path (overrides config)
-o / --outinfraguard-preflight.mdReport 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.