Conversation
Adds CogniumReader, its unit test, and a two-row test fixture for the Cognium SAST tool (https://cognium.dev / https://github.com/cogniumhq/cognium). Cognium emits results via: cognium scan <path> --format owasp-benchmark --output results.csv The CSV format uses a single comment/header line followed by one row per positive detection: # test name,category,CWE,real vulnerability BenchmarkTest00001,cmdi,78,true CogniumReader reads the CWE directly from column 2, so no category-to-CWE lookup table is needed. The reader is registered in Reader.allReaders() and verified by CogniumReaderTest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the earlier CSV-based approach with a proper SARIF reader. Cognium already outputs standard SARIF via --format sarif, so no new output format is needed in the tool itself. CogniumReader extends SarifReader with CweSourceType.CUSTOM, providing a static ruleId-to-CWE mapping for the 13 security sink types Cognium detects. Non-security findings (reliability, performance, etc.) have no mapping entry and are silently skipped by the base class. To generate results: cognium scan BenchmarkJava/src/ --format sarif --output Cognium.sarif Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@darkspirit510 - Can you review this when you get a chance and add a run script per these instructions to BenchmarkJava itself? |
darkspirit510
left a comment
There was a problem hiding this comment.
@davewichers looks good to me, just cosmetical comments 👍
|
@davewichers can we merge this one? |
Remove the command example (to be replaced by a BenchmarkJava script) and the verbose properties.cwe description (code is self-explanatory). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@coggiyadmin I used your script at OWASP-Benchmark/BenchmarkJava#453 and got the following warnings. Please add those to your mapping table. And since you have to edit it (would not have asked if there were no new mappings) please move the creation of the map to the constructor so it only happens once and not on every CWE lookup. I know, other readers do this, too. Let's be the first to clean up :-) |
- Add code_injection (CWE-94) and external_taint_escape (CWE-918/SSRF) mappings that were missing and triggered runtime warnings - Move HashMap construction from customRuleCweMappings() into the constructor so the map is built once, not on every CWE lookup - Add CweNumber.CODE_INJECTION = 94 constant Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
coggiyadmin
left a comment
There was a problem hiding this comment.
I added changes as per the feedback @darkspirit510
Adds scorecard support for Cognium (https://github.com/cogniumhq/cognium),
an open-source SAST tool. No new output format needed — Cognium's existing
--format sarif output is consumed directly.
Generate results:
cognium scan BenchmarkJava/src/ --format sarif --output Cognium.sarif
Changes:
CweSourceType.CUSTOM; static ruleId→CWE map for 13 security sink types;
non-security findings skipped by base class