Mondoo 8.0 is out!
π₯³ Mondoo 8.0 is out! This release includes a whole new policy experience, new SaaS integrations, and much more!β
Get this release: Installation Docs | Package Downloads | Docker Container
We are excited to announce Mondoo v8, the new major release of cnspec, cnquery, and Mondoo Platform.
π NEW POLICY EXPERIENCEβ
This release significantly improves policies and query packs by simplifying their structure and adding major new features like properties, variants, and embedded queries. We continue to keep the Mondoo upgrade process incredibly simple, so you donβt have to worry about moving to v8.
Policies and query packsβ
Problem: Some of our old fields were confusing to use. For example: query
defined the MQL query inside of the query with metadata. (Why use it twice?) The scoring_queries
and data_queries
inside policies were unnecessarily convoluted. And what were specs
?
policies
- specs:
- scoring_queries:
sshd-01:
- data_queries:
sshd-02:
queries:
- uid: sshd-01:
query: sshd.config.params["StrictModes"] == "yes"
- uid: sshd-02:
query: sshd.config.params
Solution: We have overhauled a lot of commonly used terms in policies and query packs. Queries now contain an mql
field to store the MQL snippet. Policies are now built around groups
that can generate chapters and contain checks
(which are scored) and queries
(which are not scored). Additionally, we have removed all instances of key-value maps (see sshd-01:
above) and replaced them with named fields (see - uid: sshd-01
below).
policies:
- groups:
- checks:
- uid: sshd-01
- queries:
- uid: sshd-02
queries:
- uid: sshd-01
mql: sshd.config.params["StrictModes"] == "yes"
- uid: sshd-02
mql: sshd.config.params
Problem: The old YAML files we used in cnspec and cnquery required users to create references for queries and checks to use them. This forced people to write policies and separately reference all queries they wanted to use. See the example above.
Solution: We have introduced embedded queries. Itβs now much easier to write policies that stand on their own. You donβt have to explicitly reference queries and checks anymore. Instead, you can embed queries and checks directly into the policy that describes them.
policies:
- groups:
- checks: # embedded query vv
- uid: sshd-01
mql: sshd.config.params["StrictModes"] == "yes"
- queries:
- uid: sshd-02
mql: sshd.config.params
If you want to re-use queries, you can continue to use them globally as well, as seen above. If you prefer not to set a uid
for any of these embedded queries and checks, cnspec generates one for you: Just run cnspec bundle format FILENAME
. Stable UIDs (and, in turn, MRNs) are still important for anyone who uses your policy and defines overrides, exceptions, or processes policy results.
Problem: The ability to override queries and checks was very limiting. You could only affect a limited number of fields and had to understand how these were referenced. (We will skip the example to avoid even more confusion.)
Solution: Making changes to individual queries is now simple and intuitive. For example, here is a globally shared query that is modified in a policy:
policies:
- groups:
- checks:
# reference the shared query and change its title and impact
- uid: sshd-01
title: Make sure to enforce StrictMode
impact: 80
queries:
- uid: sshd-01
mql: sshd.config.params["StrictModes"] == "yes"
impact: 50
Problem: Policies containing a lot of queries flooded users with an unstructured list of all of their contents. However, most policy documents arenβt written this way. Instead, they contain chapters and sections that group together checks and controls.
Solution: Policy groups now have a type
to specify their function. For example, the most common type in a policy is a chapter
:
policies:
- uid: policy1
groups:
- type: chapter
title: Kernel checks
docs:
desc: |
Long description about what kernel checks do...
checks:
- uid: kernel-check-01
...
Other types include import
(for referencing imported policies) and override
(for making changes to any policies, queries, and checks).
Propertiesβ
Properties are a way to make adjustments to existing queries in pre-defined ways. For example, you can change the list of allowed TLS ciphers to include ciphers you need or you can change the location of files that are tested.
Properties existed before v8, but werenβt exposed to users. With this release we make properties configurable in the CLI, with configuration in the UI to follow in the coming weeks.
Configuration
Policy authors can add properties to their queries in YAML using props
:
- uid: home-info
mql: file(props.home) { * }
title: Gather info about the user's home
props:
- uid: home
mql: |
"/home"
The uid
is required. It provides the name for accessing properties in MQL. These follow standards for identifiers (such as no spaces or control characters allowed).
CLI usage
By default, the query uses the configured property. If you want to adjust it, such as for the above example, you can use the --props
CLI argument:
cnspec scan -f examples/example.mql.yaml --props "home='/home/zero'"
Note: This example overwrites a string property. Doing this properly requires escaping the CLI arguments so they retain the quotation (β
) characters in MQL. Properties can be any MQL snippet, but must adhere to the expected type. For example: You can't overwrite a string property into a number.
Deprecationsβ
All deprecations will be supported throughout the lifetime of Mondoo v8. We will remove them when we release Mondoo v9.
-
With the new policy format established in this release, we are deprecating the old policy format. If you only use existing policies created and maintained by Mondoo, you donβt need to take any action. We are serving both v7 and v8 clients and will keep things compatible.
-
If you have written your own policies, these will automatically work with v7 and v8 clients after you upload them to the Policy Hub. To take advantage of the many simplifications and features we have added, we encourage you to convert your policies to v8 with this simple command:
cnspec bundle format FILE
The formatter in cnspec always store files in the latest format.
-
All public policies in our community repo will remain in the v7 format for a little longer. This is to support users who are still using v7 and manually downloading policy files. We will transition these policies throughout the v8 lifespan to allow some new capabilities, like configurable properties, context, and variants.