feat(misconf): Helm chart scanning (#2269)

Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
This commit is contained in:
Owen Rumney
2022-06-07 09:38:43 +01:00
committed by GitHub
parent 3912768470
commit 6b2cd7e8da
20 changed files with 1128 additions and 79 deletions

View File

@@ -101,6 +101,22 @@ func TestFilesystem(t *testing.T) {
},
golden: "testdata/dockerfile-custom-policies.json.golden",
},
{
name: "tarball helm chart scanning with builtin policies",
args: args{
securityChecks: "config",
input: "testdata/fixtures/fs/helm",
},
golden: "testdata/helm.json.golden",
},
{
name: "helm chart directory scanning with builtin policies",
args: args{
securityChecks: "config",
input: "testdata/fixtures/fs/helm_testchart",
},
golden: "testdata/helm_testchart.json.golden",
},
{
name: "secrets",
args: args{
@@ -117,8 +133,10 @@ func TestFilesystem(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
osArgs := []string{"trivy", "--cache-dir", cacheDir, "fs", "--skip-db-update", "--skip-policy-update",
"--format", "json", "--offline-scan", "--security-checks", tt.args.securityChecks}
osArgs := []string{
"trivy", "--cache-dir", cacheDir, "fs", "--skip-db-update", "--skip-policy-update",
"--format", "json", "--offline-scan", "--security-checks", tt.args.securityChecks,
}
if len(tt.args.policyPaths) != 0 {
for _, policyPath := range tt.args.policyPaths {