Skip to content

Commit df9235e

Browse files
committed
add line number to jas location detection
1 parent bc8a26c commit df9235e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

policy/enforcer/policyenforcer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ func isLocationMatchingJasViolation(location *sarif.Location, invocations []*sar
339339
if relative := sarifutils.GetRelativeLocationFileName(location, invocations); !slices.Contains(violation.InfectedFilePaths, relative) {
340340
return false
341341
}
342-
// TODO: Improve matching logic when more data is available in Xray violations (Line + Column)
343-
return true
342+
return sarifutils.GetLocationStartLine(location) == violation.LineNumber
344343
}
345344

346345
func getJasVulnerabilityId(violation services.XrayViolation, jasType jasutils.JasScanType) string {

0 commit comments

Comments
 (0)