Guide to the Secure Configuration of Red Hat Enterprise OpenShift Container Platform 3

with profile Open Computing Information Security Profile for OpenShift Master Node
This baseline was inspired by the Center for Internet Security (CIS) Kubernetes Benchmark, v1.2.0 - 01-31-2017. For the ComplianceAsCode project to remain in compliance with CIS' terms and conditions, specifically Restrictions(8), note there is no representation or claim that the OpenCIS profile will ensure a system is in compliance or consistency with the CIS baseline.
This guide presents a catalog of security-relevant configuration settings for Red Hat Enterprise OpenShift Container Platform 3. It is a rendering of content structured in the eXtensible Configuration Checklist Description Format (XCCDF) in order to support security automation. The SCAP content is is available in the scap-security-guide package which is developed at https://www.open-scap.org/security-policies/scap-security-guide.

Providing system administrators with such guidance informs them how to securely configure systems under their control in a variety of network roles. Policy makers and baseline creators can use this catalog of settings, with its associated references to higher-level security control catalogs, in order to assist them in security baseline creation. This guide is a catalog, not a checklist, and satisfaction of every item is not likely to be possible or sensible in many operational scenarios. However, the XCCDF format enables granular selection and adjustment of settings, and their association with OVAL and OCIL content provides an automated checking capability. Transformations of this document, and its associated automated checking content, are capable of providing baselines that meet a diverse set of policy objectives. Some example XCCDF Profiles, which are selections of items that form checklists and can be used as baselines, are available with this guide. They can be processed, in an automated fashion, with tools that support the Security Content Automation Protocol (SCAP). The NIST National Checklist Program (NCP), which provides required settings for the United States Government, is one example of a baseline created from this guidance.
Do not attempt to implement any of the settings in this guide without first testing them in a non-operational environment. The creators of this guidance assume no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.

Profile Information

Profile TitleOpen Computing Information Security Profile for OpenShift Master Node
Profile IDxccdf_org.ssgproject.content_profile_opencis-ocp-master

CPE Platforms

  • cpe:/a:redhat:openshift:3.0
  • cpe:/a:redhat:openshift:3.1

Revision History

Current version: 0.1.41

  • draft (as of 2018-10-01)

Table of Contents

  1. OpenShift Settings
    1. Permissions
    2. OpenShift - Kubernetes - Scheduler Settings

Checklist

Group   Guide to the Secure Configuration of Red Hat Enterprise OpenShift Container Platform 3   Group contains 4 groups and 41 rules
Group   OpenShift Settings   Group contains 3 groups and 41 rules

[ref]   Contains rules that check correct OpenShift settings.

Group   Permissions   Group contains 1 group and 39 rules

[ref]   Traditional security relies heavily on file and directory permissions to prevent unauthorized users from reading or modifying files to which they should not have access.

Group   Verify Permissions on Important Files and Directories   Group contains 39 rules

[ref]   Permissions for many files on a system must be set restrictively to ensure sensitive information is properly protected. This section discusses important permission restrictions which can be verified to ensure that no harmful discrepancies have arisen.

Rule   Verify Group Who Owns The OpenShift etcd Specification File   [ref]

To properly set the group owner of /etc/origin/node/pods/etcd.yaml, run the command:

$ sudo chgrp root /etc/origin/node/pods/etcd.yaml

Rationale:

The /etc/origin/node/pods/apiserver.yaml file contains information about the configuration of the OpenShift etcd Server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.8

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/node/pods/etcd.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/pods/etcd.yaml
  stat:
    path: /etc/origin/node/pods/etcd.yaml
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/node/pods/etcd.yaml
  file:
    path: /etc/origin/node/pods/etcd.yaml
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_etcd
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift etcd Data Directory   [ref]

To properly set the group owner of /var/lib/etcd, run the command:

$ sudo chgrp root /var/lib/etcd

Rationale:

The /var/lib/etcd directory contains highly-avaliable distributed key/value data storage across an OpenShift cluster. Allowing access to users to this directory could compromise OpenShift data and the cluster.

