Bug 1926568 (CVE-2021-20238) - CVE-2021-20238 openshift/machine-config-operator: unauthenticated access to Machine Config Server ignition config
Summary: CVE-2021-20238 openshift/machine-config-operator: unauthenticated access to M...
Keywords:
Status: NEW
Alias: CVE-2021-20238
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On: 1925494
Blocks: 1926028 1965031
TreeView+ depends on / blocked
 
Reported: 2021-02-09 04:38 UTC by Sam Fowler
Modified: 2023-08-28 17:22 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
It was found in OpenShift Container Platform 4 that ignition config, served by the Machine Config Server, can be accessed externally from clusters without authentication. The MCS endpoint (port 22623) provides ignition configuration used for bootstrapping Nodes and can include some sensitive data, e.g. registry pull secrets. There are two scenarios where this data can be accessed. The first is on Baremetal, OpenStack, Ovirt, Vsphere and KubeVirt deployments which do not have a separate internal API endpoint and allow access from outside the cluster to port 22623 from the standard OpenShift API Virtual IP address. The second is on cloud deployments when using unsupported network plugins, which do not create iptables rules that prevent to port 22623. In this scenario, the ignition config is exposed to all pods within the cluster and cannot be accessed externally.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Sam Fowler 2021-02-09 04:38:22 UTC
When running OpenShift with Red Hat supported network types, applications in the cluster are blocked from sending traffic to ports 22623 or 22624 via iptables rules injected into the pod.  This ensures that no unprivileged workloads are able to access the Machine Config Server (MCS) and download ignition configuration, which may contain sensitive information.

Unfortunately, this security measure is implemented within the code for the network plugins, so a cluster that uses another network plugin (like Calico, for example), would not have this protection mechanism in place.

In other words, all applications running on OpenShift clusters not using Red Hat supported network types will be able to access the MCS.

Comment 5 Sam Fowler 2021-04-30 06:50:20 UTC
Statement:

This flaw is planned to be addressed in a future enhancement:

https://issues.redhat.com/browse/GRPA-3642

Comment 7 Sam Fowler 2021-05-04 04:51:42 UTC
Mitigation:

- If deployed on Baremetal, OpenStack, Ovirt, Vsphere or KubeVirt, check if the ignition config is accessible from outside the cluster, e.g.
   
https://api.$cluster_name.$base_domain:22623/config/worker
  
Prevent access to this endpoint with an external firewall or load balancer.

- To protect the MCS endpoint within clusters, use a supported network plugin with OpenShift, namely: OpenShift SDN, OVN Kubernetes or kuryr.

- Ensure untrusted workloads are not run with hostNetwork access.

Comment 9 Sam Fowler 2021-05-04 05:01:14 UTC
Cluster types allowing external access to ignition config:

https://github.com/openshift/installer/blob/master/pkg/asset/ignition/machine/node.go#L36..L46

Comment 10 Sam Fowler 2021-05-04 05:01:35 UTC
Upstream issue:

https://github.com/openshift/okd/issues/176


Note You need to log in before you can comment on or make changes to this bug.