forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from sig-bsi-grundschutz/bsi-app-4.4-a20to21
Bsi app 4.4 a20to21
- Loading branch information
Showing
4 changed files
with
107 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
applications/openshift/general/kube_descheduler_interval.var
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
documentation_complete: true | ||
|
||
title: 'Maximum number of seconds between descheduler runs' | ||
|
||
description: |- | ||
You can configure the maximum amount of time between descheduler runs in seconds. | ||
|
||
type: string | ||
|
||
operator: equals | ||
|
||
interactive: true | ||
|
||
options: | ||
default: "86400" |
42 changes: 42 additions & 0 deletions
42
applications/openshift/general/kube_descheduler_lifecycle_policy/rule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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 and the correct time between descheduler runs is set under .spec.deschedulingIntervalSeconds | ||
{{% set jqfilter = '[if (any(.spec.profiles[]; . =="LifecycleAndUtilization")) == true and ((.spec.deschedulingIntervalSeconds <= {{.kube_descheduler_interval}}) == true) 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: "all_exist" | ||
entity_check: "all" | ||
values: | ||
- value: "true" | ||
operation: "equals" |
42 changes: 42 additions & 0 deletions
42
applications/openshift/general/kube_descheduler_operator_exists/rule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters