fix: Add Unmapped CWE/Finding Warnings to All Parsers#290
Open
TheAuditorTool wants to merge 1 commit intoOWASP-Benchmark:mainfrom
Open
fix: Add Unmapped CWE/Finding Warnings to All Parsers#290TheAuditorTool wants to merge 1 commit intoOWASP-Benchmark:mainfrom
TheAuditorTool wants to merge 1 commit intoOWASP-Benchmark:mainfrom
Conversation
Closes OWASP-Benchmark#7 18 parser files updated to print a console message when they encounter an unmapped vulnerability type or CWE number. No changes to scoring logic or return values — only console output added. Parsers that silently dropped findings now print WARNING. Parsers that silently passed CWEs through now print INFO. ShiftLeftReader: changed RuntimeException to warning + continue. HCLAppScanSourceReader: removed -DDEBUG gate on warnings. VisualCodeGrepperReader: uncommented existing warning println.
803b93d to
6970c9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add Unmapped CWE/Finding Warnings to All Parsers
Closes #7
What This Does
When a security tool reports a vulnerability type that a parser doesn't recognize, the parser should print a message so you know about it. Some parsers already did this, but others were silently discarding the finding. This update makes all parsers consistent: they all print a message now.
No scoring logic was changed. The only difference is that you'll see console messages when a parser encounters something new. The return values (what the scoring engine actually uses) are identical to before.
What You'll See in the Console
For parsers where the finding would be lost (returns 0 or -1):
For parsers where the finding survives but wasn't explicitly mapped (CWE passes through):
These messages tell you exactly which parser saw the new value and what that value is, so you can add the proper mapping when you're ready.
Files Changed (18 files, all in
score/parsers/)Parsers that were silently dropping findings (added WARNING)
Parsers that were silently passing CWEs through (added INFO)
Special cases
printlnthat was commented outthrow RuntimeExceptiontoprintln+return 0-DDEBUGgate on warningsWhat Was NOT Changed (and why)
Parsers that already warn properly (30 parsers) — no changes needed. These include: AcunetixReader, BurpReader, CASTAIPReader, CheckmarxIASTReader, ContrastAssessReader, CrashtestReader, FortifyReader, HorusecReader, InsiderReader, NJSScanReader, PMDReader, QualysWASReader, Rapid7Reader, ReshiftReader, SeekerReader, SemgrepReader, ShiftLeftScanReader, SnappyTickReader, SonarQubeJsonReader, SonarQubeReader, ThunderScanReader, WapitiReader, WapitiJsonReader, ZapJsonReader, and all SARIF-based readers.
Parsers with no CWE mapping (7 parsers) — these read the CWE number directly from the tool's output, so there's nothing to map and nothing to warn about: BlackDuckReader, FaastReader, FusionLiteInsightReader, JuliaReader, MendReader, NoisyCricketReader, ScnrReader.
Parsers from the original issue that no longer exist: HdivReader, LGTMReader, XanitizerReader, ShiftLeftNGSASTReader, ShiftLeftNGSASTReaderJSON. These were either removed or renamed since the issue was filed.
How to Verify
Run scorecard generation against any tool results you already have. The scorecards themselves will be identical — the only new output is console messages for unmapped values.