SV-254555r1188300_rule
V-254555
SRG-APP-000026-CTR-000070
CNTR-R2-000060
CAT II
10
Edit the "/etc/rancher/rke2/config.yaml" file and enable the audit-policy-file: /etc/rancher/rke2/audit-policy.yaml
Edit the RKE2 configuration file on all RKE2 hosts, located at /etc/rancher/rke2/config.yaml, so it contains the required configuration.
--audit-policy-file= Path to the file that defines the audit policy configuration. (Example: /etc/rancher/rke2/audit-policy.yaml) --audit-log-mode=blocking-strict
If configuration file is updated, restart the RKE2 using the command "systemctl restart rke2-server" for server hosts or "systemctl restart rke2-agent" for agent hosts.
Edit the RKE2 configuration file on all RKE2 hosts, located at /etc/rancher/rke2/config.yaml, so that it contains required configuration.
If using RKE2 v1.24 or older, set: profile: cis-1.6
If using RKE2 v1.25 or newer, set: profile: cis-1.23
For October 2023 releases (v1.25.15+rke2r1, v1.26.10+rke2r1, v1.27.7+rke2r1, v1.28.3+rke2r1), use the generic profile "cis".
If configuration file is updated, restart RKE2 using the command "systemctl restart rke2-server" for server hosts or "systemctl restart rke2-agent" for agent hosts.
Edit the audit policy file, by default, located at /etc/rancher/rke2/audit-policy.yaml to look like the following:
apiVersion: audit.k8s.io/v1 kind: Policy metadata: name: rke2-audit-policy rules:
level: Metadata resources:
group: "" resources: ["secrets"]
level: RequestResponse resources:
group: "" resources: ["*"]
If configuration files are updated on a host, restart the RKE2 service using the command "systemctl restart rke2-server" for server hosts and "systemctl restart rke2-agent" for agent hosts.
Audit logging and policies:
On all hosts running RKE2, run the command:
/bin/ps -ef | grep kube-apiserver | grep -v grep
If --audit-policy-file is not set, this is a finding. If --audit-log-mode is not = "blocking-strict", this is a finding.
Ensure the RKE2 configuration file on all RKE2 hosts, located at /etc/rancher/rke2/config.yaml, contains CIS profile setting. Run the following command: cat /etc/rancher/rke2/config.yaml
RKE2 can be started with the profile flag set to cis, cis-1.23, or cis-1.6 depending on the RKE2 version. Available with October 2023 releases (v1.25.15+rke2r1, v1.26.10+rke2r1, v1.27.7+rke2r1, v1.28.3+rke2r1), use the generic profile: "cis".
If a value for profile is not found or is not set correctly, this is a finding. (Example: "profile: cis")
Check the contents of the audit-policy file. By default, RKE2 expects the audit-policy file to be located at /etc/rancher/rke2/audit-policy.yaml; however, this location can be overridden in the /etc/rancher/rke2/config.yaml file with argument 'kube-apiserver-arg: "audit-policy-file=/etc/rancher/rke2/audit-policy.yaml"'.
If the audit policy file does not exist or does not look like the following, this is a finding.
apiVersion: audit.k8s.io/v1 kind: Policy metadata: name: rke2-audit-policy rules:
level: Metadata resources:
group: "" resources: ["secrets"]
level: RequestResponse resources:
group: "" resources: ["*"]
V-254555
False
CNTR-R2-000060
Audit logging and policies:
On all hosts running RKE2, run the command:
/bin/ps -ef | grep kube-apiserver | grep -v grep
If --audit-policy-file is not set, this is a finding. If --audit-log-mode is not = "blocking-strict", this is a finding.
Ensure the RKE2 configuration file on all RKE2 hosts, located at /etc/rancher/rke2/config.yaml, contains CIS profile setting. Run the following command: cat /etc/rancher/rke2/config.yaml
RKE2 can be started with the profile flag set to cis, cis-1.23, or cis-1.6 depending on the RKE2 version. Available with October 2023 releases (v1.25.15+rke2r1, v1.26.10+rke2r1, v1.27.7+rke2r1, v1.28.3+rke2r1), use the generic profile: "cis".
If a value for profile is not found or is not set correctly, this is a finding. (Example: "profile: cis")
Check the contents of the audit-policy file. By default, RKE2 expects the audit-policy file to be located at /etc/rancher/rke2/audit-policy.yaml; however, this location can be overridden in the /etc/rancher/rke2/config.yaml file with argument 'kube-apiserver-arg: "audit-policy-file=/etc/rancher/rke2/audit-policy.yaml"'.
If the audit policy file does not exist or does not look like the following, this is a finding.
apiVersion: audit.k8s.io/v1 kind: Policy metadata: name: rke2-audit-policy rules:
level: Metadata resources:
group: "" resources: ["secrets"]
level: RequestResponse resources:
group: "" resources: ["*"]
M
5486