🐛 fix(sarif): update report to pass validator (#1167)

* 🐛 fix(sarif): update report to pass validator

* ✅ test(sarif): update sarif report testdata
This commit is contained in:
Dariusz Porowski authored and GitHub committed 2023-04-28 14:15:18 -05:00
1 parent 51ca0f89b9
commit 146f69e51b
3 files changed
+6 -3

No files matched your search

+3 -1
View File
@@ -10,7 +10,7 @@ import (
func writeSarif(cfg config.Config, findings []Finding, w io.WriteCloser) error { func writeSarif(cfg config.Config, findings []Finding, w io.WriteCloser) error {
sarif := Sarif{ 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", Version: "2.1.0",
Runs: getRuns(cfg, findings), Runs: getRuns(cfg, findings),
} }
@@ -34,6 +34,7 @@ func getTool(cfg config.Config) Tool {
Driver: Driver{ Driver: Driver{
Name: driver, Name: driver,
SemanticVersion: version, SemanticVersion: version,
InformationUri: "https://github.com/gitleaks/gitleaks",
Rules: getRules(cfg), Rules: getRules(cfg),
}, },
} }
@@ -164,6 +165,7 @@ type Rules struct {
type Driver struct { type Driver struct {
Name string `json:"name"` Name string `json:"name"`
SemanticVersion string `json:"semanticVersion"` SemanticVersion string `json:"semanticVersion"`
InformationUri string `json:"informationUri"`
Rules []Rules `json:"rules"` Rules []Rules `json:"rules"`
} }
+1 -1
View File
@@ -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", "version": "2.1.0",
"runs": [ "runs": [
] ]
+2 -1
View File
@@ -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", "version": "2.1.0",
"runs": [ "runs": [
{ {
@@ -7,6 +7,7 @@
"driver": { "driver": {
"name": "gitleaks", "name": "gitleaks",
"semanticVersion": "v8.0.0", "semanticVersion": "v8.0.0",
"informationUri": "https://github.com/gitleaks/gitleaks",
"rules": [ "rules": [
{ {
"id": "aws-access-key", "id": "aws-access-key",