@@ -75,6 +75,8 @@ type SarifReportRunResultLocationPhysicalLocationArtifactLocation struct {
75
75
type SarifReportRunResultLocationPhysicalLocationRegion struct {
76
76
StartLine * int `json:"startLine,omitempty"`
77
77
StartColumn * int `json:"startColumn,omitempty"`
78
+ EndLine * int `json:"endLine,omitempty"`
79
+ EndColumn * int `json:"endColumn,omitempty"`
78
80
}
79
81
80
82
func FromContainerScan (containerScanReport containerscan.ContainerScan ) (SarifReport , error ) {
@@ -125,7 +127,9 @@ func FromContainerScan(containerScanReport containerscan.ContainerScan) (SarifRe
125
127
FullDescription : SarifReportRunToolDriverRuleDescription {
126
128
Text : vulnerability .Description ,
127
129
},
128
- HelpUri : & helpUri ,
130
+ Help : & SarifReportRunToolDriverRuleDescription {
131
+ Text : helpUri ,
132
+ },
129
133
}
130
134
}
131
135
sarifRunResult := SarifReportRunResult {
@@ -135,12 +139,20 @@ func FromContainerScan(containerScanReport containerscan.ContainerScan) (SarifRe
135
139
Text : vulnerability .Description ,
136
140
},
137
141
}
142
+ //startLine, endLine, startColumn, endColumn
143
+ physicalLocationRegion := []int { 1 , 1 , 1 , 1 }
138
144
sarifRunResult .Locations = append (sarifRunResult .Locations ,
139
145
SarifReportRunResultLocation {
140
146
PhysicalLocation : SarifReportRunResultLocationPhysicalLocation {
141
147
ArtifactLocation : SarifReportRunResultLocationPhysicalLocationArtifactLocation {
142
148
Uri : toPathUri (vulnerability .Target ),
143
149
},
150
+ Region : & SarifReportRunResultLocationPhysicalLocationRegion {
151
+ StartLine : & physicalLocationRegion [0 ],
152
+ EndLine : & physicalLocationRegion [1 ],
153
+ StartColumn : & physicalLocationRegion [2 ],
154
+ EndColumn : & physicalLocationRegion [3 ],
155
+ },
144
156
},
145
157
})
146
158
sarifReportRun .Results = append (sarifReportRun .Results , sarifRunResult )
@@ -172,7 +184,9 @@ func FromContainerScan(containerScanReport containerscan.ContainerScan) (SarifRe
172
184
FullDescription : SarifReportRunToolDriverRuleDescription {
173
185
Text : bestPracticeViolation .Title ,
174
186
},
175
- HelpUri : & helpUri ,
187
+ Help : & SarifReportRunToolDriverRuleDescription {
188
+ Text : helpUri ,
189
+ },
176
190
}
177
191
}
178
192
sarifRunResult := SarifReportRunResult {
@@ -182,6 +196,22 @@ func FromContainerScan(containerScanReport containerscan.ContainerScan) (SarifRe
182
196
Text : bestPracticeViolation .Alerts ,
183
197
},
184
198
}
199
+ //startLine, endLine, startColumn, endColumn
200
+ physicalLocationRegion := []int { 1 , 1 , 1 , 1 }
201
+ sarifRunResult .Locations = append (sarifRunResult .Locations ,
202
+ SarifReportRunResultLocation {
203
+ PhysicalLocation : SarifReportRunResultLocationPhysicalLocation {
204
+ ArtifactLocation : SarifReportRunResultLocationPhysicalLocationArtifactLocation {
205
+ Uri : toPathUri ("container-image" ),
206
+ },
207
+ Region : & SarifReportRunResultLocationPhysicalLocationRegion {
208
+ StartLine : & physicalLocationRegion [0 ],
209
+ EndLine : & physicalLocationRegion [1 ],
210
+ StartColumn : & physicalLocationRegion [2 ],
211
+ EndColumn : & physicalLocationRegion [3 ],
212
+ },
213
+ },
214
+ })
185
215
sarifReportRun .Results = append (sarifReportRun .Results , sarifRunResult )
186
216
}
187
217
sarifReportRun .Tool .Driver = sarifReportRunDriver
0 commit comments