-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove filter on policy level (#592)
- Loading branch information
1 parent
e093da6
commit 13c160c
Showing
2 changed files
with
43 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Removing this from the docs for now because we don't support it. However, we will support it soon. So I'm stashing this content in this file that DOES NOT GET COMPILED for safe keeping. | ||
|
||
## Apply a filter to a policy | ||
|
||
The policy in this bundle has a filter: | ||
|
||
<!-- prettier-ignore-start --> | ||
```yaml showLineNumbers | ||
policies: | ||
- uid: ssh-with-filter | ||
name: SSH policy that uses a filter | ||
|
||
... | ||
|
||
groups: | ||
- title: my-group | ||
checks: | ||
- uid: sshd-01 | ||
title: Ensure the port is set to 22 | ||
mql: sshd.config.params["Port"] == 22 | ||
impact: 30 | ||
|
||
- uid: sshd-02 | ||
title: Prevent weaker CBC ciphers from being used | ||
mql: sshd.config.ciphers.none( /cbc/ ) | ||
impact: 60 | ||
|
||
queries: | ||
- uid: sshd-d-1 | ||
title: Gather SSH config params | ||
mql: sshd.config.params | ||
|
||
filters: | ||
- mql: asset.family.contains('unix') | ||
``` | ||
<!-- prettier-ignore-end --> | ||
|
||
This bundle contains only one policy, `ssh-with-filter`. The section beginning on line 24 defines _filters_ for the policy. In this case, cnspec uses the policy to scan only assets that are based on UNIX (Linux distributions and macOS). | ||
|
||
import Partial from "./_include-lint.mdx"; | ||
|
||
<Partial />{" "} | ||
|
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