Skip to content

Commit

Permalink
bsi_app_4_4_A21
Browse files Browse the repository at this point in the history
  • Loading branch information
ermeratos committed Apr 25, 2024
1 parent 18c11e4 commit 702245f
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
documentation_complete: true

title: Ensure that the LifecycleAndUtilization profile for the Kube Descheduler operator is enabled

description: |-
If there is an increased risk of external influences and a very high need for protection, pods should be stopped and restarted regularly.
No pod should run for more than 24 hours. The availability of the applications in the pod should be ensured.
rationale: |-
If there is an increased risk of external influences and a very high need for protection, pods should be stopped and restarted regularly.
identifiers: {}

references:
bsi: APP.4.4.A21

severity: medium

ocil_clause: "The LifecycleAndUtilization profile for the Kube Descheduler operator is not enabled"

ocil: |-
Run the following command to edit the KubeDescheduler object:
<pre>$ oc edit kubedeschedulers.operator.openshift.io cluster -n openshift-kube-descheduler-operator </pre>
Make sure the LifecycleAndUtilization profile is listed under .spec.profiles
{{% set jqfilter = '[.spec.profiles[] | if match("LifecycleAndUtilization") !=null then true else false end]' %}}

warnings:
- general: |-
{{{ openshift_filtered_cluster_setting({'/apis/operator.openshift.io/v1/namespaces/openshift-kube-descheduler-operator/kubedeschedulers/cluster': jqfilter}) | indent(4) }}}
template:
name: yamlfile_value
vars:
ocp_data: "true"
filepath: {{{ openshift_filtered_path('/apis/operator.openshift.io/v1/namespaces/openshift-kube-descheduler-operator/kubedeschedulers/cluster', jqfilter) }}}
yamlpath: "[:]"
check_existence: "at_least_one_exists"
entity_check: "at least one"
values:
- value: "true"
operation: "equals"

#this needs to be fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
documentation_complete: true

title: Ensure that the Kube Descheduler operator is deployed

description: |-
If there is an increased risk of external influences and a very high need for protection, pods should be stopped and restarted regularly.
No pod should run for more than 24 hours. The availability of the applications in the pod should be ensured.
rationale: |-
If there is an increased risk of external influences and a very high need for protection, pods should be stopped and restarted regularly.
identifiers: {}

references:
bsi: APP.4.4.A21

severity: medium

ocil_clause: "No CRDs from the Kube Descheduler operator were found"

ocil: |-
Run the following command to retrieve the customresourcedefinitions objects in the system:
<pre>$ oc get crds </pre>
Make sure there is a crd for the Kube Descheduler operator.
{{% set jqfilter = '[.items[] | select(.metadata.name =="kubedeschedulers.operator.openshift.io") | .metadata.name]' %}}

warnings:
- general: |-
{{{ openshift_filtered_cluster_setting({'/apis/apiextensions.k8s.io/v1/customresourcedefinitions?limit=500': jqfilter}) | indent(4) }}}
template:
name: yamlfile_value
vars:
ocp_data: "true"
filepath: {{{ openshift_filtered_path('/apis/apiextensions.k8s.io/v1/customresourcedefinitions?limit=500', jqfilter) }}}
yamlpath: "[:]"
check_existence: "at_least_one_exists"
entity_check: "at least one"
values:
- value: ".*"
operation: "pattern match"
11 changes: 8 additions & 3 deletions controls/bsi_app_4_4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,15 @@ controls:
levels:
- elevated
description: >-
Pods SHOULD be stopped and restarted regularly if there is an increased risk of external
interference and a very high need for protection. No pod SHOULD run for more than 24
(1) Pods SHOULD be stopped and restarted regularly if there is an increased risk of external
interference and a very high need for protection.
(2) No pod SHOULD run for more than 24
hours. The availability of the applications in a pod SHOULD be ensured.
notes: >-
TBD
status: pending
rules: []
rules:
# Section 1
- kube_descheduler_operator_exists
# Section 2
- kube_descheduler_lifecycle_policy

0 comments on commit 702245f

Please sign in to comment.