-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Problem:** As a developer of policies I want to verify that my developed bundle meets the requirements and conforms to best-practices. **Solution:** The new `cnspec bundle lint` command (previously called `cnspec bundle validate` ships with a set of rules: - "MQL compile error" - "UID is not valid" - "Missing policy UID" - "Missing policy name" - "No unique policy UID" - "Policy is missing checks" - "Assigned query missing" - "Policy version is missing" - "Policy version is wrong" - "Missing query UID" - "Missing query title" - "No unique query UID" - "Unassigned Query" A major improvement compared to the previous implementation is the detection of file name and line number. The allows the output to highlights the rule id and message with the file and line number. To see the new linting output, just run: ``` cnspec bundle lint policy.mql.yaml ``` The new `cnspec bundle lint` also allows users to export the output as sarif with the `-o sarif` option. Best is to pipe the output into a file: ``` cnspec bundle lint -o sarif --output-file report.sarif policy.mql.yaml ``` The report can then be viewed in Visual Studio Code and the [Sarif Extension](https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer) We also improved renamed `cnspec bundle upload` to `cnspec bundle publish`.
- Loading branch information
1 parent
f32ec5c
commit 3aeec4d
Showing
20 changed files
with
1,211 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.