Commit c2019bb
feat: add SARIF output format for policy violations
Add a new `sarif` module that converts policy evaluation results into
SARIF v2.1.0 format, enabling integration with GitHub Advanced Security,
Azure DevOps, and other SARIF-consuming tools.
- New `src/sarif.rs` module with `SarifReport` and `SarifConfig`
- CLI: `--format sarif` option on the `eval` command
- Configurable field mapping (msg, severity, file, rule_id)
- Max results limit support
- Severity mapping (OPA-style → SARIF levels)
- Proper URI handling with base URI support
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent c4def37 commit c2019bb
3 files changed
Lines changed: 454 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | | - | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
122 | 132 | | |
123 | 133 | | |
124 | 134 | | |
| |||
249 | 259 | | |
250 | 260 | | |
251 | 261 | | |
252 | | - | |
253 | 262 | | |
254 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
255 | 267 | | |
256 | 268 | | |
257 | 269 | | |
| |||
331 | 343 | | |
332 | 344 | | |
333 | 345 | | |
| 346 | + | |
334 | 347 | | |
335 | 348 | | |
336 | 349 | | |
| |||
341 | 354 | | |
342 | 355 | | |
343 | 356 | | |
| 357 | + | |
344 | 358 | | |
345 | 359 | | |
346 | 360 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
0 commit comments