mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-25 12:38:05 +00:00
Update K3s hardening guide to CIS Kubernetes Benchmark 1.6
Signed-off-by: Guilherme Macedo <guilherme.macedo@suse.com>
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: CIS v1.6 Benchmark - Self-Assessment Guide - Rancher v2.6
|
||||
weight: 101
|
||||
---
|
||||
|
||||
### CIS v1.6 Kubernetes Benchmark - Rancher v2.6 with Kubernetes v1.18 to v1.21
|
||||
|
||||
[Click here to download a PDF version of this document](https://releases.rancher.com/documents/security/2.6/Rancher_v2-6_CIS_v1-6_Benchmark_Assessment.pdf).
|
||||
|
||||
#### Overview
|
||||
|
||||
This document is a companion to the Rancher v2.6 security hardening guide. The hardening guide provides prescriptive guidance for hardening a production installation of Rancher, and this benchmark guide is meant to help you evaluate the level of security of the hardened cluster against each control in the benchmark.
|
||||
|
||||
This guide corresponds to specific versions of the hardening guide, Rancher, CIS Benchmark and Kubernetes:
|
||||
|
||||
| Hardening Guide Version | Rancher Version | CIS Benchmark Version | Kubernetes Version |
|
||||
| ----------------------- | --------------- | --------------------- | ------------------- |
|
||||
| Hardening Guide CIS v1.6 Benchmark | Rancher v2.6.3 | CIS v1.6 | Kubernetes v1.18, v1.19, v1.20 and v1.21 |
|
||||
|
||||
Because Rancher and RKE install Kubernetes services as Docker containers, many of the control verification checks in the CIS Kubernetes Benchmark do not apply and will have a result of \`Not Applicable\`. This guide will walk through the various controls and provide updated example commands to audit compliance in Rancher created clusters.
|
||||
|
||||
This document is to be used by Rancher operators, security teams, auditors and decision makers.
|
||||
|
||||
For more detail about each audit, including rationales and remediations for failing tests, you can refer to the corresponding section of the CIS Kubernetes Benchmark v1.6. You can download the benchmark, after creating a free account, in [Center for Internet Security (CIS)](https://www.cisecurity.org/benchmark/kubernetes/).
|
||||
|
||||
#### Testing controls methodology
|
||||
|
||||
Rancher and RKE install Kubernetes services via Docker containers. Configuration is defined by arguments passed to the container at the time of initialization, not via configuration files.
|
||||
|
||||
Where control audits differ from the original CIS benchmark, the audit commands specific to Rancher are provided for testing. When performing the tests, you will need access to the Docker command line on the hosts of all three RKE roles. The commands also make use of the [kubectl](https://kubernetes.io/docs/tasks/tools/) (with a valid configuration file) and [jq](https://stedolan.github.io/jq/) tools, which are required in the testing and evaluation of test results.
|
||||
|
||||
> NOTE: Only `automated` tests (previously called `scored`) are covered in this guide.
|
||||
|
||||
### Controls
|
||||
|
||||
---
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: CIS Self Assessment Guide
|
||||
weight: 90
|
||||
---
|
||||
|
||||
### CIS Kubernetes Benchmark v1.6 - K3s with Kubernetes v1.17 to v1.21
|
||||
|
||||
#### Overview
|
||||
|
||||
This document is a companion to the K3s security hardening guide. The hardening guide provides prescriptive guidance for hardening a production installation of K3s, and this benchmark guide is meant to help you evaluate the level of security of the hardened cluster against each control in the CIS Kubernetes Benchmark. It is to be used by K3s operators, security teams, auditors, and decision-makers.
|
||||
|
||||
This guide is specific to the **v1.17**, **v1.18**, **v1.19**, **v1.20** and **v1.21** release line of K3s and the **v1.6** release of the CIS Kubernetes Benchmark.
|
||||
|
||||
For more information about each control, including detailed descriptions and remediations for failing tests, you can refer to the corresponding section of the CIS Kubernetes Benchmark v1.6. You can download the benchmark, after creating a free account, in [Center for Internet Security (CIS)](https://www.cisecurity.org/benchmark/kubernetes/).
|
||||
|
||||
#### Testing controls methodology
|
||||
|
||||
Each control in the CIS Kubernetes Benchmark was evaluated against a K3s cluster that was configured according to the accompanying hardening guide.
|
||||
|
||||
Where control audits differ from the original CIS benchmark, the audit commands specific to K3s are provided for testing.
|
||||
|
||||
These are the possible results for each control:
|
||||
|
||||
- **Pass** - The K3s cluster under test passed the audit outlined in the benchmark.
|
||||
- **Not Applicable** - The control is not applicable to K3s because of how it is designed to operate. The remediation section will explain why this is so.
|
||||
- **Warn** - The control is manual in the CIS benchmark and it depends on the cluster's use case or some other factor that must be determined by the cluster operator. These controls have been evaluated to ensure K3s does not prevent their implementation, but no further configuration or auditing of the cluster under test has been performed.
|
||||
|
||||
This guide makes the assumption that K3s is running as a Systemd unit. Your installation may vary and will require you to adjust the "audit" commands to fit your scenario.
|
||||
|
||||
> NOTE: Only `automated` tests (previously called `scored`) are covered in this guide.
|
||||
|
||||
### Controls
|
||||
|
||||
---
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
results=${1:?path to kube-bench json results is a required argument}
|
||||
test_helpers=${2:?path to kube-bench test_helpers scripts is a required argument}
|
||||
header=${3:?path to header file is a required argument}
|
||||
|
||||
[ -f ${results} ] || (echo "file:'${results}' does not exist"; exit 1)
|
||||
[ -d ${test_helpers} ] || (echo "dir: '${test_helpers}' not a valid directory"; exit 1)
|
||||
|
||||
docker run -v${results}:/source/results.json -v ${test_helpers}:/test_helpers -it --rm doc_converters:latest results_to_md
|
||||
docker run -v ${results}:/source/results.json -v ${test_helpers}:/test_helpers -v ${header}:/headers/header.md -it --rm doc_converters:latest results_to_md
|
||||
|
||||
@@ -1,48 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
#results_file="${1:-/source/results.json}"
|
||||
results_file="${1:-/home/paraglade/brain/projects/cis_benchmark/clusters/cis/csr.json}"
|
||||
#test_helpers="${2:-/test_helpers}"
|
||||
test_helpers="${2:-/home/paraglade/brain/repos/rancher-security-scan/package/helper_scripts}"
|
||||
results_file="${1:-/source/results.json}"
|
||||
test_helpers="${2:-/test_helpers}"
|
||||
header_file="${3:-/headers/header.md}"
|
||||
|
||||
header() {
|
||||
cat <<EOF
|
||||
---
|
||||
title: CIS 1.6 Benchmark - Self-Assessment Guide - Rancher v2.5
|
||||
weight: 101
|
||||
---
|
||||
|
||||
### CIS v1.6 Kubernetes Benchmark - Rancher v2.5 with Kubernetes v1.18
|
||||
|
||||
[Click here to download a PDF version of this document](https://releases.rancher.com/documents/security/2.5/Rancher_1.6_Benchmark_Assessment.pdf)
|
||||
|
||||
#### Overview
|
||||
|
||||
This document is a companion to the Rancher v2.5 security hardening guide. The hardening guide provides prescriptive guidance for hardening a production installation of Rancher, and this benchmark guide is meant to help you evaluate the level of security of the hardened cluster against each control in the benchmark.
|
||||
|
||||
This guide corresponds to specific versions of the hardening guide, Rancher, CIS Benchmark, and Kubernetes:
|
||||
|
||||
Hardening Guide Version | Rancher Version | CIS Benchmark Version | Kubernetes Version
|
||||
---------------------------|----------|---------|-------
|
||||
Hardening Guide with CIS 1.5 Benchmark | Rancher v2.5 | CIS v1.5| Kubernetes v1.15
|
||||
|
||||
Because Rancher and RKE install Kubernetes services as Docker containers, many of the control verification checks in the CIS Kubernetes Benchmark don't apply and will have a result of \`Not Applicable\`. This guide will walk through the various controls and provide updated example commands to audit compliance in Rancher-created clusters.
|
||||
|
||||
This document is to be used by Rancher operators, security teams, auditors and decision makers.
|
||||
|
||||
For more detail about each audit, including rationales and remediations for failing tests, you can refer to the corresponding section of the CIS Kubernetes Benchmark v1.5. You can download the benchmark after logging in to [CISecurity.org]( https://www.cisecurity.org/benchmark/kubernetes/).
|
||||
|
||||
#### Testing controls methodology
|
||||
|
||||
Rancher and RKE install Kubernetes services via Docker containers. Configuration is defined by arguments passed to the container at the time of initialization, not via configuration files.
|
||||
|
||||
Where control audits differ from the original CIS benchmark, the audit commands specific to Rancher Labs are provided for testing.
|
||||
When performing the tests, you will need access to the Docker command line on the hosts of all three RKE roles. The commands also make use of the the [jq](https://stedolan.github.io/jq/) and [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) (with valid config) tools to and are required in the testing and evaluation of test results.
|
||||
|
||||
> NOTE: only scored tests are covered in this guide.
|
||||
|
||||
### Controls
|
||||
EOF
|
||||
cat ${header_file}
|
||||
}
|
||||
|
||||
get_ids() {
|
||||
|
||||
Reference in New Issue
Block a user