-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat: add vulnerability report verifier #1173
feat: add vulnerability report verifier #1173
Conversation
1630608
to
80de33a
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1173 +/- ##
==========================================
+ Coverage 52.55% 54.46% +1.90%
==========================================
Files 101 103 +2
Lines 6349 6696 +347
==========================================
+ Hits 3337 3647 +310
- Misses 2690 2722 +32
- Partials 322 327 +5 ☔ View full report in Codecov by Sentry. |
17194ef
to
9275cb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks great overall! Left some clarification questions
plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidator.go
Show resolved
Hide resolved
Name: input.Name, | ||
IsSuccess: false, | ||
Message: fmt.Sprintf("vulnerability report validation failed: error validating maximum age:[%v]", err.Error()), | ||
}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to note VerifyReference can also return an error type, which might translate into a Plugin Error code. Tho i think it be cleaner return the validationError in the report, but we currently don't have a ERROR code that maps to TSG ( i will do the same in the SBOM verifier)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think external plugins should manage and document their own Error Codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we have no control on the 3rd party's plugins and cannot enforce the error code. Or maybe we can provide some common error codes to plugin developers?
Thanks @akashsinghal the video does help to understand the experience. The workflow for users to enable vuln policy is
One question: If users want to enable for example signature validation or another policy like SBOM, will they apply a different constraint and template? Will this PR include all the rules below?
|
Thanks for taking a look @yizha1
If they want to enable signature validation at the image level then yes they will need to apply a separate policy. Same goes with SBOM.
If the user wants to check ONLY for existence of report, they can apply Template + constraint and apply a vuln report verifier that does not specify any of the fields. This will essentially just do a schema check to make sure the report exists with a valid SARIF format. Currently, the sample template at |
plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidator.go
Outdated
Show resolved
Hide resolved
Name: input.Name, | ||
IsSuccess: false, | ||
Message: fmt.Sprintf("vulnerability report validation failed: error validating maximum age:[%v]", err.Error()), | ||
}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we have no control on the 3rd party's plugins and cannot enforce the error code. Or maybe we can provide some common error codes to plugin developers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm once the ci passes
c1b3f4e
7242c1c
to
497c82e
Compare
Description
What this PR does / why we need it:
MaximumAge
duration (ex: '24h')disallowedSeverity
levels (ex: 'critical')denylistCVEs
(ex:CVE-2021-44228
log4shell)passthrough
flag which will bypass all checks and append sarif content in verifier reportDocumentation PR here: ratify-project/ratify-web#35
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #1096
Type of change
Please delete options that are not relevant.
main
branch)How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration
Checklist:
Post Merge Requirements
Helm Chart Change