mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-05 20:40:16 -08:00
test(k8s): update k8s integrtion test (#9725)
This commit is contained in:
@@ -42,7 +42,8 @@ func TestK8s(t *testing.T) {
|
||||
"summary",
|
||||
"--checks-bundle-repository",
|
||||
"mirror.gcr.io/aquasec/trivy-checks:1.11.2@sha256:f3ea8227f838a985f0c884909e9d226362f5fc5ab6021310a179fbb24c5b57fd",
|
||||
"-q",
|
||||
"--include-namespaces", "default",
|
||||
"--debug",
|
||||
"--timeout",
|
||||
"5m0s",
|
||||
"--format",
|
||||
|
||||
@@ -1,290 +1,31 @@
|
||||
{
|
||||
"vulnerabilities": [
|
||||
"CVE-2019-1551",
|
||||
"CVE-2019-1551",
|
||||
"CVE-2019-1563",
|
||||
"CVE-2019-1563",
|
||||
"CVE-2019-18276",
|
||||
"CVE-2019-18276",
|
||||
"CVE-2019-5094",
|
||||
"CVE-2019-5094",
|
||||
"CVE-2019-5094",
|
||||
"CVE-2019-5094",
|
||||
"CVE-2019-5094",
|
||||
"CVE-2019-5094",
|
||||
"CVE-2019-5094",
|
||||
"CVE-2019-5094"
|
||||
],
|
||||
"misconfigurations": [
|
||||
"AVD-KSV-01010",
|
||||
"KCV0001",
|
||||
"KCV0006",
|
||||
"KCV0010",
|
||||
"KCV0018",
|
||||
"KCV0019",
|
||||
"KCV0020",
|
||||
"KCV0021",
|
||||
"KCV0022",
|
||||
"KCV0030",
|
||||
"KCV0033",
|
||||
"KCV0038",
|
||||
"KCV0059",
|
||||
"KCV0069",
|
||||
"KCV0075",
|
||||
"KCV0077",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV001",
|
||||
"KSV0012",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV003",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV004",
|
||||
"KSV009",
|
||||
"KSV009",
|
||||
"KSV009",
|
||||
"KSV009",
|
||||
"KSV009",
|
||||
"KSV009",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV011",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV012",
|
||||
"KSV0125",
|
||||
"KSV0125",
|
||||
"KSV0125",
|
||||
"KSV0125",
|
||||
"KSV0125",
|
||||
"KSV0125",
|
||||
"KSV0125",
|
||||
"KSV0125",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV014",
|
||||
"KSV015",
|
||||
"KSV015",
|
||||
"KSV015",
|
||||
"KSV015",
|
||||
"KSV016",
|
||||
"KSV016",
|
||||
"KSV016",
|
||||
"KSV016",
|
||||
"KSV016",
|
||||
"KSV016",
|
||||
"KSV016",
|
||||
"KSV017",
|
||||
"KSV018",
|
||||
"KSV018",
|
||||
"KSV018",
|
||||
"KSV018",
|
||||
"KSV018",
|
||||
"KSV018",
|
||||
"KSV018",
|
||||
"KSV018",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV020",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV021",
|
||||
"KSV022",
|
||||
"KSV022",
|
||||
"KSV023",
|
||||
"KSV023",
|
||||
"KSV023",
|
||||
"KSV023",
|
||||
"KSV023",
|
||||
"KSV023",
|
||||
"KSV030",
|
||||
"KSV030",
|
||||
"KSV030",
|
||||
"KSV030",
|
||||
"KSV030",
|
||||
"KSV030",
|
||||
"KSV036",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV041",
|
||||
"KSV044",
|
||||
"KSV045",
|
||||
"KSV046",
|
||||
"KSV046",
|
||||
"KSV046",
|
||||
"KSV046",
|
||||
"KSV046",
|
||||
"KSV046",
|
||||
"KSV046",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV048",
|
||||
"KSV049",
|
||||
"KSV049",
|
||||
"KSV049",
|
||||
"KSV049",
|
||||
"KSV049",
|
||||
"KSV049",
|
||||
"KSV049",
|
||||
"KSV049",
|
||||
"KSV050",
|
||||
"KSV050",
|
||||
"KSV053",
|
||||
"KSV053",
|
||||
"KSV053",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV056",
|
||||
"KSV104",
|
||||
"KSV104",
|
||||
"KSV104",
|
||||
"KSV104",
|
||||
"KSV104",
|
||||
"KSV104",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV106",
|
||||
"KSV110",
|
||||
"KSV111",
|
||||
"KSV112",
|
||||
"KSV112",
|
||||
"KSV113",
|
||||
"KSV113",
|
||||
"KSV117",
|
||||
"KSV117",
|
||||
"KSV117",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV118",
|
||||
"KSV119",
|
||||
"KSV122",
|
||||
"no-user-pods-in-system-namespace",
|
||||
"no-user-pods-in-system-namespace",
|
||||
"no-user-pods-in-system-namespace",
|
||||
"no-user-pods-in-system-namespace"
|
||||
"KSV118"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -252,10 +252,20 @@ func (t Test) K8s() error {
|
||||
return fmt.Errorf("can't create environment for limited user: %w", err)
|
||||
}
|
||||
|
||||
// wait for all pods are running correctly
|
||||
err = sh.RunWithV(ENV, "kubectl", "wait", "--for=condition=Ready", "pod", "--all", "--all-namespaces", "--timeout=300s")
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't wait for the pods: %w", err)
|
||||
}
|
||||
|
||||
// print all resources for info
|
||||
err = sh.RunWithV(ENV, "kubectl", "get", "all", "-A")
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("can't get workloads: %w", err)
|
||||
}
|
||||
err = sh.RunWithV(ENV, "kubectl", "get", "cm", "-A")
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't get configmaps: %w", err)
|
||||
}
|
||||
|
||||
return sh.RunWithV(ENV, "go", "test", "-v", "-tags=k8s_integration", "./integration/...")
|
||||
|
||||
Reference in New Issue
Block a user