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

docs: add info on adding compliance checks #6275

Merged
merged 15 commits into from May 22, 2024

Conversation

AnaisUrlichs
Copy link
Member

Adding documentation to the contributing section on writing Compliance Checks

@AnaisUrlichs AnaisUrlichs changed the title WIP: docs: add info on adding compliance checks docs: add info on adding compliance checks Mar 6, 2024
mkdocs.yml Outdated Show resolved Hide resolved
docs/community/contribute/compliance.md Outdated Show resolved Hide resolved
docs/community/contribute/compliance.md Outdated Show resolved Hide resolved

Create a new file under `trivy-policies/specs/compliance/` and name the file in the format of "provider-resource-spectype-version.yaml". For example, the file name for AWS CIS Benchmarks for EKS version 1.4 is: `aws-eks-cis-1.4.yaml`.

### Minimum spec structure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO there's too much duplication with the general compliance documentation, this should be about how to upstream a compliance, not the complete guide to write a compliance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this relate to line 19 or to the minimum spec structure?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved some to the normal compliance documentation but I am thinking about the following instead:

  • divide the compliance docs into the following two separate sections in the table of content: built-in compliance and custom compliance. The custom compliance would then also detail how to contribute the custom compliance check to Trivy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this relate to line 19 or to the minimum spec structure?

Minimum spec structure (and what follows)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table of content: built-in compliance and custom compliance

not sure I understand how your suggestion is different than existing?
image

docs/community/contribute/compliance.md Outdated Show resolved Hide resolved
- `checks.id` -- Required; this is the AVD ID or AVD IDs referenced that perform the Rego check for this compliance check, more information is provided below.
- `severity` -- Required; more information provided below.

### Populating the `control` section
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's more to say about vulnerability checks and node checks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chen-keinan I need your help here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chen-keinan :) help

Copy link
Contributor

@chen-keinan chen-keinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnaisUrlichs look good, I have added few comments

docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
# Custom Compliance Checks

Trivy supports several different compliance checks. The details on compliance scanning with Trivy are provided in the [compliance documentation](../../docs/compliance/compliance.md).
All of the Compliance Checks currently available in Trivy can be found in the `trivy-policies/specs/compliance/` directory ([Link](https://github.com/aquasecurity/trivy-policies/tree/main/specs/compliance)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trivy-policies repo on github name has been changed to trivy-checks, change should apply to all references in doc

docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
Copy link
Contributor

@chen-keinan chen-keinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnaisUrlichs all entries where trivy-policies appear it should be replaced with trivy-checks

docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
```

- Again, the `id`, `name` and `description` are taken directly from the EKS CIS Benchmarks v1.4.0
- The `checks` is in this case `null` as the check is not currently present in the AVD and does not have a check in the [trivy policies](https://github.com/aquasecurity/trivy-policies/tree/main/checks) repository
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The `checks` is in this case `null` as the check is not currently present in the AVD and does not have a check in the [trivy policies](https://github.com/aquasecurity/trivy-policies/tree/main/checks) repository
- The `checks` is in this case `null` as the check is not currently present in the AVD and does not have a check in the [trivy policies](https://github.com/aquasecurity/trivy-checks/tree/main/checks) repository

docs/docs/compliance/contrib-compliance.md Outdated Show resolved Hide resolved
AnaisUrlichs and others added 10 commits May 20, 2024 15:08
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
Co-authored-by: chenk <hen.keinan@gmail.com>
@itaysk itaysk added this pull request to the merge queue May 22, 2024
Merged via the queue into aquasecurity:main with commit 28194e5 May 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants