Commit e3dc55b
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 7ce1bbb commit e3dc55b
3 files changed
Lines changed: 454 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
118 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
| |||
246 | 256 | | |
247 | 257 | | |
248 | 258 | | |
249 | | - | |
250 | 259 | | |
251 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
252 | 264 | | |
253 | 265 | | |
254 | 266 | | |
| |||
292 | 304 | | |
293 | 305 | | |
294 | 306 | | |
| 307 | + | |
295 | 308 | | |
296 | 309 | | |
297 | 310 | | |
| |||
302 | 315 | | |
303 | 316 | | |
304 | 317 | | |
| 318 | + | |
305 | 319 | | |
306 | 320 | | |
307 | 321 | | |
| |||
| 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