View and Share a Scan Report in a Web Browser
Each time you use the cnspec CLI to run a scan, you have the option of viewing and sharing the results in a browser-based report:
Do you want to view or share these scan results in a browser using
Mondoo's reporting service?" [Y/n]
Enter y
to tell cnspec to make your scan results available in a report that you and others can access using a web browser. cnspec provides a unique URL for your report.
The report gives you a rich and detailed view of your scan results, including a list of checks and policies, scores, a letter grade, and remediation advice. Informative visuals make it easy to understand the security and compliance posture of your IT infrastructure.
For 72 hours, the report remains available to anyone with the URL. After that, Mondoo removes the report.
This feature only works if cnspec is not registered with Mondoo Platform. If cnspec is registered with Mondoo Platform, scan reports are always available in the Mondoo Console.
To see the policy or policies on which cnspec based the scan, select the Policies tab. To see the individual checks that cnspec made against the scanned asset, select the Checks tab.
Skip the report prompt
By default, cnspec prompts you about the browser-based report after each scan you run from the CLI. You can control when you want to see the prompt.
Use this flag to skip the prompt and create a web-based report:
cnspec scan --share-report
Use this flag to skip the prompt and not create a web-based report:
cnspec scan --share-report=false
Set the default for a session
You can set an environment variable to tell cnspec to always or never create a web-based report for the remainder of your shell session. With an environment variable set, cnspec doesn't prompt after a scan.
To always create a web-based report and provide a link after a scan, enter this command:
export MONDOO_SHARE_REPORT=true
To never create a web-based report after a scan, enter this command:
export MONDOO_SHARE_REPORT=false
Set a persistent default in the configuration
Add an option to the cnspec configuration to skip the prompt and always or never create a web-based report.
On a Linux or macOS host, cnspec configuration is stored in one of these locations:
/etc/opt/mondoo/mondoo.yml
configures cnspec for all user accounts.~/.config/mondoo/mondoo.yml
configures cnspec for a single user.
On a Windows host, cnspec configuration is stored in one of these locations:
C:\ProgramData\mondoo\mondoo.yml
configures cnspec for all users.C:\Users\{username}\.config\mondoo\mondoo.yml
configures cnspec for a single user.
To configure cnspec to never prompt and always create a web-based report, set the configuration:
share_report: true
To configure cnspec to never prompt and never create a web-based report, set the configuration:
share_report: false
The --share-report
command flag overrides the environment variable, which overrides the configuration.
Mondoo Platform
For far more capabilities, more policies, and easy, browser-based management, log into Mondoo Platform.