Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCP4 Optimize KubeletConfig rules #10464

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 10 additions & 8 deletions applications/openshift/kubelet/kubelet_anonymous_auth/rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ documentation_complete: true

prodtype: eks,ocp4

platform: {{{ product }}}

{{%- if product == "eks" %}}
{{%- set kubeletconf_path = "/etc/kubernetes/kubelet/kubelet-config.json" %}}
{{%- else %}}
{{%- set kubeletconf_path = "/etc/kubernetes/kubelet.conf" %}}
{{%- endif %}}

platform: {{{ product }}}-node

title: 'Disable Anonymous Authentication to the Kubelet'

description: |-
Expand Down Expand Up @@ -52,10 +52,12 @@ ocil: |-
<pre>$ for NODE_NAME in $(oc get nodes -ojsonpath='{.items[*].metadata.name}'); do oc get --raw /api/v1/nodes/$NODE_NAME/proxy/configz | jq '.kubeletconfig|.kind="KubeletConfiguration"|.apiVersion="kubelet.config.k8s.io/v1beta1"' | grep -A1 anonymous; done</pre>
The output should return <pre>enabled: false</pre>.

warnings:
- general: |-
{{{ openshift_cluster_setting_kubeletconfig() | indent(4) }}}

template:
name: kubelet_combine
yuumasato marked this conversation as resolved.
Show resolved Hide resolved

name: yamlfile_value
vars:
filepath: '/etc/kubernetes/compliance-operator/kubeletconfig/openscap-kubeletconfig'
yamlpath: ".kubeletconfig.authentication.anonymous.enabled"
check_existence: "all_exist"
values:
- value: "false"
operation: "equals"

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 10 additions & 9 deletions applications/openshift/kubelet/kubelet_authorization_mode/rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ documentation_complete: true

prodtype: eks,ocp4

platform: {{{ product }}}

{{%- if product == "eks" %}}
{{%- set kubeletconf_path = "/etc/kubernetes/kubelet/kubelet-config.json" %}}
{{%- else %}}
{{%- set kubeletconf_path = "/etc/kubernetes/kubelet.conf" %}}
{{%- endif %}}

platform: {{{ product }}}-node

title: 'Ensure authorization is set to Webhook'

description: |-
Expand All @@ -31,7 +31,6 @@ rationale: |-
identifiers:
cce@ocp4: CCE-83593-4


severity: medium

references:
Expand All @@ -49,10 +48,12 @@ ocil: |-
Verify that the output is not set to <tt>mode: AlwaysAllow</tt>, or missing
(defaults to <tt>mode: Webhook</tt>).

warnings:
- general: |-
{{{ openshift_cluster_setting_kubeletconfig() | indent(4) }}}


template:
name: kubelet_combine
name: yamlfile_value
vars:
filepath: '/etc/kubernetes/compliance-operator/kubeletconfig/openscap-kubeletconfig'
yamlpath: ".kubeletconfig.authorization.mode"
check_existence: "all_exist"
values:
- value: "AlwaysAllow"
operation: "not equal"

This file was deleted.

This file was deleted.

Loading
Loading