cnspec run
Run an MQL query
Synopsis
Run an MQL query on the CLI and displays its results.
cnspec run [flags]
Options
--ask-pass Prompt for connection password.
--ast Parse the query and return the abstract syntax tree (AST).
-c, --command string MQL query to execute.
--discover string Enable the discovery of nested assets. Supports: 'all|auto|instances|host-instances|host-machines|container|container-images|pods|cronjobs|statefulsets|deployments|jobs|replicasets|daemonsets' (default "auto")
--discover-filter stringToString Additional filter for asset discovery. (default [])
-h, --help help for run
--host-machines Also scan host machines like ESXi servers.
-i, --identity-file string Select the file from which to read the identity (private key) for public key authentication.
--insecure Disable TLS/SSL checks or SSH hostkey config.
--instances Also scan instances. This only applies to API targets like AWS, Azure or GCP.
-j, --json Run the query and return the object in a JSON structure.
--option --option key=value Additional connection options. You can pass in multiple options using --option key=value (default [])
--parse Parse the query and return the logical structure.
-p, --password string Connection password (such as for ssh/winrm).
--path string Path to a local file or directory for the connection to use.
--platform-id string Select a specific target asset by providing its platform ID.
--sudo Elevate privileges with sudo.
Options inherited from parent commands
--config string Set config file path (default $HOME/.config/mondoo/mondoo.yml)
--log-level string Set log level: error, warn, info, debug, trace (default "info")
-v, --verbose Enable verbose output
SEE ALSO
- cnspec - cnspec CLI
- cnspec run arista -
- cnspec run aws -
- cnspec run azure -
- cnspec run container -
- cnspec run docker -
- cnspec run gcp -
- cnspec run github -
- cnspec run gitlab -
- cnspec run google-workspace -
- cnspec run host -
- cnspec run k8s -
- cnspec run local -
- cnspec run mock -
- cnspec run ms365 -
- cnspec run okta -
- cnspec run slack -
- cnspec run ssh -
- cnspec run terraform -
- cnspec run vagrant -
- cnspec run vcd -
- cnspec run vsphere -
- cnspec run winrm -