Severity: 
medium
Identifiers and References

References:  1.4.12

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /var/lib/etcd/
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /var/lib/etcd/
  stat:
    path: /var/lib/etcd/
  register: file_exists

- name: Ensure group owner 0 on /var/lib/etcd/
  file:
    path: /var/lib/etcd/
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_var_lib_etcd
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Scheduler Configuration File   [ref]

To properly set the owner of /etc/origin/master/scheduler.json, run the command:

$ sudo chown root /etc/origin/master/scheduler.json 

Rationale:

The /etc/origin/master/scheduler.json file contains information about the configuration of the OpenShift scheduler that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.16

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/master/scheduler.json
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/scheduler.json
  stat:
    path: /etc/origin/master/scheduler.json
  register: file_exists

- name: Ensure owner 0 on /etc/origin/master/scheduler.json
  file:
    path: /etc/origin/master/scheduler.json
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_scheduler_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns OpenShift Node Certificate File   [ref]

To properly set the group owner of /etc/origin/node/client-ca.crt, run the command:

$ sudo chgrp root /etc/origin/node/client-ca.crt

Rationale:

The /etc/origin/node/client-ca.crt file contains the certificate authority certificate for an OpenShift node that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.8

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/node/client-ca.crt
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/client-ca.crt
  stat:
    path: /etc/origin/node/client-ca.crt
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/node/client-ca.crt
  file:
    path: /etc/origin/node/client-ca.crt
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_openshift_node_client_crt
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Admin Kubeconfig File   [ref]

To properly set the permissions of /etc/origin/master/admin.kubeconfig, run the command:

$ sudo chmod 0600 /etc/origin/master/admin.kubeconfig

Rationale:

If the /etc/origin/master/admin.kubeconfig file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the administration configuration of the OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.13

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/master/admin.kubeconfig
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/master/admin.kubeconfig
  file:
    path: /etc/origin/master/admin.kubeconfig
    mode: 0600
  tags:
    - file_permissions_master_admin_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Master Kubeconfig File   [ref]

To properly set the owner of /etc/origin/master/openshift-master.kubeconfig, run the command:

$ sudo chown root /etc/origin/master/openshift-master.kubeconfig 

Rationale:

The /etc/origin/master/openshift-master.kubeconfig file contains information about the master configuration of the OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.18

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/master/openshift-master.kubeconfig
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/openshift-master.kubeconfig
  stat:
    path: /etc/origin/master/openshift-master.kubeconfig
  register: file_exists

- name: Ensure owner 0 on /etc/origin/master/openshift-master.kubeconfig
  file:
    path: /etc/origin/master/openshift-master.kubeconfig
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_openshift_kubeconfig
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Admin Kubeconfig File   [ref]

To properly set the owner of /etc/origin/master/admin.kubeconfig, run the command:

$ sudo chown root /etc/origin/master/admin.kubeconfig 

Rationale:

The /etc/origin/master/admin.kubeconfig file contains information about the administrative configuration of the OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.14

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/master/admin.kubeconfig
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/admin.kubeconfig
  stat:
    path: /etc/origin/master/admin.kubeconfig
  register: file_exists

- name: Ensure owner 0 on /etc/origin/master/admin.kubeconfig
  file:
    path: /etc/origin/master/admin.kubeconfig
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_admin_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Node Configuration File   [ref]

To properly set the owner of /etc/origin/node/node-config.yaml, run the command:

$ sudo chown root /etc/origin/node/node-config.yaml 

Rationale:

The /etc/origin/node/node-config.yaml file contains information about the configuration of the OpenShift node that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.2

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/node/node-config.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/node-config.yaml
  stat:
    path: /etc/origin/node/node-config.yaml
  register: file_exists

- name: Ensure owner 0 on /etc/origin/node/node-config.yaml
  file:
    path: /etc/origin/node/node-config.yaml
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_node_config
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Container Network Interface Files   [ref]

