emit clean kube-bench JSON report
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 1m21s
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 1m21s
This commit is contained in:
+16
-12
@@ -24,18 +24,22 @@ spec:
|
||||
- name: kube-bench
|
||||
image: docker.io/aquasec/kube-bench:v0.16.0
|
||||
command:
|
||||
- kube-bench
|
||||
- run
|
||||
- --benchmark
|
||||
- k3s-cis-1.7
|
||||
# K3d control-plane nodes run in containers without systemd journals.
|
||||
# These checks require journalctl and are not applicable to this CI topology.
|
||||
- --skip
|
||||
- 1.4.1,1.4.2
|
||||
# CI publishes findings as an artifact. Findings are not a merge gate yet.
|
||||
- --exit-code
|
||||
- "0"
|
||||
- --json
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
set +e
|
||||
kube-bench run \
|
||||
--benchmark k3s-cis-1.7 \
|
||||
--skip 1.4.1,1.4.2 \
|
||||
--exit-code 0 \
|
||||
--json \
|
||||
>/tmp/kube-bench.json 2>/tmp/kube-bench.stderr
|
||||
scan_rc=$?
|
||||
cat /tmp/kube-bench.json
|
||||
if [ "$scan_rc" -ne 0 ]; then
|
||||
cat /tmp/kube-bench.stderr >&2
|
||||
fi
|
||||
exit "$scan_rc"
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
|
||||
Reference in New Issue
Block a user