* update trivy, fanal. unsupport image scanning * Update models/library.go Co-authored-by: Teppei Fukuda <teppei@elab.ic.i.u-tokyo.ac.jp> * add -no-progress flag to report/tui cmd * Display trivy vuln info to tui/report * add detection method to vulninfo detected by trivy * fix(uuid): change uuid lib to go-uuid #929 (#969) * update trivy, fanal. unsupport image scanning * Update models/library.go Co-authored-by: Teppei Fukuda <teppei@elab.ic.i.u-tokyo.ac.jp> * add -no-progress flag to report/tui cmd * Display trivy vuln info to tui/report * add detection method to vulninfo detected by trivy * unique ref links in TUI * download trivy DB only when lock file is specified in config.toml Co-authored-by: Teppei Fukuda <teppei@elab.ic.i.u-tokyo.ac.jp>
		
			
				
	
	
		
			27 lines
		
	
	
		
			630 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			630 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package scan
 | 
						|
 | 
						|
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{
 | 
						|
			Path: app.FilePath,
 | 
						|
			Libs: libs,
 | 
						|
		})
 | 
						|
	}
 | 
						|
	return scanners, nil
 | 
						|
}
 |