Add SARIF 2.1.0 security report parser
What does this MR do and why?
Implements a SARIF 2.1.0 parser that ingests SARIF reports as GitLab security findings. This is the second MR for #452042 and depends on !227968 (merged) being merged first.
Changes:
- Add JSON schema validator for SARIF 2.1.0
- Add
Gitlab::Security::Parsers::Sarifparser with full finding extraction - Add
Gitlab::Ci::Reports::Security::Locations::Sariflocation model - Add per-run scanner registry to
Security::Report
Field mapping notes:
- Severity priority: (In order of priority)
result.rank>security-severityextension >result/rule level(error→high, notcritical) - Primary identifier: (In order of priority)
sarif-rule-id> secondary CWE/CVE tags fromrule.properties.tags - Suppressed results (those with suppressions where none are
underRevieworrejected) are skipped - Findings without a
ruleIdare rejected — required for stable tracking across runs - Miscellanious mappings (too many to name but this comment and this table give an overview)
Testing notes:
- Unit specs cover the parser, schema validator, and location class
- End-to-end testing is not possible until !227968 (merged) merges and
sarifis registered in the parser registry — see the PoC MR !225747 for a full working example
MR acceptance checklist
- I have evaluated the MR acceptance checklist for this MR.
Edited by Lucas Charles