|
1 |
| -# |
2 |
| -# Copyright 2019, Schuberg Philis B.V. |
3 |
| -# |
4 |
| -# Licensed under the Apache License, Version 2.0 (the "License"); |
5 |
| -# you may not use this file except in compliance with the License. |
6 |
| -# You may obtain a copy of the License at |
7 |
| -# |
8 |
| -# http://www.apache.org/licenses/LICENSE-2.0 |
9 |
| -# |
10 |
| -# Unless required by applicable law or agreed to in writing, software |
11 |
| -# distributed under the License is distributed on an "AS IS" BASIS, |
12 |
| -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 |
| -# See the License for the specific language governing permissions and |
14 |
| -# limitations under the License. |
15 |
| -# |
16 |
| -# author: Kristian Vlaardingerbroek |
17 |
| - |
18 |
| -title '1.5 Master Node: etcd' |
| 1 | +title '2 Etcd Node' |
19 | 2 |
|
20 | 3 | etcd_regex = Regexp.new(%r{/usr/bin/etcd})
|
21 | 4 | etcd_process = processes(etcd_regex)
|
|
25 | 8 | etcd_process.exists?
|
26 | 9 | end
|
27 | 10 |
|
28 |
| -control 'cis-kubernetes-benchmark-1.5.1' do |
| 11 | +control 'cis-kubernetes-benchmark:2.1' do |
29 | 12 | title 'Ensure that the --cert-file and --key-file arguments are set as appropriate'
|
30 | 13 | desc "Configure TLS encryption for the etcd service.\n\nRationale: etcd is a highly-available key value store used by Kubernetes deployments for persistent storage of all of its REST API objects. These objects are sensitive in nature and should be encrypted in transit."
|
31 | 14 | impact 1.0
|
32 | 15 |
|
33 |
| - tag cis: 'kubernetes:1.5.1' |
| 16 | + tag cis: 'kubernetes:2.1' |
34 | 17 | tag level: 1
|
35 | 18 |
|
36 | 19 | describe.one do
|
|
54 | 37 | end
|
55 | 38 | end
|
56 | 39 |
|
57 |
| -control 'cis-kubernetes-benchmark-1.5.2' do |
| 40 | +control 'cis-kubernetes-benchmark:2.2' do |
58 | 41 | title 'Ensure that the --client-cert-auth argument is set to true'
|
59 | 42 | desc "Enable client authentication on etcd service.\n\nRationale: etcd is a highly-available key value store used by Kubernetes deployments for persistent storage of all of its REST API objects. These objects are sensitive in nature and should not be available to unauthenticated clients. You should enable the client authentication via valid certificates to secure the access to the etcd service."
|
60 | 43 | impact 1.0
|
61 | 44 |
|
62 |
| - tag cis: 'kubernetes:1.5.2' |
| 45 | + tag cis: 'kubernetes:2.2' |
63 | 46 | tag level: 1
|
64 | 47 |
|
65 | 48 | describe.one do
|
|
73 | 56 | end
|
74 | 57 | end
|
75 | 58 |
|
76 |
| -control 'cis-kubernetes-benchmark-1.5.3' do |
| 59 | +control 'cis-kubernetes-benchmark:2.3' do |
77 | 60 | title 'Ensure that the --auto-tls argument is not set to true'
|
78 | 61 | desc "Do not use self-signed certificates for TLS.\n\nRationale: etcd is a highly-available key value store used by Kubernetes deployments for persistent storage of all of its REST API objects. These objects are sensitive in nature and should not be available to unauthenticated clients. You should enable the client authentication via valid certificates to secure the access to the etcd service."
|
79 | 62 | impact 1.0
|
80 | 63 |
|
81 |
| - tag cis: 'kubernetes:1.5.3' |
| 64 | + tag cis: 'kubernetes:2.3' |
82 | 65 | tag level: 1
|
83 | 66 |
|
84 | 67 | describe etcd_process.commands.to_s do
|
85 | 68 | it { should_not match(/--auto-tls=true/) }
|
86 | 69 | end
|
87 | 70 | end
|
88 | 71 |
|
89 |
| -control 'cis-kubernetes-benchmark-1.5.4' do |
| 72 | +control 'cis-kubernetes-benchmark:2.4' do |
90 | 73 | title 'Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate'
|
91 | 74 | desc "etcd should be configured to make use of TLS encryption for peer connections.\n\nRationale: etcd is a highly-available key value store used by Kubernetes deployments for persistent storage of all of its REST API objects. These objects are sensitive in nature and should be encrypted in transit and also amongst peers in the etcd clusters."
|
92 | 75 | impact 1.0
|
93 | 76 |
|
94 |
| - tag cis: 'kubernetes:1.5.4' |
| 77 | + tag cis: 'kubernetes:2.4' |
95 | 78 | tag level: 1
|
96 | 79 |
|
97 | 80 | describe.one do
|
|
115 | 98 | end
|
116 | 99 | end
|
117 | 100 |
|
118 |
| -control 'cis-kubernetes-benchmark-1.5.5' do |
| 101 | +control 'cis-kubernetes-benchmark:2.5' do |
119 | 102 | title 'Ensure that the --peer-client-cert-auth argument is set to true'
|
120 | 103 | desc "etcd should be configured for peer authentication.\n\nRationale: etcd is a highly-available key value store used by Kubernetes deployments for persistent storage of all of its REST API objects. These objects are sensitive in nature and should be accessible only by authenticated etcd peers in the etcd cluster."
|
121 | 104 | impact 1.0
|
122 | 105 |
|
123 |
| - tag cis: 'kubernetes:1.5.5' |
| 106 | + tag cis: 'kubernetes:2.5' |
124 | 107 | tag level: 1
|
125 | 108 |
|
126 | 109 | describe.one do
|
|
134 | 117 | end
|
135 | 118 | end
|
136 | 119 |
|
137 |
| -control 'cis-kubernetes-benchmark-1.5.6' do |
| 120 | +control 'cis-kubernetes-benchmark:2.6' do |
138 | 121 | title 'Ensure that the --peer-auto-tls argument is not set to true'
|
139 | 122 | desc "Do not use automatically generated self-signed certificates for TLS connections between peers.\n\nRationale: etcd is a highly-available key value store used by Kubernetes deployments for persistent storage of all of its REST API objects. These objects are sensitive in nature and should be accessible only by authenticated etcd peers in the etcd cluster. Hence, do not use self-signed certificates for authentication."
|
140 | 123 | impact 1.0
|
141 | 124 |
|
142 |
| - tag cis: 'kubernetes:1.5.6' |
| 125 | + tag cis: 'kubernetes:2.6' |
143 | 126 | tag level: 1
|
144 | 127 |
|
145 | 128 | describe etcd_process.commands.to_s do
|
146 | 129 | it { should_not match(/--peer-auto-tls=true/) }
|
147 | 130 | end
|
148 | 131 | end
|
149 | 132 |
|
150 |
| -control 'cis-kubernetes-benchmark-1.5.9' do |
| 133 | +control 'cis-kubernetes-benchmark:2.7' do |
151 | 134 | title 'Ensure that a unique Certificate Authority is used for etcd'
|
152 | 135 | desc "Use a different certificate authority for etcd from the one used for Kubernetes.\n\nRationale: etcd is a highly available key-value store used by Kubernetes deployments for persistent storage of all of its REST API objects. Its access should be restricted to specifically designated clients and peers only.\nAuthentication to etcd is based on whether the certificate presented was issued by a trusted certificate authority. There is no checking of certificate attributes such as common name or subject alternative name. As such, if any attackers were able to gain access to any certificate issued by the trusted certificate authority, they would be able to gain full access to the etcd database."
|
153 | 136 | impact 0.0
|
154 | 137 |
|
155 |
| - tag cis: 'kubernetes:1.5.9' |
| 138 | + tag cis: 'kubernetes:2.7' |
156 | 139 | tag level: 2
|
157 | 140 |
|
158 | 141 | only_if { cis_level == 2 }
|
159 | 142 |
|
160 |
| - describe 'cis-kubernetes-benchmark-1.5.9' do |
| 143 | + describe 'cis-kubernetes-benchmark:2.7' do |
161 | 144 | skip 'Review if the CA used for etcd is different from the one used for Kubernetes'
|
162 | 145 | end
|
163 | 146 | end
|
0 commit comments