From 0d8f7f559d84f98b0ec3432094a3bd19691fa7bb Mon Sep 17 00:00:00 2001 From: Diogo-fj-rocha Date: Fri, 19 Apr 2024 15:33:10 +0100 Subject: [PATCH] Added properties to sarif results. Added validationStatus to results properties --- lib/reporting/sarif.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/reporting/sarif.go b/lib/reporting/sarif.go index 6eef6a75..50803f26 100644 --- a/lib/reporting/sarif.go +++ b/lib/reporting/sarif.go @@ -68,6 +68,9 @@ func getResults(report Report) []Results { }, RuleId: secret.RuleID, Locations: getLocation(secret), + Properties: Properties{ + "validationStatus": secret.ValidationStatus, + }, } results = append(results, r) } @@ -144,12 +147,15 @@ type Locations struct { } type Results struct { - Message Message `json:"message"` - RuleId string `json:"ruleId"` - Locations []Locations `json:"locations"` + Message Message `json:"message"` + RuleId string `json:"ruleId"` + Locations []Locations `json:"locations"` + Properties Properties `json:"properties,omitempty"` } type Runs struct { Tool Tool `json:"tool"` Results []Results `json:"results"` } + +type Properties map[string]interface{}