feat(image): scan misconfigurations in image config (#3437)

This commit is contained in:
Teppei Fukuda
2023-01-30 04:48:29 +02:00
committed by GitHub
parent 501d424d1f
commit fb0d8f3f30
43 changed files with 1851 additions and 1361 deletions

View File

@@ -5,6 +5,7 @@ import (
google_protobuf "github.com/golang/protobuf/ptypes/empty"
"github.com/google/wire"
"github.com/samber/lo"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/fanal/cache"
@@ -42,9 +43,12 @@ func teeError(err error) error {
// Scan scans and return response
func (s *ScanServer) Scan(ctx context.Context, in *rpcScanner.ScanRequest) (*rpcScanner.ScanResponse, error) {
scanners := lo.Map(in.Options.Scanners, func(s string, index int) types.Scanner {
return types.Scanner(s)
})
options := types.ScanOptions{
VulnType: in.Options.VulnType,
Scanners: in.Options.Scanners,
Scanners: scanners,
ListAllPackages: in.Options.ListAllPackages,
}
results, os, err := s.localScanner.Scan(ctx, in.Target, in.ArtifactId, in.BlobIds, options)