mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-11-22 08:08:07 +00:00
parent
92df9cb36c
commit
3e5d02e920
@ -267,12 +267,15 @@ groups:
|
|||||||
text: "Ensure that the --rotate-certificates argument is not set to false (Scored)"
|
text: "Ensure that the --rotate-certificates argument is not set to false (Scored)"
|
||||||
audit: "ps -fC $kubeletbin"
|
audit: "ps -fC $kubeletbin"
|
||||||
tests:
|
tests:
|
||||||
|
bin_op: or
|
||||||
test_items:
|
test_items:
|
||||||
- flag: "--rotate-certificates"
|
- flag: "--rotate-certificates"
|
||||||
compare:
|
compare:
|
||||||
op: eq
|
op: eq
|
||||||
value: true
|
value: true
|
||||||
set: true
|
set: true
|
||||||
|
- flag: "--rotate-certificates"
|
||||||
|
set: false
|
||||||
remediation: |
|
remediation: |
|
||||||
If using a Kubelet config file, edit the file to add the line rotateCertificates: true.
|
If using a Kubelet config file, edit the file to add the line rotateCertificates: true.
|
||||||
If using command line arguments, edit the kubelet service file $kubeletsvc
|
If using command line arguments, edit the kubelet service file $kubeletsvc
|
||||||
|
@ -249,12 +249,15 @@ groups:
|
|||||||
text: "Ensure that the --rotate-certificates argument is not set to false (Scored)"
|
text: "Ensure that the --rotate-certificates argument is not set to false (Scored)"
|
||||||
audit: "ps -fC $kubeletbin"
|
audit: "ps -fC $kubeletbin"
|
||||||
tests:
|
tests:
|
||||||
|
bin_op: or
|
||||||
test_items:
|
test_items:
|
||||||
- flag: "--rotate-certificates"
|
- flag: "--rotate-certificates"
|
||||||
compare:
|
compare:
|
||||||
op: eq
|
op: eq
|
||||||
value: true
|
value: true
|
||||||
set: true
|
set: true
|
||||||
|
- flag: "--rotate-certificates"
|
||||||
|
set: false
|
||||||
remediation: |
|
remediation: |
|
||||||
If using a Kubelet config file, edit the file to add the line rotateCertificates: true.
|
If using a Kubelet config file, edit the file to add the line rotateCertificates: true.
|
||||||
If using command line arguments, edit the kubelet service file $kubeletsvc
|
If using command line arguments, edit the kubelet service file $kubeletsvc
|
||||||
|
@ -84,20 +84,33 @@ node:
|
|||||||
cafile:
|
cafile:
|
||||||
- "/etc/kubernetes/pki/ca.crt"
|
- "/etc/kubernetes/pki/ca.crt"
|
||||||
- "/etc/kubernetes/certs/ca.crt"
|
- "/etc/kubernetes/certs/ca.crt"
|
||||||
svc:
|
- "/etc/kubernetes/cert/ca.pem"
|
||||||
|
svc:
|
||||||
|
# These paths must also be included
|
||||||
|
# in the 'confs' property below
|
||||||
- "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
|
- "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
|
||||||
- "/etc/systemd/system/kubelet.service"
|
- "/etc/systemd/system/kubelet.service"
|
||||||
|
- "/lib/systemd/system/kubelet.service"
|
||||||
bins:
|
bins:
|
||||||
- "hyperkube kubelet"
|
- "hyperkube kubelet"
|
||||||
- "kubelet"
|
- "kubelet"
|
||||||
kubeconfig:
|
kubeconfig:
|
||||||
- "/etc/kubernetes/kubelet.conf"
|
- "/etc/kubernetes/kubelet.conf"
|
||||||
- "/var/lib/kubelet/kubeconfig"
|
- "/var/lib/kubelet/kubeconfig"
|
||||||
|
- "/etc/kubernetes/kubelet-kubeconfig"
|
||||||
confs:
|
confs:
|
||||||
- "/var/lib/kubelet/config.yaml"
|
- "/var/lib/kubelet/config.yaml"
|
||||||
- "/etc/kubernetes/kubelet/kubelet-config.json"
|
- "/etc/kubernetes/kubelet/kubelet-config.json"
|
||||||
- "/home/kubernetes/kubelet-config.yaml"
|
- "/home/kubernetes/kubelet-config.yaml"
|
||||||
- "/etc/default/kubelet"
|
- "/etc/default/kubelet"
|
||||||
|
## Due to the fact that the kubelet might be configured
|
||||||
|
## without a kubelet-config file, we use a work-around
|
||||||
|
## of pointing to the systemd service file (which can also
|
||||||
|
## hold kubelet configuration).
|
||||||
|
## Note: The following paths must match the one under 'svc'
|
||||||
|
- "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
|
||||||
|
- "/etc/systemd/system/kubelet.service"
|
||||||
|
- "/lib/systemd/system/kubelet.service"
|
||||||
defaultconf: "/var/lib/kubelet/config.yaml"
|
defaultconf: "/var/lib/kubelet/config.yaml"
|
||||||
defaultsvc: "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
|
defaultsvc: "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
|
||||||
defaultkubeconfig: "/etc/kubernetes/kubelet.conf"
|
defaultkubeconfig: "/etc/kubernetes/kubelet.conf"
|
||||||
@ -111,6 +124,10 @@ node:
|
|||||||
confs:
|
confs:
|
||||||
- /etc/kubernetes/proxy
|
- /etc/kubernetes/proxy
|
||||||
- /etc/kubernetes/addons/kube-proxy-daemonset.yaml
|
- /etc/kubernetes/addons/kube-proxy-daemonset.yaml
|
||||||
|
kubeconfig:
|
||||||
|
- /etc/kubernetes/kubelet-kubeconfig
|
||||||
|
svc:
|
||||||
|
- "/lib/systemd/system/kube-proxy.service"
|
||||||
defaultconf: /etc/kubernetes/addons/kube-proxy-daemonset.yaml
|
defaultconf: /etc/kubernetes/addons/kube-proxy-daemonset.yaml
|
||||||
defaultkubeconfig: "/etc/kubernetes/proxy.conf"
|
defaultkubeconfig: "/etc/kubernetes/proxy.conf"
|
||||||
|
|
||||||
|
33
job-iks.yaml
Normal file
33
job-iks.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: kube-bench
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
hostPID: true
|
||||||
|
containers:
|
||||||
|
- name: kube-bench
|
||||||
|
image: aquasec/kube-bench:latest
|
||||||
|
command: ["kube-bench", "--version", "1.13", "node"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: var-lib-kubelet
|
||||||
|
mountPath: /var/lib/kubelet
|
||||||
|
- name: etc-systemd
|
||||||
|
mountPath: /etc/systemd
|
||||||
|
- name: etc-kubernetes
|
||||||
|
mountPath: /etc/kubernetes
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: var-lib-kubelet
|
||||||
|
hostPath:
|
||||||
|
path: "/var/lib/kubelet"
|
||||||
|
- name: etc-systemd
|
||||||
|
hostPath:
|
||||||
|
path: "/lib/systemd"
|
||||||
|
- name: etc-kubernetes
|
||||||
|
hostPath:
|
||||||
|
path: "/etc/kubernetes"
|
||||||
|
- name: usr-bin
|
||||||
|
hostPath:
|
||||||
|
path: "/usr/bin"
|
Loading…
Reference in New Issue
Block a user