Support disabling deletion of certain CVEs #100
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
--disable-cve-2021-45105-detection
and--disable-cve-2021-44832-detection
flags have been added to the delete command to allow for deleting only findings that map to certain CVEs. The solution has been done in this manner so that the flags remain the same across thecrawl
anddelete
subcommands, although it would probably be cleaner to implement a flag of the form--include-cve
or--ignore-cve
which could be an additive or subtractive CVE list. This change would not be hard to do and I'm happy to do that if we are willing to either make break or maintain some deprecated flag values.Changes include:
crawl
anddelete
and a CVEResolver type that can be configured to ignore CVE-2021-45105 and CVE-2021-44832.VersionMatch
to theDeleter
which will block deletion of a finding unless the VersionMatch function resolves to true.Log4JVersion
to make the codepaths more understandable when it comes to handling of unknown or invalid versions.Reporter.Report
method, the original behaviour has been maintained, where strings containing"unknown version - unknown CVE status"
and"invalid version - unknown CVE status"
can still be populated in thecvesFound
slice. I kept this here to maintain backwards compatibility but I am not opposed to making some simple changes here as I find this behaviour a little confusing tbh.