-
Notifications
You must be signed in to change notification settings - Fork 3
/
k8s-cis-1.23.0.yaml
219 lines (219 loc) · 9.87 KB
/
k8s-cis-1.23.0.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
---
version: "1.23.0"
name: k8s-cis
title: Node Specification for info collector
commands:
- key: kubeAPIServerSpecFilePermission
title: API server pod specification file permissions
nodeType: master
audit: stat -c %a $apiserver.confs
- key: kubeAPIServerSpecFileOwnership
title: API server pod specification file ownership
nodeType: master
audit: stat -c %U:%G $apiserver.confs
- key: kubeControllerManagerSpecFilePermission
title: Controller manager pod specification file permissions
nodeType: master
audit: stat -c %a $controllermanager.confs
- key: kubeControllerManagerSpecFileOwnership
title: Controller manager pod specification file ownership is set to root:root
nodeType: master
audit: stat -c %U:%G $controllermanager.confs
- key: kubeSchedulerSpecFilePermission
title: Scheduler pod specification file permissions
nodeType: master
audit: stat -c %a $scheduler.confs
- key: kubeSchedulerSpecFileOwnership
title: Scheduler pod specification file ownership
nodeType: master
audit: stat -c %U:%G $scheduler.confs
- key: kubeEtcdSpecFilePermission
title: Etcd pod specification file permissions
nodeType: master
audit: stat -c %a $etcd.confs
- key: kubeEtcdSpecFileOwnership
title: Etcd pod specification file ownership
nodeType: master
audit: stat -c %U:%G $etcd.confs
- key: containerNetworkInterfaceFilePermissions
title: Container Network Interface file permissions
nodeType: master
audit: stat -c %a /*/cni/*
- key: containerNetworkInterfaceFileOwnership
title: Container Network Interface file ownership
nodeType: master
audit: stat -c %U:%G /*/cni/*
- key: etcdDataDirectoryPermissions
title: Etcd data directory permissions
nodeType: master
audit: stat -c %a $etcd.datadirs
- key: etcdDataDirectoryOwnership
title: Etcd data directory Ownership
nodeType: master
audit: stat -c %U:%G $etcd.datadirs
- key: adminConfFilePermissions
title: admin.conf file permissions
nodeType: master
audit: stat -c %a /etc/kubernetes/admin.conf
- key: adminConfFileOwnership
title: admin.conf file ownership
nodeType: master
audit: stat -c %U:%G /etc/kubernetes/admin.conf
- key: schedulerConfFilePermissions
title: scheduler.conf file permissions
nodeType: master
audit: stat -c %a $scheduler.kubeconfig
- key: schedulerConfFileOwnership
title: scheduler.conf file ownership
nodeType: master
audit: stat -c %U:%G $scheduler.kubeconfig
- key: controllerManagerConfFilePermissions
title: controller-manager.conf file permissions
nodeType: master
audit: stat -c %a $controllermanager.kubeconfig
- key: controllerManagerConfFileOwnership
title: controller-manager.conf file ownership
nodeType: master
audit: stat -c %U:%G $controllermanager.kubeconfig
- key: kubePKIDirectoryFileOwnership
title: Kubernetes PKI directory and file ownership
nodeType: master
audit: stat -c %U:%G $(ls -R $kubelet.cafile | awk
'/:$/&&f{s=$0;f=0}/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}NF&&f{print s"/"$0
}')
- key: kubernetesPKICertificateFilePermissions
title: Kubernetes PKI certificate file permissions
nodeType: master
audit: stat -c %a $(ls -aR $kubelet.cafile | awk'/:$/&&f{s=$0;f=0}/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}NF&&f{print s"/"$0}' | grep \.crt$)
- key: kubePKIKeyFilePermissions
title: Kubernetes PKI certificate file permissions
nodeType: master
audit: stat -c %a $(ls -aR $kubelet.cafile | awk '/:$/&&f{s=$0;f=0}/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}NF&&f{print s"/"$0}' | grep \.key$)
- key: kubeletServiceFilePermissions
title: Kubelet service file permissions
nodeType: worker
audit: stat -c %a $kubelet.svc
- key: kubeletServiceFileOwnership
title: Kubelet service file ownership
nodeType: worker
audit: stat -c %U:%G $kubelet.svc
- key: kubeconfigFileExistsPermissions
title: Kubeconfig file exists ensure permissions
nodeType: worker
audit: output=`stat -c %a $(ps -ef | grep $proxy.bins |grep 'kubeconfig' | grep
-o 'kubeconfig=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1')
2>/dev/null` || echo $output
- key: kubeconfigFileExistsOwnership
title: Kubeconfig file exists ensure ownership
nodeType: worker
audit: output=`stat -c %U:%G $(ps -ef | grep $proxy.bins |grep 'kubeconfig' |
grep -o 'kubeconfig=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1')
2>/dev/null` || echo $output
- key: kubeletConfFilePermissions
title: kubelet.conf file permissions
nodeType: worker
audit: stat -c %a $kubelet.kubeconfig
- key: kubeletConfFileOwnership
title: kubelet.conf file ownership
nodeType: worker
audit: stat -c %U:%G $kubelet.kubeconfig
- key: certificateAuthoritiesFilePermissions
title: Client certificate authorities file permissions
nodeType: worker
audit: stat -c %a $(ps -ef | grep kubelet |grep 'client-ca-file' | grep -o
'client-ca-file=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1') 2>
/dev/null
- key: certificateAuthoritiesFileOwnership
title: Client certificate authorities file ownership
nodeType: worker
audit: stat -c %U:%G $(ps -ef | grep $kubelet.bins |grep 'client-ca-file' | grep -o
'client-ca-file=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1') 2>
/dev/null
- key: kubeletConfigYamlConfigurationFilePermission
title: kubelet config.yaml configuration file permissions
nodeType: worker
audit: stat -c %a $kubelet.confs
- key: kubeletConfigYamlConfigurationFileOwnership
title: kubelet config.yaml configuration file ownership
nodeType: worker
audit: stat -c %U:%G $kubelet.confs
- key: kubeletAnonymousAuthArgumentSet
title: kubelet --anonymous-auth argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --anonymous-auth' | grep -o '
--anonymous-auth=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletAuthorizationModeArgumentSet
title: kubelet --authorization-mode argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --authorization-mode' | grep -o '
--authorization-mode=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletClientCaFileArgumentSet
title: kubelet --client-ca-file argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --client-ca-file' | grep -o '
--client-ca-file=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletReadOnlyPortArgumentSet
title: kubelet --read-only-port argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --read-only-port' | grep -o '
--read-only-port=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletStreamingConnectionIdleTimeoutArgumentSet
title: kubelet --streaming-connection-idle-timeout argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --streamingConnectionIdleTimeout' | grep -o
' --streamingConnectionIdleTimeout=[^"]\S*' | awk -F "=" '{print $2}' |awk
'FNR <= 1'
- key: kubeletProtectKernelDefaultsArgumentSet
title: kubelet --protect-kernel-defaults argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --protect-kernel-defaults' | grep -o '
--protect-kernel-defaults=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <=
1'
- key: kubeletMakeIptablesUtilChainsArgumentSet
title: kubelet --make-iptables-util-chains argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --make-iptables-util-chains' | grep -o '
--make-iptables-util-chains=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR
<= 1'
- key: kubeletHostnameOverrideArgumentSet
title: kubelet hostname-override argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --hostname-override' | grep -o '
--hostname-override=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletEventQpsArgumentSet
title: kubelet --event-qps argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --event-qps' | grep -o '
--event-qps=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletTlsCertFileTlsArgumentSet
title: kubelet --tls-cert-file argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --tls-cert-file' | grep -o '
--tls-cert-file=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletTlsPrivateKeyFileArgumentSet
title: kubelet --tls-private-key-file argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --tls-private-key-file' | grep -o '
--tls-private-key-file=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletRotateCertificatesArgumentSet
title: kubelet --rotate-certificates argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep ' --rotate-certificates' | grep -o '
--rotate-certificates=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'
- key: kubeletRotateKubeletServerCertificateArgumentSet
title: kubelet RotateKubeletServerCertificate argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep 'RotateKubeletServerCertificate' | grep -o
'RotateKubeletServerCertificate=[^"]\S*' | awk -F "=" '{print $2}' |awk
'FNR <= 1'
- key: kubeletRotateKubeletServerCertificateArgumentSet
title: kubelet RotateKubeletServerCertificate argument is set
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep 'RotateKubeletServerCertificate' | grep -o
'RotateKubeletServerCertificate=[^"]\S*' | awk -F "=" '{print $2}' |awk
'FNR <= 1'
- key: kubeletOnlyUseStrongCryptographic
title: Kubelet only makes use of Strong Cryptographic
nodeType: worker
audit: ps -ef | grep $kubelet.bins |grep 'TLSCipherSuites' | grep -o
'TLSCipherSuites=[^"]\S*' | awk -F "=" '{print $2}' |awk 'FNR <= 1'