In the default configuration, OpenShift Container Platform 4 allows users with access to create pods the ability to schedule workloads on master nodes. Pods with permission to access the host network, running on master nodes, can retrieve security credentials for the master AWS IAM role, allowing management access to AWS resources. Pod access to the host network can be granted with the hostnetwork SCC. Original Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1729242 Upstream Fix: https://github.com/openshift/cluster-kube-apiserver-operator/pull/524
OpenShift Documentation has been updated to include the following: "If additional workloads are run on master hosts, use caution when providing access to hostnetwork. A workload that runs hostnetwork on a master host is effectively root on the cluster and must be trusted accordingly." https://docs.openshift.com/container-platform/4.1/authentication/managing-security-context-constraints.html
Transitioning to Version 2 of the Instance Metadata Service would address this issue: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
In reply to comment #5: > Transitioning to Version 2 of the Instance Metadata Service would address > this issue: > > https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance- > metadata-service.html While IMDSv2 seems a valuable defense-in-depth measure (to protect against SSRF etc), it seems a pod with access to the host network on a master node will still be able to retrieve IAM role credentials (via an additional PUT request beforehand).
Downgrading impact to Moderate as only admin users should be able to schedule pods onto master nodes.
Mitigation: Do not run untrusted workloads with `hostnetwork` access on master nodes. If additional workloads are run on master hosts, use caution when providing access to hostnetwork. A workload that runs hostnetwork on a master host is effectively root on the cluster and must be trusted accordingly. https://docs.openshift.com/container-platform/4.4/authentication/managing-security-context-constraints.html