Report Results

Control how cnspec reports scan results, including terminal output formats, JSON, YAML, CSV, and JUnit for CI/CD integration.

cnspec supports a variety of output formats for scan results. Use the -o (or --output) flag to choose the format:

cnspec scan local -o FORMAT

Terminal formats

These formats are designed for reading results directly in the terminal.

compact (default)

The default output format. It shows a summary of each policy with pass/fail counts and an overall score:

cnspec scan local

full

Shows detailed results for every check in every policy, including descriptions and remediation steps:

cnspec scan local -o full

summary

Shows a high-level overview with scores per policy:

cnspec scan local -o summary

report

Shows a formatted report suitable for sharing:

cnspec scan local -o report

Machine-readable formats

These formats are useful for automation, scripting, and integration with other tools.

json

Exports results as JSON. Use shell redirection to save to a file:

cnspec scan local -o json > results.json

For example, to scan a Kubernetes cluster and save the results:

cnspec scan k8s -o json > k8s-results.json

cnspec also supports json-v1 and json-v2 format variants. Use json (the default variant) unless you have a specific need for a particular schema version.

yaml

Exports results as YAML:

cnspec scan local -o yaml > results.yaml
Like JSON, cnspec also supports yaml-v1 and yaml-v2 variants.

csv

Exports results as comma-separated values, useful for importing into spreadsheets or data analysis tools:

cnspec scan local -o csv > results.csv

CI/CD integration

junit

Exports results in JUnit XML format, which most CI/CD platforms (GitHub Actions, GitLab CI, Jenkins, CircleCI) can parse to display test results:

cnspec scan local -o junit > results.xml

Save results to a file or AWS SQS

As an alternative to shell redirection, you can use the --output-target flag to write results directly to a local file or send them to an AWS SQS queue:

cnspec scan local -o json --output-target results.json
cnspec scan local -o json --output-target https://sqs.us-east-1.amazonaws.com/123456789/my-queue

View results in the Mondoo Console

When cnspec completes a scan, it provides a link to the Mondoo Console, where you can view graphical results.

You must register cnspec to see results in the Mondoo Console. To learn more, read Register cnspec with Mondoo Platform.

Results in the Mondoo Console

To open printer-friendly results in a new browser tab, select the print icon near the top-right corner of the Mondoo Console.

On this page