feat: added insecure tls skip to scan git repo (#1528)

Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
DmitriyLewen
2022-01-14 15:25:45 +06:00
committed by GitHub
parent 33bd41b40f
commit 478d279919
16 changed files with 57 additions and 55 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"errors"
"os"
"time"
"github.com/urfave/cli/v2"
"golang.org/x/xerrors"
@@ -27,7 +26,7 @@ const defaultPolicyNamespace = "appshield"
var errSkipScan = errors.New("skip subsequent processes")
// InitializeScanner defines the initialize function signature of scanner
type InitializeScanner func(context.Context, string, cache.ArtifactCache, cache.LocalArtifactCache, time.Duration,
type InitializeScanner func(context.Context, string, cache.ArtifactCache, cache.LocalArtifactCache, bool,
artifact.Option, config.ScannerOption) (scanner.Scanner, func(), error)
// InitCache defines cache initializer
@@ -204,11 +203,12 @@ func scan(ctx context.Context, opt Option, initializeScanner InitializeScanner,
DisabledAnalyzers: disabledAnalyzers(opt),
SkipFiles: opt.SkipFiles,
SkipDirs: opt.SkipDirs,
InsecureSkipTLS: opt.Insecure,
Offline: opt.OfflineScan,
Quiet: opt.Quiet,
}
s, cleanup, err := initializeScanner(ctx, target, cacheClient, cacheClient, opt.Timeout, artifactOpt, configScannerOptions)
s, cleanup, err := initializeScanner(ctx, target, cacheClient, cacheClient, opt.Insecure, artifactOpt, configScannerOptions)
if err != nil {
return pkgReport.Report{}, xerrors.Errorf("unable to initialize a scanner: %w", err)
}