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(misconf): Reorganize misconfiguration scan pages #8206

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

simar7
Copy link
Member

@simar7 simar7 commented Jan 7, 2025

Description

This PR updates the structure of the misconfiguration scanning docs. Also adds more info on schemas.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@itaysk
Copy link
Contributor

itaysk commented Jan 8, 2025

@simar7 is this intentionally Draft or should we review it?

@simar7 simar7 marked this pull request as ready for review January 8, 2025 18:45
Copy link
Contributor

@nikpivkin nikpivkin left a comment

Choose a reason for hiding this comment

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

LGTM, left one small comment

@knqyf263 knqyf263 requested a review from itaysk January 10, 2025 16:32
@itaysk
Copy link
Contributor

itaysk commented Jan 13, 2025

yes I want to review it but I'll get to it only later this week

@simar7 simar7 force-pushed the update-schema-docs branch from 56345fd to 140fd10 Compare January 16, 2025 07:50
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this file deserves an e2e proof read. I cannot comment on lines outside of your changes, but a few things that caught my eye:

  1. the intro is important, can we please emphasize the motivation for using input schema and it's place in trivy misconfiguration scanning? it is mentioned in other places in the doc but should be first thing.
  2. the schema explorer text is added here but there are other places mentioning the avilable schemas. I think we should have an H2 of built-it schemas, which lists the schemas, the source, and the explorer.
  3. I think we should spend a few words on the "defsec schema" as a unified schema (motivation, implementation etc), as opposed to other more straightforward schemas (i.e docker, k8s)
  4. "policy schema" is a misnomer and should be renamed to "input schema"
  5. also "policy" is still prevalent here. should be "check"
  6. after the intro, the doc starts with "In Trivy we have been able to define a schema for a Dockerfile" we should clarify this is an example (or rewrite)

Copy link
Member Author

Choose a reason for hiding this comment

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

the intro is important, can we please emphasize the motivation for using input schema and it's place in trivy misconfiguration scanning? it is mentioned in other places in the doc but should be first thing.

I added that here how would you like to see it?

the schema explorer text is added here but there are other places mentioning the avilable schemas. I think we should have an H2 of built-it schemas, which lists the schemas, the source, and the explorer.

added.

I think we should spend a few words on the "defsec schema" as a unified schema (motivation, implementation etc), as opposed to other more straightforward schemas (i.e docker, k8s)

All schemas are equal in the sense that they are applicable to the resources that they scan. But I think you're trying to emphasize the common representation of variety of scan targets. I've added a small blurb about that here.

"policy schema" is a misnomer and should be renamed to "input schema"

thanks, fixed.

also "policy" is still prevalent here. should be "check"

thanks, fixed.

after the intro, the doc starts with "In Trivy we have been able to define a schema for a Dockerfile" we should clarify this is an example (or rewrite)

I rewrote this here 73af930

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can improve this doc while we are at it

  1. start with what is misconfiguration scanning before we jump to built-in vs custom checks? just a sentence or so will do.
  2. should explicitly mention the special "config" subcommand and it's purpose (compared to all other scanners which are target oriented)
  3. not sure the remaining headings are helpful now

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this comment for another place? We have the intro to misconfiguration scanning already mentioned at the beginning https://github.com/aquasecurity/trivy/pull/8206/files/30a4d8cd899bf48fa1c82554694de441b7784adb#diff-27a4cf648b57a6aad62225b17605a34b1e7b47b97925e1e24a311db4e22cc57fR1-R11

If not, can you describe what you'd like to see done differently?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think some of the configurations here are repeated in the "custom" section (or should be). wdyt about keeping this page for documenting only the basic usage with builtin checks, and concentrate all the the custom checks documentation (including cli usage/configuration from this page) in under the custom section?
I also don't think we need the "built-in" page under "policy". 1) policy is a misnomer 2) policy title applies alo to custom 3) there's just one page in this section.
so if you agree with this comment then the structure will look like:

  • Misconfiguration
    • Overview
    • Configuration
    • Builtin Checks
    • Custom Checks
      • pages about custom checks

docs/docs/scanner/misconfiguration/config/config.md Outdated Show resolved Hide resolved
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.

3 participants