@@ -72,7 +72,7 @@ func (s *service) HandleFirstPartyVulnResult(asset models.Asset, assetVersion *m
7272 AssetVersionName : assetVersion .Name ,
7373 AssetID : asset .ID ,
7474 Message : & result .Message .Text ,
75- ScannerID : scannerID ,
75+ ScannerIDs : scannerID ,
7676 },
7777 RuleID : result .RuleId ,
7878 Uri : result .Locations [0 ].PhysicalLocation .ArtifactLocation .Uri ,
@@ -155,13 +155,13 @@ func (s *service) handleFirstPartyVulnResult(userID string, scannerID string, as
155155 return len (newVulns ), len (fixedVulns ), append (newVulns , comparison .InBoth ... ), nil
156156}
157157
158- func (s * service ) HandleScanResult (asset models.Asset , assetVersion * models.AssetVersion , vulns []models.VulnInPackage , scanner string , scannerID string , userID string , doRiskManagement bool ) (amountOpened int , amountClose int , newState []models.DependencyVuln , err error ) {
158+ func (s * service ) HandleScanResult (asset models.Asset , assetVersion * models.AssetVersion , vulns []models.VulnInPackage , scannerID string , userID string , doRiskManagement bool ) (amountOpened int , amountClose int , newState []models.DependencyVuln , err error ) {
159159
160160 // create dependencyVulns out of those vulnerabilities
161161 dependencyVulns := []models.DependencyVuln {}
162162
163163 // load all asset components again and build a dependency tree
164- assetComponents , err := s .componentRepository .LoadComponents (nil , assetVersion .Name , assetVersion .AssetID , scanner )
164+ assetComponents , err := s .componentRepository .LoadComponents (nil , assetVersion .Name , assetVersion .AssetID , scannerID )
165165 if err != nil {
166166 return 0 , 0 , []models.DependencyVuln {}, errors .Wrap (err , "could not load asset components" )
167167 }
@@ -183,7 +183,7 @@ func (s *service) HandleScanResult(asset models.Asset, assetVersion *models.Asse
183183 Vulnerability : models.Vulnerability {
184184 AssetVersionName : assetVersion .Name ,
185185 AssetID : asset .ID ,
186- ScannerID : scannerID + " " ,
186+ ScannerIDs : scannerID + " " ,
187187 },
188188 CVEID : utils .Ptr (v .CVEID ),
189189 ComponentPurl : utils .Ptr (v .Purl ),
@@ -208,7 +208,7 @@ func (s *service) HandleScanResult(asset models.Asset, assetVersion *models.Asse
208208
209209 devguardScanner := "github.com/l3montree-dev/devguard/cmd/devguard-scanner" + "/"
210210
211- switch scanner {
211+ switch scannerID {
212212
213213 case devguardScanner + "sca" :
214214 assetVersion .LastScaScan = utils .Ptr (time .Now ())
@@ -255,8 +255,8 @@ func (s *service) handleScanResult(userID string, scannerID string, assetVersion
255255
256256 // Now we work on the vulnerabilities found in both sets -> has the vulnerability this scanner id already in his scanner_ids
257257 for i := range foundByScannerAndExisting {
258- if ! strings .Contains (foundByScannerAndExisting [i ].ScannerID , scannerID ) {
259- foundByScannerAndExisting [i ].ScannerID = foundByScannerAndExisting [i ].ScannerID + scannerID
258+ if ! strings .Contains (foundByScannerAndExisting [i ].ScannerIDs , scannerID ) {
259+ foundByScannerAndExisting [i ].ScannerIDs = foundByScannerAndExisting [i ].ScannerIDs + " " + scannerID
260260 }
261261 }
262262
@@ -270,10 +270,10 @@ func (s *service) handleScanResult(userID string, scannerID string, assetVersion
270270 //Last we have to change the already existing vulnerabilities which were not found this time
271271
272272 for i := range notFoundByScannerAndExisting {
273- if notFoundByScannerAndExisting [i ].ScannerID == scannerID {
274- notFoundByScannerAndExisting [i ].ScannerID = ""
273+ if notFoundByScannerAndExisting [i ].ScannerIDs == scannerID {
274+ notFoundByScannerAndExisting [i ].ScannerIDs = ""
275275 vulnerabilitiesToFix = append (vulnerabilitiesToFix , notFoundByScannerAndExisting [i ])
276- } else if strings .Contains (notFoundByScannerAndExisting [i ].ScannerID , scannerID ) {
276+ } else if strings .Contains (notFoundByScannerAndExisting [i ].ScannerIDs , scannerID ) {
277277 removeScannerFromVulnerability (& notFoundByScannerAndExisting [i ], scannerID )
278278 vulnerabilitiesToUpdate = append (vulnerabilitiesToUpdate , notFoundByScannerAndExisting [i ])
279279 }
@@ -301,7 +301,7 @@ func (s *service) handleScanResult(userID string, scannerID string, assetVersion
301301// pass by reference to edit the actual vulnerability and not a copy
302302func removeScannerFromVulnerability (vulnerability * models.DependencyVuln , scannerID string ) {
303303
304- vulnerability .ScannerID = strings .Replace (vulnerability .ScannerID , scannerID , "" , 1 )
304+ vulnerability .ScannerIDs = strings .Replace (vulnerability .ScannerIDs , scannerID , "" , 1 )
305305}
306306
307307func recursiveBuildBomRefMap (component cdx.Component ) map [string ]cdx.Component {
0 commit comments