feat: add findings.json → SARIF 2.1.0 converter - #8
Open
ppcvote wants to merge 1 commit into
Open
Conversation
Adds findings-to-sarif.cjs so audit output plugs into GitHub code scanning, VS Code SARIF viewers, and other SARIF consumers without post-processing. - Confirmed findings become SARIF results; rejected findings are excluded but counted in run.properties so the audit trail stays visible. - Each finding's trace (entrypoint -> propagation -> sink) maps to a SARIF codeFlow, rendered by code scanning as a step-through path; the sink is the result's primary location. - overall_severity maps to SARIF level and to the code-scanning security-severity rule property. - partialFingerprints hash the raw UTF-8 octets of stable identity fields, so a finding keeps the same fingerprint across runs and platforms. Zero dependencies, matching validate-findings.cjs. Output validated against the OASIS SARIF 2.1.0 schema. README updated with a SARIF export section.
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.
What
Adds
findings-to-sarif.cjs, a zero-dependency converter fromfindings.jsonto SARIF 2.1.0, so audit output plugs directly into GitHub code scanning, VS Code SARIF viewers, DefectDojo, and any other SARIF consumer — no post-processing.Why
The skill already produces excellent structured output, but
findings.jsonuses the skill's own schema. SARIF is the interchange format the surrounding tooling already speaks — emitting it lets a security-audit run surface as annotations on a PR (code scanning) or as navigable results in an IDE without anyone writing glue.Mapping choices
confirmedfindings become results.rejectedfindings are excluded fromresultsbut counted inrun.properties.rejectedFindings, so the adversarial-validation trail stays visible rather than silently dropped.trace→codeFlow. The entrypoint → propagation → sink chain maps to a SARIFcodeFlow, which code scanning renders as a step-through path. The sink is the result's primarylocation— where the defect manifests and where a fix lands.overall_severity→level+security-severity.critical/high→error,medium→warning,low/informational→note; plus the numericsecurity-severityrule property that drives code scanning's severity buckets.partialFingerprintshash the raw UTF-8 octets of stable identity fields (rule id, sink file/line, root cause), so a finding keeps the same fingerprint across runs and platforms and code scanning can dedupe it.Notes
validate-findings.cjs. Run the validator first; this converter assumes schema-valid input.codeFlow, severity mapping, fingerprint all check out).Happy to adjust the mapping (e.g. surface
conditions/executiondifferently, or emit one run per hunting class) if you'd prefer a different shape.