mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
feat(image): scan misconfigurations in image config (#3437)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user