Commit b27a9084 authored by Ruben ten Hove's avatar Ruben ten Hove
Browse files

overwrite command

parent ad6306ee
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -7,13 +7,14 @@ k8s:kube-bench:
  variables:
    KUBE_BENCH_VERSION: main  # or use for example v0.6.7 from the available tags on https://github.com/aquasecurity/kube-bench/tags
    KUBE_BENCH_MANIFEST: https://raw.githubusercontent.com/aquasecurity/kube-bench/${KUBE_BENCH_VERSION}/job.yaml
    KUBE_BENCH_JOB_NAME: kube-bench  # needs to match the meta in the job manifest
    KUBE_BENCH_JOB_NAME: kube-bench  # needs to match the metadata in the job manifest
  script:
    - wget -O job.yaml ${KUBE_BENCH_MANIFEST}
    - yq eval -i '.spec.template.spec.containers[0].command = ["kube-bench", "--junit", "--alsologtostderr", "--outputfile", "kube-bench.xml"]' job.yaml
    - kubectl delete -f job.yaml --ignore-not-found=true
    - kubectl apply -f job.yaml
    - kubectl wait -f job.yaml --for=condition=complete=true
    - kubectl logs -f jobs/${KUBE_BENCH_JOB_NAME} | tee kube-bench.xml
    - kubectl logs -f jobs/${KUBE_BENCH_JOB_NAME}
    - kubectl delete -f job.yaml --ignore-not-found=true
  artifacts:
    reports: