Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cfg/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ version_mapping:
"k3s-cis-1.7": "k3s-cis-1.7"
"k3s-cis-1.23": "k3s-cis-1.23"
"k3s-cis-1.24": "k3s-cis-1.24"
"k3s-cis-1.11": "k3s-cis-1.11"
"rke-cis-1.7": "rke-cis-1.7"
"rke-cis-1.23": "rke-cis-1.23"
"rke-cis-1.24": "rke-cis-1.24"
Expand Down Expand Up @@ -520,6 +521,12 @@ target_mapping:
- "controlplane"
- "node"
- "policies"
"k3s-cis-1.11":
- "master"
- "etcd"
- "controlplane"
- "node"
- "policies"
"rke-cis-1.7":
- "master"
- "etcd"
Expand Down
54 changes: 54 additions & 0 deletions cfg/k3s-cis-1.11/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
## Version-specific settings that override the values in cfg/config.yaml

master:
components:
- apiserver
- kubelet
- scheduler
- controllermanager
- etcd
- policies
apiserver:
bins:
- containerd
kubelet:
bins:
- containerd
defaultkubeconfig: /var/lib/rancher/k3s/agent/kubelet.kubeconfig
defaultcafile: /var/lib/rancher/k3s/agent/client-ca.crt
scheduler:
bins:
- containerd
kubeconfig:
- /var/lib/rancher/k3s/server/cred/scheduler.kubeconfig
controllermanager:
bins:
- containerd
kubeconfig:
- /var/lib/rancher/k3s/server/cred/controller.kubeconfig
etcd:
bins:
- containerd

etcd:
confs: /var/lib/rancher/k3s/server/db/etcd/config

node:
components:
- kubelet
- proxy
kubelet:
bins:
- containerd
confs:
- /var/lib/rancher/k3s/agent/kubelet.kubeconfig
defaultkubeconfig: /var/lib/rancher/k3s/agent/kubelet.kubeconfig
defaultcafile: /var/lib/rancher/k3s/agent/client-ca.crt
proxy:
bins:
- containerd
defaultkubeconfig: /var/lib/rancher/k3s/agent/kubeproxy.kubeconfig
policies:
components:
- policies
46 changes: 46 additions & 0 deletions cfg/k3s-cis-1.11/controlplane.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
controls:
version: "k3s-cis-1.11"
id: 3
text: "Control Plane Configuration"
type: "controlplane"
groups:
- id: 3.1
text: "Authentication and Authorization"
checks:
- id: 3.1.1
text: "Client certificate authentication should not be used for users (Manual)"
type: "manual"
remediation: |
Alternative mechanisms provided by Kubernetes such as the use of OIDC should be
implemented in place of client certificates.
scored: false

- id: 3.2
text: "Logging"
checks:
- id: 3.2.1
text: "Ensure that a minimal audit policy is created (Automated)"
audit: "journalctl -m -u k3s | grep 'Running kube-apiserver' | tail -n1 | grep 'audit-policy-file'"
tests:
test_items:
- flag: "--audit-policy-file"
set: true
remediation: |
Create an audit policy file for your cluster.
scored: false

- id: 3.2.2
text: "Ensure that the audit policy covers key security concerns (Manual)"
type: "manual"
remediation: |
Review the audit policy provided for the cluster and ensure that it covers
at least the following areas,
- Access to Secrets managed by the cluster. Care should be taken to only
log Metadata for requests to Secrets, ConfigMaps, and TokenReviews, in
order to avoid risk of logging sensitive data.
- Modification of Pod and Deployment objects.
- Use of `pods/exec`, `pods/portforward`, `pods/proxy` and `services/proxy`.
For most requests, minimally logging at the Metadata level is recommended
(the most basic level of logging).
scored: false
144 changes: 144 additions & 0 deletions cfg/k3s-cis-1.11/etcd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
controls:
version: "k3s-cis-1.11"
id: 2
text: "Etcd Node Configuration"
type: "etcd"
groups:
- id: 2
text: "Etcd Node Configuration"
checks:
- id: 2.1
text: "Ensure that the --cert-file and --key-file arguments are set as appropriate (Manual)"
audit_config: "cat $etcdconf"
tests:
bin_op: and
test_items:
- path: "{.client-transport-security.cert-file}"
compare:
op: eq
value: "/var/lib/rancher/k3s/server/tls/etcd/server-client.crt"
- path: "{.client-transport-security.key-file}"
compare:
op: eq
value: "/var/lib/rancher/k3s/server/tls/etcd/server-client.key"
remediation: |
If running on with sqlite or a external DB, etcd checks are Not Applicable.
When running with embedded-etcd, K3s generates cert and key files for etcd.
These are located in /var/lib/rancher/k3s/server/tls/etcd/.
If this check fails, ensure that the configuration file /var/lib/rancher/k3s/server/db/etcd/config
has not been modified to use custom cert and key files.
scored: false

- id: 2.2
text: "Ensure that the --client-cert-auth argument is set to true (Manual)"
audit_config: "cat $etcdconf"
tests:
test_items:
- path: "{.client-transport-security.client-cert-auth}"
compare:
op: eq
value: true
remediation: |
If running on with sqlite or a external DB, etcd checks are Not Applicable.
When running with embedded-etcd, K3s sets the --client-cert-auth parameter to true.
If this check fails, ensure that the configuration file /var/lib/rancher/k3s/server/db/etcd/config
has not been modified to disable client certificate authentication.
scored: false

- id: 2.3
text: "Ensure that the --auto-tls argument is not set to true (Manual)"
audit_config: "cat $etcdconf"
tests:
bin_op: or
test_items:
- path: "{.client-transport-security.auto-tls}"
compare:
op: eq
value: false
- path: "{.client-transport-security.auto-tls}"
set: false
remediation: |
If running on with sqlite or a external DB, etcd checks are Not Applicable.
When running with embedded-etcd, K3s does not set the --auto-tls parameter.
If this check fails, edit the etcd pod specification file /var/lib/rancher/k3s/server/db/etcd/config on the master
node and either remove the --auto-tls parameter or set it to false.
client-transport-security:
auto-tls: false
scored: false

- id: 2.4
text: "Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate (Manual)"
audit_config: "cat $etcdconf"
tests:
bin_op: and
test_items:
- path: "{.peer-transport-security.cert-file}"
compare:
op: eq
value: "/var/lib/rancher/k3s/server/tls/etcd/peer-server-client.crt"
- path: "{.peer-transport-security.key-file}"
compare:
op: eq
value: "/var/lib/rancher/k3s/server/tls/etcd/peer-server-client.key"
remediation: |
If running on with sqlite or a external DB, etcd checks are Not Applicable.
When running with embedded-etcd, K3s generates peer cert and key files for etcd.
These are located in /var/lib/rancher/k3s/server/tls/etcd/.
If this check fails, ensure that the configuration file /var/lib/rancher/k3s/server/db/etcd/config
has not been modified to use custom peer cert and key files.
scored: false

- id: 2.5
text: "Ensure that the --peer-client-cert-auth argument is set to true (Manual)"
audit_config: "cat $etcdconf"
tests:
test_items:
- path: "{.peer-transport-security.client-cert-auth}"
compare:
op: eq
value: true
remediation: |
If running on with sqlite or a external DB, etcd checks are Not Applicable.
When running with embedded-etcd, K3s sets the --peer-cert-auth parameter to true.
If this check fails, ensure that the configuration file /var/lib/rancher/k3s/server/db/etcd/config
has not been modified to disable peer client certificate authentication.
scored: false

- id: 2.6
text: "Ensure that the --peer-auto-tls argument is not set to true (Manual)"
audit_config: "cat $etcdconf"
tests:
bin_op: or
test_items:
- path: "{.peer-transport-security.auto-tls}"
compare:
op: eq
value: false
- path: "{.peer-transport-security.auto-tls}"
set: false
remediation: |
If running on with sqlite or a external DB, etcd checks are Not Applicable.
When running with embedded-etcd, K3s does not set the --peer-auto-tls parameter.
If this check fails, edit the etcd pod specification file /var/lib/rancher/k3s/server/db/etcd/config on the master
node and either remove the --peer-auto-tls parameter or set it to false.
peer-transport-security:
auto-tls: false
scored: false

- id: 2.7
text: "Ensure that a unique Certificate Authority is used for etcd (Manual)"
audit_config: "cat $etcdconf"
tests:
test_items:
- path: "{.peer-transport-security.trusted-ca-file}"
compare:
op: eq
value: "/var/lib/rancher/k3s/server/tls/etcd/peer-ca.crt"
remediation: |
If running on with sqlite or a external DB, etcd checks are Not Applicable.
When running with embedded-etcd, K3s generates a unique certificate authority for etcd.
This is located at /var/lib/rancher/k3s/server/tls/etcd/peer-ca.crt.
If this check fails, ensure that the configuration file /var/lib/rancher/k3s/server/db/etcd/config
has not been modified to use a shared certificate authority.
scored: false
Loading
Loading