feat(command): add rootfs command (#1271)

This commit is contained in:
Teppei Fukuda
2021-10-05 03:03:34 +09:00
committed by GitHub
parent a463e794ce
commit 1c9ccb5e03
21 changed files with 271 additions and 134 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/urfave/cli/v2"
"golang.org/x/xerrors"
"github.com/aquasecurity/fanal/analyzer"
"github.com/aquasecurity/fanal/analyzer/config"
"github.com/aquasecurity/fanal/artifact"
"github.com/aquasecurity/fanal/cache"
@@ -33,15 +34,13 @@ func dockerScanner(ctx context.Context, imageName string, ac cache.ArtifactCache
// ImageRun runs scan on docker image
func ImageRun(ctx *cli.Context) error {
opt, err := NewOption(ctx)
opt, err := initOption(ctx)
if err != nil {
return xerrors.Errorf("option error: %w", err)
}
// initialize options
if err = opt.Init(); err != nil {
return xerrors.Errorf("option initialize error: %w", err)
}
// Disable the lock file scanning
opt.DisabledAnalyzers = analyzer.TypeLockfiles
if opt.Input != "" {
// scan tar file