Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "Apply a filter to a policy" section #450

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions docs/cnspec/cnspec-policies/write/filters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,47 +54,6 @@ groups:

Unless the asset is an AWS compute service, cnspec skips all the checks and queries in this group when scanning the asset.

## 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 />{" "}

## More examples of filters

This filter limits scans to only GCP projects:
Expand Down
Loading