Skip to content

Add Cognium SARIF reader#285

Open
coggiyadmin wants to merge 2 commits intoOWASP-Benchmark:mainfrom
coggiyadmin:add-cognium-reader
Open

Add Cognium SARIF reader#285
coggiyadmin wants to merge 2 commits intoOWASP-Benchmark:mainfrom
coggiyadmin:add-cognium-reader

Conversation

@coggiyadmin
Copy link
Copy Markdown

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:

  • parsers/sarif/CogniumReader.java — extends SarifReader with
    CweSourceType.CUSTOM; static ruleId→CWE map for 13 security sink types;
    non-security findings skipped by base class
  • CogniumReaderTest.java + Benchmark_Cognium.sarif test fixture
  • Reader.java — registered in allReaders()

Asok Shanmugam and others added 2 commits April 10, 2026 16:05
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>
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.

1 participant