To properly set the permissions of /etc/cni/net.d/*, run the command:

$ sudo chmod 0644 /etc/cni/net.d/*

Rationale:

CNI (Container Network Interface) files consist of a specification and libraries for writing plugins to configure network interfaces in Linux containers, along with a number of supported plugins. Allowing writeable access to the files could allow an attacker to modify the networking configuration potentially adding a rouge network connection.

Severity: 
medium
Identifiers and References

References:  1.4.9

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0644 /etc/cni/net.d//*
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0644 on /etc/cni/net.d//*
  file:
    path: /etc/cni/net.d//*
    mode: 0644
  tags:
    - file_permissions_master_cni_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift API Specification File   [ref]

To properly set the permissions of /etc/origin/node/pods/apiserver.yaml, run the command:

$ sudo chmod 0600 /etc/origin/node/pods/apiserver.yaml

Rationale:

If the /etc/origin/node/pods/apiserver.yaml file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the configuration of an OpenShift API server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.1

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/node/pods/apiserver.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/node/pods/apiserver.yaml
  file:
    path: /etc/origin/node/pods/apiserver.yaml
    mode: 0600
  tags:
    - file_permissions_master_api_server
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Node Service File   [ref]

To properly set the group owner of /etc/systemd/system/atomic-openshift-node.service, run the command:

$ sudo chgrp root /etc/systemd/system/atomic-openshift-node.service

Rationale:

The /etc/systemd/system/atomic-openshift-node.service file contains information about the configuration of the OpenShift node service that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.4

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/systemd/system/atomic-openshift-node.service
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/systemd/system/atomic-openshift-node.service
  stat:
    path: /etc/systemd/system/atomic-openshift-node.service
  register: file_exists

- name: Ensure group owner 0 on /etc/systemd/system/atomic-openshift-node.service
  file:
    path: /etc/systemd/system/atomic-openshift-node.service
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_openshift_node_service
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Node Configuration File   [ref]

To properly set the permissions of /etc/origin/node/node-config.yaml, run the command:

$ sudo chmod 0600 /etc/origin/node/node-config.yaml

Rationale:

If the /etc/origin/node/node-config.yaml file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the configuration of an OpenShift node that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.1

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/node/node-config.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/node/node-config.yaml
  file:
    path: /etc/origin/node/node-config.yaml
    mode: 0600
  tags:
    - file_permissions_node_config
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Node Service File   [ref]

To properly set the permissions of /etc/systemd/system/atomic-openshift-node.service, run the command:

$ sudo chmod 0644 /etc/systemd/system/atomic-openshift-node.service

Rationale:

If the /etc/systemd/system/atomic-openshift-node.service file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the service configuration of the OpenShift node service that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.3

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0644 /etc/systemd/system/atomic-openshift-node.service
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0644 on /etc/systemd/system/atomic-openshift-node.service
  file:
    path: /etc/systemd/system/atomic-openshift-node.service
    mode: 0644
  tags:
    - file_permissions_openshift_node_service
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Master Configuration File   [ref]

To properly set the group owner of /etc/origin/master/master-config.yaml, run the command:

$ sudo chgrp root /etc/origin/master/master-config.yaml

Rationale:

The /etc/origin/master/master-config.yaml file contains information about the master configuration of the OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.18

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/master/master-config.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/master-config.yaml
  stat:
    path: /etc/origin/master/master-config.yaml
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/master/master-config.yaml
  file:
    path: /etc/origin/master/master-config.yaml
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_openshift_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   The OpenShift etcd Data Directory Must Have Mode 0700   [ref]

To properly set the permissions of /var/lib/etcd, run the command:

$ sudo chmod 0700 /var/lib/etcd

Rationale:

The /var/lib/etcd directory contains highly-avaliable distributed key/value data storage across an OpenShift cluster. Allowing access to users to this directory could compromise OpenShift data and the cluster.

Severity: 
medium
Identifiers and References

References:  1.4.11

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0700 /var/lib/etcd/
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0700 on /var/lib/etcd/
  file:
    path: /var/lib/etcd/
    mode: 0700
  tags:
    - file_permissions_var_lib_etcd
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Container Network Interface Files   [ref]

To properly set the group owner of /etc/cni/net.d/*, run the command:

$ sudo chgrp root /etc/cni/net.d/*

Rationale:

CNI (Container Network Interface) files consist of a specification and libraries for writing plugins to configure network interfaces in Linux containers, along with a number of supported plugins. Allowing writeable access to the files could allow an attacker to modify the networking configuration potentially adding a rouge network connection.

Severity: 
medium
Identifiers and References

References:  1.4.10

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/cni/net.d//*
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/cni/net.d//*
  stat:
    path: /etc/cni/net.d//*
  register: file_exists

- name: Ensure group owner 0 on /etc/cni/net.d//*
  file:
    path: /etc/cni/net.d//*
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_cni_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on OpenShift Node Certificate File   [ref]

To properly set the permissions of /etc/origin/node/client-ca.crt, run the command:

$ sudo chmod 0644 /etc/origin/node/client-ca.crt

Rationale:

If the /etc/origin/node/client-ca.crt file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the certificate authority certificate for an OpenShift node that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/node/client-ca.crt
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/node/client-ca.crt
  file:
    path: /etc/origin/node/client-ca.crt
    mode: 0600
  tags:
    - file_permissions_openshift_node_client_crt
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Configuration Directory   [ref]

To properly set the owner of /etc/origin/, run the command:

$ sudo chown root /etc/origin/ 

Rationale:

If users can modify the OpenShift configurations, the OpenShift cluster can become inoperable or compromised

Severity: 
medium
Identifiers and References
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/
  stat:
    path: /etc/origin/
  register: file_exists

- name: Ensure owner 0 on /etc/origin/
  file:
    path: /etc/origin/
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_etc_origin
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Admin Kubeconfig File   [ref]

To properly set the group owner of /etc/origin/master/admin.kubeconfig, run the command:

$ sudo chgrp root /etc/origin/master/admin.kubeconfig

Rationale:

The /etc/origin/master/admin.kubeconfig file contains information about the administrative configuration of the OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.14

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/master/admin.kubeconfig
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/admin.kubeconfig
  stat:
    path: /etc/origin/master/admin.kubeconfig
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/master/admin.kubeconfig
  file:
    path: /etc/origin/master/admin.kubeconfig
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_admin_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   The OpenShift Configuration Directory Must Have Mode 0700   [ref]

To properly set the permissions of /etc/origin/, run the command:

$ sudo chmod 0700 /etc/origin/

Rationale:

If users can modify the OpenShift configurations, the OpenShift cluster can become inoperable or compromised

Severity: 
medium
Identifiers and References
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0700 /etc/origin/
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0700 on /etc/origin/
  file:
    path: /etc/origin/
    mode: 0700
  tags:
    - file_permissions_etc_origin
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns OpenShift Node Certificate File   [ref]

To properly set the owner of /etc/origin/node/client-ca.crt, run the command:

$ sudo chown root /etc/origin/node/client-ca.crt 

Rationale:

The /etc/origin/node/client-ca.crt file contains the certificate authority certificate for an OpenShift node that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.8

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/node/client-ca.crt
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/client-ca.crt
  stat:
    path: /etc/origin/node/client-ca.crt
  register: file_exists

- name: Ensure owner 0 on /etc/origin/node/client-ca.crt
  file:
    path: /etc/origin/node/client-ca.crt
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_openshift_node_client_crt
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Container Network Interface Files   [ref]

To properly set the owner of /etc/cni/net.d/*, run the command:

$ sudo chown root /etc/cni/net.d/* 

Rationale:

CNI (Container Network Interface) files consist of a specification and libraries for writing plugins to configure network interfaces in Linux containers, along with a number of supported plugins. Allowing writeable access to the files could allow an attacker to modify the networking configuration potentially adding a rouge network connection.

Severity: 
medium
Identifiers and References

References:  1.4.10

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/cni/net.d//*
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/cni/net.d//*
  stat:
    path: /etc/cni/net.d//*
  register: file_exists

- name: Ensure owner 0 on /etc/cni/net.d//*
  file:
    path: /etc/cni/net.d//*
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_cni_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Scheduler Configuration File   [ref]

To properly set the group owner of /etc/origin/master/scheduler.json, run the command:

$ sudo chgrp root /etc/origin/master/scheduler.json

Rationale:

The /etc/origin/master/scheduler.json file contains information about the configuration of the OpenShift scheduler that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.16

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/master/scheduler.json
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/scheduler.json
  stat:
    path: /etc/origin/master/scheduler.json
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/master/scheduler.json
  file:
    path: /etc/origin/master/scheduler.json
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_scheduler_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Scheduler Configuration File   [ref]

To properly set the permissions of /etc/origin/master/scheduler.json, run the command:

$ sudo chmod 0600 /etc/origin/master/scheduler.json

Rationale:

If the /etc/origin/master/scheduler.json file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the configuration of an OpenShift scheduler that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.15

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/master/scheduler.json
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/master/scheduler.json
  file:
    path: /etc/origin/master/scheduler.json
    mode: 0600
  tags:
    - file_permissions_master_scheduler_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift etcd Data Directory   [ref]

To properly set the owner of /var/lib/etcd, run the command:

$ sudo chown root /var/lib/etcd 

Rationale:

The /var/lib/etcd directory contains highly-avaliable distributed key/value data storage across an OpenShift cluster. Allowing access to users to this directory could compromise OpenShift data and the cluster.

Severity: 
medium
Identifiers and References

References:  1.4.12

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /var/lib/etcd/
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /var/lib/etcd/
  stat:
    path: /var/lib/etcd/
  register: file_exists

- name: Ensure owner 0 on /var/lib/etcd/
  file:
    path: /var/lib/etcd/
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_var_lib_etcd
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Master Kubeconfig File   [ref]

To properly set the permissions of /etc/origin/master/openshift-master.kubeconfig, run the command:

$ sudo chmod 0600 /etc/origin/master/openshift-master.kubeconfig

Rationale:

If the /etc/origin/master/openshift-master.kubeconfig file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the master configuration of an OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.17

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/master/openshift-master.kubeconfig
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/master/openshift-master.kubeconfig
  file:
    path: /etc/origin/master/openshift-master.kubeconfig
    mode: 0600
  tags:
    - file_permissions_master_openshift_kubeconfig
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift etcd Specification File   [ref]

To properly set the owner of /etc/origin/node/pods/etcd.yaml, run the command:

$ sudo chown root /etc/origin/node/pods/etcd.yaml 

Rationale:

The /etc/origin/node/pods/etcd.yaml file contains information about the configuration of the OpenShift etcd Server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.8

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/node/pods/etcd.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/pods/etcd.yaml
  stat:
    path: /etc/origin/node/pods/etcd.yaml
  register: file_exists

- name: Ensure owner 0 on /etc/origin/node/pods/etcd.yaml
  file:
    path: /etc/origin/node/pods/etcd.yaml
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_etcd
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Node Configuration File   [ref]

To properly set the group owner of /etc/origin/node/node-config.yaml, run the command:

$ sudo chgrp root /etc/origin/node/node-config.yaml

Rationale:

The /etc/origin/node/node-config.yaml file contains information about the configuration of the OpenShift node that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.2

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/node/node-config.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/node-config.yaml
  stat:
    path: /etc/origin/node/node-config.yaml
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/node/node-config.yaml
  file:
    path: /etc/origin/node/node-config.yaml
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_node_config
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift etcd Specification File   [ref]

To properly set the permissions of /etc/origin/node/pods/etcd.yaml, run the command:

$ sudo chmod 0600 /etc/origin/node/pods/etcd.yaml

Rationale:

If the /etc/origin/node/pods/etcd.yaml file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the configuration of an OpenShift etcd server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.7

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/node/pods/etcd.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/node/pods/etcd.yaml
  file:
    path: /etc/origin/node/pods/etcd.yaml
    mode: 0600
  tags:
    - file_permissions_master_etcd
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Controller Manager Specification File   [ref]

To properly set the owner of /etc/origin/node/pods/controller.yaml, run the command:

$ sudo chown root /etc/origin/node/pods/controller.yaml 

Rationale:

The /etc/origin/node/pods/controller.yaml file contains information about the configuration of the OpenShift Controller Manager Server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.4

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/node/pods/controller.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/pods/controller.yaml
  stat:
    path: /etc/origin/node/pods/controller.yaml
  register: file_exists

- name: Ensure owner 0 on /etc/origin/node/pods/controller.yaml
  file:
    path: /etc/origin/node/pods/controller.yaml
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_controller_manager
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Master Configuration File   [ref]

To properly set the permissions of /etc/origin/master/master-config.yaml, run the command:

$ sudo chmod 0600 /etc/origin/master/master-config.yaml

Rationale:

If the /etc/origin/master/master-config.yaml file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the master configuration of an OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.17

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/master/master-config.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/master/master-config.yaml
  file:
    path: /etc/origin/master/master-config.yaml
    mode: 0600
  tags:
    - file_permissions_master_openshift_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift API Specification File   [ref]

To properly set the group owner of /etc/origin/node/pods/apiserver.yaml, run the command:

$ sudo chgrp root /etc/origin/node/pods/apiserver.yaml

Rationale:

The /etc/origin/node/pods/apiserver.yaml file contains information about the configuration of the OpenShift API Server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.2

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/node/pods/apiserver.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/pods/apiserver.yaml
  stat:
    path: /etc/origin/node/pods/apiserver.yaml
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/node/pods/apiserver.yaml
  file:
    path: /etc/origin/node/pods/apiserver.yaml
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_api_server
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Master Kubeconfig File   [ref]

To properly set the group owner of /etc/origin/master/openshift-master.kubeconfig, run the command:

$ sudo chgrp root /etc/origin/master/openshift-master.kubeconfig

Rationale:

The /etc/origin/master/openshift-master.kubeconfig file contains information about the master configuration of the OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.18

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/master/openshift-master.kubeconfig
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/openshift-master.kubeconfig
  stat:
    path: /etc/origin/master/openshift-master.kubeconfig
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/master/openshift-master.kubeconfig
  file:
    path: /etc/origin/master/openshift-master.kubeconfig
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_openshift_kubeconfig
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift API Specification File   [ref]

To properly set the owner of /etc/origin/node/pods/apiserver.yaml, run the command:

$ sudo chown root /etc/origin/node/pods/apiserver.yaml 

Rationale:

The /etc/origin/node/pods/apiserver.yaml file contains information about the configuration of the OpenShift API Server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.2

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/node/pods/apiserver.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/pods/apiserver.yaml
  stat:
    path: /etc/origin/node/pods/apiserver.yaml
  register: file_exists

- name: Ensure owner 0 on /etc/origin/node/pods/apiserver.yaml
  file:
    path: /etc/origin/node/pods/apiserver.yaml
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_api_server
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Permissions on the OpenShift Controller Manager Specification File   [ref]

To properly set the permissions of /etc/origin/node/pods/controller.yaml, run the command:

$ sudo chmod 0600 /etc/origin/node/pods/controller.yaml

Rationale:

If the /etc/origin/node/pods/controller.yaml file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the configuration of an OpenShift Controller Manager server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.3

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chmod 0600 /etc/origin/node/pods/controller.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Ensure permission 0600 on /etc/origin/node/pods/controller.yaml
  file:
    path: /etc/origin/node/pods/controller.yaml
    mode: 0600
  tags:
    - file_permissions_master_controller_manager
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Master Configuration File   [ref]

To properly set the owner of /etc/origin/master/master-config.yaml, run the command:

$ sudo chown root /etc/origin/master/master-config.yaml 

Rationale:

The /etc/origin/master/master-config.yaml file contains information about the master configuration of the OpenShift cluster that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.18

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/origin/master/master-config.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/master/master-config.yaml
  stat:
    path: /etc/origin/master/master-config.yaml
  register: file_exists

- name: Ensure owner 0 on /etc/origin/master/master-config.yaml
  file:
    path: /etc/origin/master/master-config.yaml
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_master_openshift_conf
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Controller Manager Specification File   [ref]

To properly set the group owner of /etc/origin/node/pods/controller.yaml, run the command:

$ sudo chgrp root /etc/origin/node/pods/controller.yaml

Rationale:

The /etc/origin/node/pods/controller.yaml file contains information about the configuration of the OpenShift Controller Manager Server that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  1.4.4

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/node/pods/controller.yaml
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/node/pods/controller.yaml
  stat:
    path: /etc/origin/node/pods/controller.yaml
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/node/pods/controller.yaml
  file:
    path: /etc/origin/node/pods/controller.yaml
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_master_controller_manager
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify User Who Owns The OpenShift Node Service File   [ref]

To properly set the owner of /etc/systemd/system/atomic-openshift-node.service, run the command:

$ sudo chown root /etc/systemd/system/atomic-openshift-node.service 

Rationale:

The /etc/systemd/system/atomic-openshift-node.service file contains information about the configuration of the OpenShift node service that is configured on the system. Protection of this file is critical for OpenShift security.

Severity: 
medium
Identifiers and References

References:  2.2.4

Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chown 0 /etc/systemd/system/atomic-openshift-node.service
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/systemd/system/atomic-openshift-node.service
  stat:
    path: /etc/systemd/system/atomic-openshift-node.service
  register: file_exists

- name: Ensure owner 0 on /etc/systemd/system/atomic-openshift-node.service
  file:
    path: /etc/systemd/system/atomic-openshift-node.service
    owner: 0
  when: file_exists.stat.exists
  tags:
    - file_owner_openshift_node_service
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption

Rule   Verify Group Who Owns The OpenShift Configuration Directory   [ref]

To properly set the group owner of /etc/origin/, run the command:

$ sudo chgrp root /etc/origin/

Rationale:

If users can modify the OpenShift configurations, the OpenShift cluster can become inoperable or compromised

Severity: 
medium
Identifiers and References
Remediation Shell script:   (show)

Complexity:low
Disruption:low
Strategy:configure

chgrp 0 /etc/origin/
Remediation Ansible snippet:   (show)

Complexity:low
Disruption:low
Strategy:configure
- name: Test for existence /etc/origin/
  stat:
    path: /etc/origin/
  register: file_exists

- name: Ensure group owner 0 on /etc/origin/
  file:
    path: /etc/origin/
    group: 0
  when: file_exists.stat.exists
  tags:
    - file_groupowner_etc_origin
    - medium_severity
    - configure_strategy
    - low_complexity
    - low_disruption
Group   OpenShift - Kubernetes - Scheduler Settings   Group contains 2 rules

[ref]   Contains evaluations for kube-scheduler configuration settings.

Rule   Ensure that the --profile argument is set   [ref]

Profiling should be disabled if not needed. To disable profiling, edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml file on the master node and set the below parameter:

--profiling=false

Rationale:

Profiling allows for the identification of specific performance bottlenecks. It generates a significant amount of program data that could potentially be exploited to uncover system and program details. If you are not experiencing any bottlenecks and do not need the profiler for troubleshooting purposes, it is recommended to turn it off to reduce the potential attack surface.

Severity: 
low
Identifiers and References

References:  1.2.1

Rule   Ensure that the --address argument is set   [ref]

To ensure the Scheduler service is bound to a secure loopback address, edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml on the master node and ensure the correct value for the --address parameter:

--address=127.0.0.1

Rationale:

The Scheduler API service which runs on port 10251/TCP by default is used for health and metrics information and is available without authentication or encryption. As such it should only be bound to a localhost interface, to minimize the cluster's attack surface.

Severity: 
medium
Identifiers and References

References:  1.2.2

Red Hat and Red Hat Enterprise Linux are either registered trademarks or trademarks of Red Hat, Inc. in the United States and other countries. All other names are registered trademarks or trademarks of their respective companies.