|
| 1 | +policy: 'BSI-APP-4-4' |
| 2 | +title: 'BSI APP.4.4 Kubernetes' |
| 3 | +id: bsi_app_4_4 |
| 4 | +version: '1.0' |
| 5 | +source: https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Grundschutz/International/bsi_it_gs_comp_2022.pdf |
| 6 | +levels: |
| 7 | + - id: basic |
| 8 | + - id: standard |
| 9 | + inherits_from: |
| 10 | + - basic |
| 11 | + - id: elevated |
| 12 | + inherits_from: |
| 13 | + - standard |
| 14 | + |
| 15 | +controls: |
| 16 | + - id: APP.4.4.A1 |
| 17 | + title: Planning the Separation of the Applications |
| 18 | + levels: |
| 19 | + - basic |
| 20 | + description: >- |
| 21 | + Before going live, the manner in which the applications running in the pods in question and |
| 22 | + their different test and production operating environments will be separated MUST be |
| 23 | + planned. Based on the protection needs of the applications, the planning MUST determine |
| 24 | + which architecture of namespaces, meta tags, clusters, and networks adequately addresses the |
| 25 | + risks at hand and whether virtualised servers and networks should also be used. |
| 26 | + The planning MUST include provisions separating for networks, CPUs, and persistent |
| 27 | + volumes. The separation SHOULD also take into account and be aligned with the network |
| 28 | + zone concept and the protection requirements at hand. |
| 29 | + Each application SHOULD run in a separate Kubernetes namespace that includes all the |
| 30 | + programs of the application. Only applications with similar protection needs and similar |
| 31 | + possible attack vectors SHOULD share a Kubernetes cluster. |
| 32 | + notes: >- |
| 33 | + TBD |
| 34 | + status: pending |
| 35 | + rules: [] |
| 36 | + |
| 37 | + - id: APP.4.4.A2 |
| 38 | + title: Planning Automation with CI/CD |
| 39 | + levels: |
| 40 | + - basic |
| 41 | + description: >- |
| 42 | + Automating the operation of applications in Kubernetes using CI/CD MUST ONLY take place |
| 43 | + after appropriate planning. The planning MUST cover the entire lifecycle from commissioning |
| 44 | + to decommissioning, including development, testing, operation, monitoring, and updates. A |
| 45 | + roles and rights concept and the securing of Kubernetes Secrets MUST be part of the planning |
| 46 | + notes: >- |
| 47 | + TBD |
| 48 | + status: pending |
| 49 | + rules: [] |
| 50 | + |
| 51 | + - id: APP.4.4.A3 |
| 52 | + title: Identity and Access Management for Kubernetes |
| 53 | + levels: |
| 54 | + - basic |
| 55 | + description: >- |
| 56 | + Kubernetes and all other control plane applications MUST authenticate and authorise each |
| 57 | + action taken by a user or, in automated mode, corresponding software. This applies whether |
| 58 | + the actions are taken via a client, a web interface, or a corresponding API. Administrative |
| 59 | + actions MUST NOT be performed anonymously. |
| 60 | + Each user MUST ONLY be granted the permissions they absolutely require. Unlimited access |
| 61 | + rights MUST be granted in a very restrictive manner. |
| 62 | + Only a small group of people SHOULD be authorised to define automation processes. Only |
| 63 | + selected administrators SHOULD be given the right to create or change shares for persistent |
| 64 | + volumes in Kubernetes. |
| 65 | + notes: >- |
| 66 | + TBD |
| 67 | + status: pending |
| 68 | + rules: |
| 69 | + - api_server_anonymous_auth |
| 70 | + - kubelet_anonymous_auth |
| 71 | + - kubeadmin_removed |
| 72 | + - rbac_least_privilege |
| 73 | + |
| 74 | + - id: APP.4.4.A4 |
| 75 | + title: Separation of Pods |
| 76 | + levels: |
| 77 | + - basic |
| 78 | + description: >- |
| 79 | + The operating system kernel of nodes MUST have isolation mechanisms to restrict visibility |
| 80 | + and resource usage among the corresponding pods (cf. Linux namespaces and cgroups). At |
| 81 | + minimum, this isolation MUST include process IDs, inter-process communication, user IDs, |
| 82 | + the file system, and the network (including the hostname). |
| 83 | + notes: >- |
| 84 | + Since these are OS based requirements, they are included in the rhcos4 bsi profile |
| 85 | + status: pending |
| 86 | + # rules: |
| 87 | + |
| 88 | + - id: APP.4.4.A5 |
| 89 | + title: Backup in the Cluster |
| 90 | + levels: |
| 91 | + - basic |
| 92 | + description: >- |
| 93 | + A cluster MUST have a backup. The backup MUST include: |
| 94 | + • Persistent volumes |
| 95 | + • Configuration files for Kubernetes and the other programs of the control plane |
| 96 | + • The current state of the Kubernetes cluster, including extensions |
| 97 | + • Databases of the configuration (namely etcd in this case) |
| 98 | + • All infrastructure applications required to operate the cluster and the services within it |
| 99 | + • The data storage of the code and image registries |
| 100 | + Snapshots for the operation of the applications SHOULD also be considered. Snapshots MUST |
| 101 | + NOT be considered a substitute for backups. |
| 102 | + notes: >- |
| 103 | + TBD |
| 104 | + status: pending |
| 105 | + rules: [] |
| 106 | + |
| 107 | + - id: APP.4.4.A6 |
| 108 | + title: Initialisation of Pods |
| 109 | + levels: |
| 110 | + - standard |
| 111 | + description: >- |
| 112 | + If an initialisation (e.g. of an application) takes place in a pod at start-up, this SHOULD take |
| 113 | + place in a separate Init container. It SHOULD be ensured that the initialisation terminates all |
| 114 | + processes that are already running. Kubernetes SHOULD ONLY start the other containers if |
| 115 | + the initialisation is successful. |
| 116 | + notes: >- |
| 117 | + TBD |
| 118 | + status: pending |
| 119 | + rules: [] |
| 120 | + |
| 121 | + - id: APP.4.4.A7 |
| 122 | + title: Separation of Networks for Kubernetes |
| 123 | + levels: |
| 124 | + - standard |
| 125 | + description: >- |
| 126 | + Networks for the administration of nodes, the control plane, and the individual networks of |
| 127 | + application services SHOULD be separated. |
| 128 | + Only the network ports of the pods necessary for operation SHOULD be released into the |
| 129 | + designated networks. If a Kubernetes cluster contains multiple applications, all the network |
| 130 | + connections between the Kubernetes namespaces SHOULD first be prohibited and only |
| 131 | + required network connections permitted (whitelisting). The network ports necessary for the |
| 132 | + administration of the nodes, the runtime, and Kubernetes (including its extensions) SHOULD |
| 133 | + ONLY be accessible from the corresponding administration network and from pods that need |
| 134 | + them. |
| 135 | + Only selected administrators SHOULD be authorised in Kubernetes to manage the CNI and |
| 136 | + create or change rules for the network. |
| 137 | + notes: >- |
| 138 | + TBD |
| 139 | + status: pending |
| 140 | + rules: [] |
| 141 | + |
| 142 | + - id: APP.4.4.A8 |
| 143 | + title: Securing Configuration Files on Kubernetes |
| 144 | + levels: |
| 145 | + - standard |
| 146 | + description: >- |
| 147 | + The configuration files of a Kubernetes cluster, including all its extensions and applications, |
| 148 | + SHOULD be versioned and annotated. |
| 149 | + Access rights to configuration file management software SHOULD be granted in a restrictive |
| 150 | + manner. Read and write access rights to the configuration files of the control plane SHOULD |
| 151 | + be assigned and restricted with particular care. |
| 152 | + notes: >- |
| 153 | + TBD |
| 154 | + status: pending |
| 155 | + rules: [] |
| 156 | + |
| 157 | + - id: APP.4.4.A9 |
| 158 | + title: Use of Kubernetes Service Accounts |
| 159 | + levels: |
| 160 | + - standard |
| 161 | + description: >- |
| 162 | + Pods SHOULD NOT use the "default" service account. Rights SHOULD NOT be granted to the |
| 163 | + "default" service account. Pods for different applications SHOULD run under their own service |
| 164 | + accounts. Access rights for the service accounts of the applications' pods SHOULD be limited |
| 165 | + to those that are strictly necessary. |
| 166 | + Pods that do not require a service account SHOULD not be able to view it or have access to |
| 167 | + corresponding tokens. |
| 168 | + Only control plane pods and pods that absolutely need them SHOULD use privileged service |
| 169 | + accounts. |
| 170 | + Automation programs SHOULD each receive their own tokens, even if they share a common |
| 171 | + service account due to similar tasks. |
| 172 | + notes: >- |
| 173 | + TBD |
| 174 | + status: pending |
| 175 | + rules: [] |
| 176 | + |
| 177 | + - id: APP.4.4.A10 |
| 178 | + title: Securing Automation Processes |
| 179 | + levels: |
| 180 | + - standard |
| 181 | + description: >- |
| 182 | + All automation software processes, such as CI/CD and their pipelines, SHOULD only operate |
| 183 | + with the rights that are strictly necessary. If different user groups can change configurations or |
| 184 | + start pods via automation software, this SHOULD be done for each group through separate |
| 185 | + processes that only have the rights necessary for the respective user group. |
| 186 | + notes: >- |
| 187 | + TBD |
| 188 | + status: pending |
| 189 | + rules: [] |
| 190 | + |
| 191 | + - id: APP.4.4.A11 |
| 192 | + title: Container Monitoring |
| 193 | + levels: |
| 194 | + - standard |
| 195 | + description: >- |
| 196 | + In pods, each container SHOULD define a health check for start-up and operation ("readiness" |
| 197 | + and "liveness"). These checks SHOULD provide information about the availability of the |
| 198 | + software running in a pod. The checks SHOULD fail if the monitored software cannot perform |
| 199 | + its tasks properly. For each of these checks, a time period SHOULD be defined that is |
| 200 | + appropriate for the service running in the pod. Based on these checks, Kubernetes SHOULD |
| 201 | + delete or restart the pods. |
| 202 | + notes: >- |
| 203 | + TBD |
| 204 | + status: pending |
| 205 | + rules: [] |
| 206 | + |
| 207 | + - id: APP.4.4.A12 |
| 208 | + title: Securing Infrastructure Applications |
| 209 | + levels: |
| 210 | + - standard |
| 211 | + description: >- |
| 212 | + If a separate registry for images or automation software, persistent volume management, |
| 213 | + configuration file storage, or similar is in use, its protection SHOULD at least consider: |
| 214 | + • Use of personal and service accounts for access |
| 215 | + • Encrypted communication on all network ports |
| 216 | + • Restrictive assignment of permissions to user and service accounts |
| 217 | + • Logging of changes |
| 218 | + • Regular data backups. |
| 219 | + notes: >- |
| 220 | + TBD |
| 221 | + status: pending |
| 222 | + rules: [] |
| 223 | + |
| 224 | + - id: APP.4.4.A13 |
| 225 | + title: Automated Configuration Auditing |
| 226 | + levels: |
| 227 | + - elevated |
| 228 | + description: >- |
| 229 | + There SHOULD be an automated audit that checks the settings of nodes, of Kubernetes, and of |
| 230 | + the pods of applications against a defined list of allowed settings and standardised |
| 231 | + benchmarks. |
| 232 | + Kubernetes SHOULD enforce these established rules in each cluster by connecting appropriate |
| 233 | + tools. |
| 234 | + notes: >- |
| 235 | + TBD |
| 236 | + status: pending |
| 237 | + rules: [] |
| 238 | + |
| 239 | + - id: APP.4.4.A14 |
| 240 | + title: Use of Dedicated Nodes |
| 241 | + levels: |
| 242 | + - elevated |
| 243 | + description: >- |
| 244 | + In a Kubernetes cluster, nodes SHOULD be assigned dedicated tasks and only run pods that are |
| 245 | + assigned to each task. |
| 246 | + Bastion nodes SHOULD handle all incoming and outgoing data connections of between |
| 247 | + applications and other networks. |
| 248 | + Management nodes SHOULD operate control plane pods and only handle control plane data |
| 249 | + connections. |
| 250 | + If deployed, storage nodes SHOULD only operate the fixed persistent volume services pods in |
| 251 | + a cluster. |
| 252 | + notes: >- |
| 253 | + TBD |
| 254 | + status: pending |
| 255 | + rules: [] |
| 256 | + |
| 257 | + - id: APP.4.4.A15 |
| 258 | + title: Separation of Applications at Node and Cluster Level |
| 259 | + levels: |
| 260 | + - elevated |
| 261 | + description: >- |
| 262 | + Applications with very high protection needs SHOULD each use their own Kubernetes clusters |
| 263 | + or dedicated nodes that are not available for other applications |
| 264 | + notes: >- |
| 265 | + TBD |
| 266 | + status: pending |
| 267 | + rules: [] |
| 268 | + |
| 269 | + - id: APP.4.4.A16 |
| 270 | + title: Use of Operators |
| 271 | + levels: |
| 272 | + - elevated |
| 273 | + description: >- |
| 274 | + The automation of operational tasks in operators SHOULD be used for particularly critical |
| 275 | + applications and control plane programs. |
| 276 | + notes: >- |
| 277 | + TBD |
| 278 | + status: pending |
| 279 | + rules: [] |
| 280 | + |
| 281 | + - id: APP.4.4.A17 |
| 282 | + title: Attestation of Nodes |
| 283 | + levels: |
| 284 | + - elevated |
| 285 | + description: >- |
| 286 | + Nodes SHOULD send a cryptographically secured (and, if possible, TPM-verified) status |
| 287 | + message to the control plane. The control plane SHOULD ONLY accept nodes into a cluster |
| 288 | + that have successfully proven their integrity. |
| 289 | + notes: >- |
| 290 | + TBD |
| 291 | + status: pending |
| 292 | + rules: [] |
| 293 | + |
| 294 | + - id: APP.4.4.A18 |
| 295 | + title: Use of Micro-Segmentation |
| 296 | + levels: |
| 297 | + - elevated |
| 298 | + description: >- |
| 299 | + Pods SHOULD ONLY be able to communicate with each other through the necessary network |
| 300 | + ports, even within a Kubernetes namespace. There SHOULD be rules within the CNI that |
| 301 | + disallow all but the necessary network connections within the Kubernetes namespace. These |
| 302 | + rules SHOULD precisely define the source and destination of the allowed connections using at |
| 303 | + least one of the following criteria: service name, metadata (“labels”), Kubernetes service |
| 304 | + accounts, or certificate-based authentication. |
| 305 | + All the criteria used as labels for a connection SHOULD be secured in such a way that they can |
| 306 | + only be changed by authorised persons and management services. |
| 307 | + notes: >- |
| 308 | + TBD |
| 309 | + status: pending |
| 310 | + rules: [] |
| 311 | + |
| 312 | + - id: APP.4.4.A19 |
| 313 | + title: High Availability of Kubernetes |
| 314 | + levels: |
| 315 | + - elevated |
| 316 | + description: >- |
| 317 | + A Kubernetes operation SHOULD be set up in such a way that if a site fails, the clusters (and |
| 318 | + thus the applications in the pods) either continue to run without interruption or can be |
| 319 | + restarted in a short time at another site. |
| 320 | + Should a restart be required, all the necessary configuration files, images, user data, network |
| 321 | + connections, and other resources required for operation (including the necessary hardware) |
| 322 | + SHOULD already be available at the alternative site. |
| 323 | + For the uninterrupted operation of clusters, the control plane of Kubernetes, the infrastructure |
| 324 | + applications of the clusters, and the pods of the applications SHOULD be distributed across |
| 325 | + several fire zones based on the location data of the corresponding nodes so that the failure of a |
| 326 | + fire zone will not lead to the failure of an application. |
| 327 | + notes: >- |
| 328 | + TBD |
| 329 | + status: pending |
| 330 | + rules: [] |
| 331 | + |
| 332 | + - id: APP.4.4.A20 |
| 333 | + title: Encrypted Data Storage for Pods |
| 334 | + levels: |
| 335 | + - elevated |
| 336 | + description: >- |
| 337 | + The file systems containing the persistent data of the control plane (etcd in particular in this |
| 338 | + context) and the application services SHOULD be encrypted. |
| 339 | + notes: >- |
| 340 | + TBD |
| 341 | + status: pending |
| 342 | + rules: [] |
| 343 | + |
| 344 | + - id: APP.4.4.A21 |
| 345 | + title: Regular Restart of Pods |
| 346 | + levels: |
| 347 | + - elevated |
| 348 | + description: >- |
| 349 | + Pods SHOULD be stopped and restarted regularly if there is an increased risk of external |
| 350 | + interference and a very high need for protection. No pod SHOULD run for more than 24 |
| 351 | + hours. The availability of the applications in a pod SHOULD be ensured. |
| 352 | + notes: >- |
| 353 | + TBD |
| 354 | + status: pending |
| 355 | + rules: [] |
0 commit comments