From 146f69e51ba438206fee664403fb5ae8b14b2690 Mon Sep 17 00:00:00 2001 From: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> Date: Fri, 28 Apr 2023 12:15:18 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(sarif):=20update=20report=20?= =?UTF-8?q?to=20pass=20validator=20(#1167)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 fix(sarif): update report to pass validator * ✅ test(sarif): update sarif report testdata --- report/sarif.go | 4 +++- testdata/baseline/baseline.sarif | 2 +- testdata/expected/report/sarif_simple.sarif | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/report/sarif.go b/report/sarif.go index 447020f6..4cf345cd 100644 --- a/report/sarif.go +++ b/report/sarif.go @@ -10,7 +10,7 @@ import ( func writeSarif(cfg config.Config, findings []Finding, w io.WriteCloser) error { sarif := Sarif{ - Schema: "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + Schema: "https://json.schemastore.org/sarif-2.1.0.json", Version: "2.1.0", Runs: getRuns(cfg, findings), } @@ -34,6 +34,7 @@ func getTool(cfg config.Config) Tool { Driver: Driver{ Name: driver, SemanticVersion: version, + InformationUri: "https://github.com/gitleaks/gitleaks", Rules: getRules(cfg), }, } @@ -164,6 +165,7 @@ type Rules struct { type Driver struct { Name string `json:"name"` SemanticVersion string `json:"semanticVersion"` + InformationUri string `json:"informationUri"` Rules []Rules `json:"rules"` } diff --git a/testdata/baseline/baseline.sarif b/testdata/baseline/baseline.sarif index bbaaf014..b2f84890 100644 --- a/testdata/baseline/baseline.sarif +++ b/testdata/baseline/baseline.sarif @@ -1,5 +1,5 @@ { - "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "$schema": "https://json.schemastore.org/sarif-2.1.0.json", "version": "2.1.0", "runs": [ ] diff --git a/testdata/expected/report/sarif_simple.sarif b/testdata/expected/report/sarif_simple.sarif index 802f415f..0b1b15f7 100644 --- a/testdata/expected/report/sarif_simple.sarif +++ b/testdata/expected/report/sarif_simple.sarif @@ -1,5 +1,5 @@ { - "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "$schema": "https://json.schemastore.org/sarif-2.1.0.json", "version": "2.1.0", "runs": [ { @@ -7,6 +7,7 @@ "driver": { "name": "gitleaks", "semanticVersion": "v8.0.0", + "informationUri": "https://github.com/gitleaks/gitleaks", "rules": [ { "id": "aws-access-key",