CLI Commands

cnquery scan

Use cnquery scan to collect data from an asset using one or more query packs and view the results. Unlike cnquery run, which executes a single query, cnquery scan runs a full set of queries defined in a query pack and gives you a structured report.

cnquery scan local

You can also specify a local query pack and run it without storing results in Mondoo Platform:

cnquery scan local -f bundle.mql.yaml --incognito

Scan a remote target over SSH:

cnquery scan ssh user@HOST

Options

      --annotation stringToString     Add an annotation to the asset (default [])
      --asset-name string             Override the asset name
      --detect-cicd                   Try to detect CI/CD environments. If detected, set the asset category to 'cicd' (default true)
  -h, --help                          help for scan
      --incognito                     Run in incognito mode. Do not report scan results to Mondoo Platform
      --inventory-file string         Set the path to the inventory file
      --inventory-format-ansible      Set the inventory format to Ansible
      --inventory-format-domainlist   Set the inventory format to domain list
  -j, --json                          Run the query and return the object in a JSON structure
  -o, --output string                 Set the output format: compact, csv, full, json, json-v1, json-v2, summary, yaml (default "compact")
      --platform-id string            Select a specific target asset by providing its platform ID
      --props stringToString          Set custom values for properties (default [])
      --querypack querypack-bundle    Set the query packs to execute. This requires querypack-bundle. You can specify multiple UIDs
  -f, --querypack-bundle strings      Set the path to a local query pack file
      --sudo                          Elevate privileges with sudo
      --trace-id string               Set a trace identifier

Options inherited from parent commands

      --api-proxy string   Set the proxy for communications with Mondoo Platform API
      --auto-update        Enable automatic provider installation and update (default true)
      --config string      Set config file path (default $HOME/.config/mondoo/mondoo.yml)
      --log-level string   Set the log level: error, warn, info, debug, trace (default "info")
  -v, --verbose            Enable verbose output

SEE ALSO

On this page