Bug 1759338 - [OVN] hostnetwork pod can access MCS port 22623 or 22624 on master
Summary: [OVN] hostnetwork pod can access MCS port 22623 or 22624 on master
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.5.0
Assignee: Ricardo Carrillo Cruz
QA Contact: Anurag saxena
Depends On:
TreeView+ depends on / blocked
Reported: 2019-10-07 21:07 UTC by Anurag saxena
Modified: 2020-07-13 17:12 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-07-13 17:11:31 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift ovn-kubernetes pull 170 0 None closed Bug 1759338: hostnetwork pod can access MCS port 22623 or 22624 on master 2021-02-12 09:28:51 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:12:02 UTC

Description Anurag saxena 2019-10-07 21:07:08 UTC
Description of problem: A hostnetwork pod can access MCS port 22623 or 22624 on master on OVNKubernetes cluster. We should restrict that on OVN as well like we do in OpenShiftSDN

Version-Release number of selected component (if applicable):4.2.0-0.nightly-2019-10-07-011045

How reproducible:Always

Steps to Reproduce:
1.Create a hostnetwork pod with kubeadmin as user
$ oc login -u kubeadmin -p xxxxx
$oc create -f https://raw.githubusercontent.com/anuragthehatter/v3-testfiles/master/networking/hostnetwork-pod.json

2.oc rsh into pod and curl on master IP on port 22623 and 22624

$ oc rsh hello-pod
 ~$curl -I -k
     HTTP/2 200 
 ~$curl -I -k
     HTTP/2 200 

Actual results: Hostnetwork pod can access MCS ports

Expected results: Hostnetwork pod should not access MCS ports

Additional info:

Comment 1 Dan Winship 2019-10-07 22:24:26 UTC
Oh, I think this is not a bug; we originally had to block hostNetwork access to MCS, but I think MCS now recognizes that the node is already provisioned and so there's no danger in connect to it from an existing node IP. I need to double-check this though... (And if it's correct we should remove the hostNetwork blocking from openshift-sdn too.)

Comment 2 Casey Callendrello 2019-10-09 12:02:58 UTC
I don't think that's true, because the MCS is also exposed via the internal load balancer.

Comment 3 Dan Winship 2019-10-09 14:12:10 UTC
Hm... it looks like https://github.com/openshift/machine-config-operator/pull/784 never merged so probably we do still need to block from hostNetwork

Comment 6 huirwang 2020-05-25 07:31:48 UTC
Verified on 4.5.0-0.nightly-2020-05-24-223848.

oc rsh hostnetwork-pod 
~ $ curl  -I -k
curl: (7) Failed to connect to port 22623: Connection refused
~ $ exit
command terminated with exit code 7

Comment 8 errata-xmlrpc 2020-07-13 17:11:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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