mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
feat: support config scanning (#931)
This commit is contained in:
@@ -42,6 +42,24 @@ func TestOption_Init(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "config scanning",
|
||||
args: []string{"--severity", "CRITICAL", "--security-checks", "config", "--quiet", "alpine:3.10"},
|
||||
want: Option{
|
||||
GlobalOption: option.GlobalOption{
|
||||
Quiet: true,
|
||||
},
|
||||
ArtifactOption: option.ArtifactOption{
|
||||
Target: "alpine:3.10",
|
||||
},
|
||||
ReportOption: option.ReportOption{
|
||||
Severities: []dbTypes.Severity{dbTypes.SeverityCritical},
|
||||
VulnType: []string{types.VulnTypeOS, types.VulnTypeLibrary},
|
||||
SecurityChecks: []string{types.SecurityCheckConfig},
|
||||
Output: os.Stdout,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "happy path: reset",
|
||||
args: []string{"--reset"},
|
||||
@@ -154,8 +172,8 @@ func TestOption_Init(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "sad: skip and download db",
|
||||
args: []string{"--skip-update", "--download-db-only", "alpine:3.10"},
|
||||
wantErr: "--skip-update and --download-db-only options can not be specified both",
|
||||
args: []string{"--skip-db-update", "--download-db-only", "alpine:3.10"},
|
||||
wantErr: "--skip-db-update and --download-db-only options can not be specified both",
|
||||
},
|
||||
{
|
||||
name: "sad: multiple image names",
|
||||
@@ -176,7 +194,7 @@ func TestOption_Init(t *testing.T) {
|
||||
set.Bool("quiet", false, "")
|
||||
set.Bool("no-progress", false, "")
|
||||
set.Bool("reset", false, "")
|
||||
set.Bool("skip-update", false, "")
|
||||
set.Bool("skip-db-update", false, "")
|
||||
set.Bool("download-db-only", false, "")
|
||||
set.Bool("auto-refresh", false, "")
|
||||
set.String("severity", "CRITICAL", "")
|
||||
|
||||
Reference in New Issue
Block a user