Skip to content

Commit

Permalink
Update kube-bench version
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed Nov 15, 2023
1 parent 481024a commit b945116
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 5 deletions.
47 changes: 47 additions & 0 deletions job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: batch/v1
kind: Job
metadata:
name: kube-bench
spec:
template:
spec:
hostPID: true
containers:
- name: kube-bench
image: docker.io/aquasec/kube-bench:latest
command:
[
"kube-bench",
"run",
"--targets",
"node,policies,managedservices",
"--benchmark",
"gke-1.2.0",
]
volumeMounts:
- name: var-lib-kubelet
mountPath: /var/lib/kubelet
readOnly: true
- name: etc-systemd
mountPath: /etc/systemd
readOnly: true
- name: etc-kubernetes
mountPath: /etc/kubernetes
readOnly: true
- name: home-kubernetes
mountPath: /home/kubernetes
readOnly: true
restartPolicy: Never
volumes:
- name: var-lib-kubelet
hostPath:
path: "/var/lib/kubelet"
- name: etc-systemd
hostPath:
path: "/etc/systemd"
- name: etc-kubernetes
hostPath:
path: "/etc/kubernetes"
- name: home-kubernetes
hostPath:
path: "/home/kubernetes"
2 changes: 1 addition & 1 deletion linters/kubebench/spec/aks.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func AKS(nodeName, jobName string) *batchv1.Job {
Containers: []corev1.Container{
{
Name: "kube-bench",
Image: "ghcr.io/castai/kvisor/kube-bench:v0.7.0",
Image: kubeBenchImage,
SecurityContext: &corev1.SecurityContext{
ReadOnlyRootFilesystem: lo.ToPtr(true),
AllowPrivilegeEscalation: lo.ToPtr(false),
Expand Down
3 changes: 3 additions & 0 deletions linters/kubebench/spec/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package spec

const kubeBenchImage = "ghcr.io/castai/kvisor/kube-bench:v0.8.0"
2 changes: 1 addition & 1 deletion linters/kubebench/spec/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func EKS(nodeName, jobName string) *batchv1.Job {
Containers: []corev1.Container{
{
Name: "kube-bench",
Image: "ghcr.io/castai/kvisor/kube-bench:v0.7.0",
Image: kubeBenchImage,
SecurityContext: &corev1.SecurityContext{
ReadOnlyRootFilesystem: lo.ToPtr(true),
AllowPrivilegeEscalation: lo.ToPtr(false),
Expand Down
2 changes: 1 addition & 1 deletion linters/kubebench/spec/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func GKE(nodeName, jobName string) *batchv1.Job {
Containers: []corev1.Container{
{
Name: "kube-bench",
Image: "ghcr.io/castai/kvisor/kube-bench:v0.7.0",
Image: kubeBenchImage,
SecurityContext: &corev1.SecurityContext{
ReadOnlyRootFilesystem: lo.ToPtr(true),
AllowPrivilegeEscalation: lo.ToPtr(false),
Expand Down
2 changes: 1 addition & 1 deletion linters/kubebench/spec/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Master(nodeName, jobName string) *batchv1.Job {
Containers: []corev1.Container{
{
Name: "kube-bench",
Image: "ghcr.io/castai/kvisor/kube-bench:v0.7.0",
Image: kubeBenchImage,
SecurityContext: &corev1.SecurityContext{
ReadOnlyRootFilesystem: lo.ToPtr(true),
AllowPrivilegeEscalation: lo.ToPtr(false),
Expand Down
2 changes: 1 addition & 1 deletion linters/kubebench/spec/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func Node(nodeName, jobName string) *batchv1.Job {
Containers: []corev1.Container{
{
Name: "kube-bench",
Image: "ghcr.io/castai/kvisor/kube-bench:v0.7.0",
Image: kubeBenchImage,
SecurityContext: &corev1.SecurityContext{
ReadOnlyRootFilesystem: lo.ToPtr(true),
AllowPrivilegeEscalation: lo.ToPtr(false),
Expand Down

0 comments on commit b945116

Please sign in to comment.