update trivy, and unsupport image scanning feature (#971)
* 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>
This commit is contained in:
		@@ -51,16 +51,6 @@ func (c TOMLLoader) Load(pathToToml, keyPass string) error {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		s := ServerInfo{ServerName: serverName}
 | 
			
		||||
		s.Images = make(map[string]Image)
 | 
			
		||||
 | 
			
		||||
		// image are able to set any server type
 | 
			
		||||
		for name, image := range v.Images {
 | 
			
		||||
			if err := IsValidImage(image); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
			s.Images[name] = image
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if v.Type != ServerTypePseudo {
 | 
			
		||||
			s.Host = v.Host
 | 
			
		||||
			if len(s.Host) == 0 {
 | 
			
		||||
@@ -292,17 +282,3 @@ func toCpeURI(cpename string) (string, error) {
 | 
			
		||||
	}
 | 
			
		||||
	return "", xerrors.Errorf("Unknow CPE format: %s", cpename)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsValidImage checks a container configuration
 | 
			
		||||
func IsValidImage(c Image) error {
 | 
			
		||||
	if c.Name == "" {
 | 
			
		||||
		return xerrors.New("Invalid arguments : no image name")
 | 
			
		||||
	}
 | 
			
		||||
	if c.Tag == "" && c.Digest == "" {
 | 
			
		||||
		return xerrors.New("Invalid arguments : no image tag and digest")
 | 
			
		||||
	}
 | 
			
		||||
	if c.Tag != "" && c.Digest != "" {
 | 
			
		||||
		return xerrors.New("Invalid arguments : you can either set image tag or digest")
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user