Skip to content

Commit 4be94d4

Browse files
committed
Add check for the scheduler not having the bind address set
This addresses part of the CIS control 1.4.2
1 parent 6bd7458 commit 4be94d4

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
documentation_complete: true
2+
3+
prodtype: ocp4
4+
5+
title: Ensure that the bind-address parameter is not used
6+
7+
description: |-
8+
The Scheduler API service which runs on port 10251/TCP by default is used for
9+
health and metrics information and is available without authentication or
10+
encryption. As such it should only be bound to a localhost interface, to
11+
minimize the cluster's attack surface.
12+
13+
rationale: |-
14+
In OpenShift 4, The Kubernetes Scheduler operator manages and updates the
15+
Kubernetes Scheduler deployed on top of OpenShift. By default, the operator
16+
exposes metrics via metrics service. The metrics are collected from the
17+
Kubernetes Scheduler operator. Profiling data is sent to healthzPort,
18+
the port of the localhost healthz endpoint. Changing this value may disrupt
19+
components that monitor the kubelet health.
20+
21+
references:
22+
cis: 1.4.2
23+
24+
severity: medium
25+
26+
warnings:
27+
- general: |-
28+
{{{ openshift_cluster_setting("/api/v1/namespaces/openshift-kube-scheduler/configmaps/kube-scheduler-pod") | indent(4) }}}
29+
30+
template:
31+
name: yamlfile_value
32+
vars:
33+
ocp_data: "true"
34+
filepath: /api/v1/namespaces/openshift-kube-scheduler/configmaps/kube-scheduler-pod
35+
yamlpath: '.data["pod.yaml"]'
36+
values:
37+
- value: "bind-address"
38+
operation: "pattern match"
39+
type: "string"
40+
entity_check: "none satisfy"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
default_result: PASS

ocp4/profiles/cis.profile

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ selections:
113113
# 1.4.1 Ensure that the --profiling argument is set to false (info only)
114114
# Handled by rbac_debug_role_protects_pprof
115115
# 1.4.2 Ensure that the --bind-address argument is set to 127.0.0.1
116+
- scheduler_no_bind_address
116117

117118
### 2 etcd
118119
# 2.1 Ensure that the --cert-file and --key-file arguments are set as appropriate

0 commit comments

Comments
 (0)