* feat(trivy): go mod update trivy v0.17.2 * wg.Wait * fix reporting * fix test case * add gemfile.lock of redmine to integration test * fix(test): add Pipfile.lock * add poetry.lock to integration test * add composer.lock to integration test * add integration test case
28 lines
652 B
Go
28 lines
652 B
Go
package scanner
|
|
|
|
import (
|
|
"github.com/aquasecurity/fanal/types"
|
|
"github.com/future-architect/vuls/models"
|
|
|
|
trivyTypes "github.com/aquasecurity/trivy/pkg/types"
|
|
)
|
|
|
|
func convertLibWithScanner(apps []types.Application) ([]models.LibraryScanner, error) {
|
|
scanners := []models.LibraryScanner{}
|
|
for _, app := range apps {
|
|
libs := []trivyTypes.Library{}
|
|
for _, lib := range app.Libraries {
|
|
libs = append(libs, trivyTypes.Library{
|
|
Name: lib.Library.Name,
|
|
Version: lib.Library.Version,
|
|
})
|
|
}
|
|
scanners = append(scanners, models.LibraryScanner{
|
|
Type: app.Type,
|
|
Path: app.FilePath,
|
|
Libs: libs,
|
|
})
|
|
}
|
|
return scanners, nil
|
|
}
|