Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1856374

Summary: [kuryr] hostnetwork pod can access MCS port 22623 or 22624 on master
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: NetworkingAssignee: MichaƂ Dulko <mdulko>
Networking sub component: kuryr QA Contact: GenadiC <gcheresh>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: juriarte, ltomasbo
Version: 4.6   
Target Milestone: ---   
Target Release: 4.5.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-22 12:20:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1856289    
Bug Blocks: 1858183    

Description OpenShift BugZilla Robot 2020-07-13 13:36:45 UTC
+++ This bug was initially created as a clone of Bug #1856289 +++

Description of problem:
hostnetwork pod can access MCS port 22623 or 22624 on master on Kuryr cluster. We should restrict that on Kuryr as well like it's done in OpenShiftSDN

Version-Release number of selected component (if applicable):


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 http://10.0.129.26:22623/config/master -k
     HTTP/2 200 
 ~$curl -I http://10.0.129.26:22623/config/master -k
     HTTP/2 200 


Actual results: Hostnetwork pod can access MCS ports


Expected results: Hostnetwork pod should not access MCS ports

Comment 3 Jon Uriarte 2020-07-20 14:41:34 UTC
Verified in 4.5.0-0.nightly-2020-07-18-024505 on top of OSP 16.1 RHOS-16.1-RHEL-8-20200714.n.0 compose.

The MCS ports are not accessible from the hostnetwork pod in a cluster with Kuryr.

$ oc create -f https://raw.githubusercontent.com/anuragthehatter/v3-testfiles/master/networking/hostnetwork-pod.json
pod/hostnetwork-pod created

$ source shiftstackrc 
(shiftstack) [stack@undercloud-0 ~]$ openstack server list
+--------------------------------------+---------------------------+--------+-------------------------------------+--------------------+--------+
| ID                                   | Name                      | Status | Networks                            | Image              | Flavor |
+--------------------------------------+---------------------------+--------+-------------------------------------+--------------------+--------+
| 58ad1cd6-6c43-44d7-9f90-ce85f394aee3 | ostest-xv757-worker-8p9b8 | ACTIVE | ostest-xv757-openshift=10.196.3.25  | ostest-xv757-rhcos |        |
| 9762418d-e1de-452d-86fe-f345467914dd | ostest-xv757-worker-svxck | ACTIVE | ostest-xv757-openshift=10.196.0.117 | ostest-xv757-rhcos |        |
| 0b5a0a8d-944a-46d2-9cfa-9b2c20a7ce09 | ostest-xv757-worker-g9zj5 | ACTIVE | ostest-xv757-openshift=10.196.3.185 | ostest-xv757-rhcos |        |
| 486b329f-6d50-4d2d-8d1f-15cc2a761fb1 | ostest-xv757-master-1     | ACTIVE | ostest-xv757-openshift=10.196.0.53  | ostest-xv757-rhcos |        |
| 81a4d628-4746-485c-a923-23a06d362dc8 | ostest-xv757-master-0     | ACTIVE | ostest-xv757-openshift=10.196.3.26  | ostest-xv757-rhcos |        |
| 3e42a38f-ece5-43fd-b22e-44f39af4db86 | ostest-xv757-master-2     | ACTIVE | ostest-xv757-openshift=10.196.2.92  | ostest-xv757-rhcos |        |
+--------------------------------------+---------------------------+--------+-------------------------------------+--------------------+--------+

$ oc get pods
NAME              READY   STATUS    RESTARTS   AGE
hostnetwork-pod   1/1     Running   0          22s

$ oc rsh hostnetwork-pod
/ # curl -I http://10.196.3.26:22623/config/master -k
curl: (7) Failed to connect to 10.196.3.26 port 22623: Connection refused
/ # curl -I http://10.196.3.26:22624/config/master -k
curl: (7) Failed to connect to 10.196.3.26 port 22624: Connection refused

/ # curl -I http://10.196.0.53:22623/config/master -k
curl: (7) Failed to connect to 10.196.0.53 port 22623: Connection refused
/ # curl -I http://10.196.0.53:22624/config/master -k
curl: (7) Failed to connect to 10.196.0.53 port 22624: Connection refused

/ # curl -I http://10.196.2.92:22623/config/master -k
curl: (7) Failed to connect to 10.196.2.92 port 22623: Connection refused
/ # curl -I http://10.196.2.92:22624/config/master -k
curl: (7) Failed to connect to 10.196.2.92 port 22624: Connection refused

Comment 5 errata-xmlrpc 2020-07-22 12:20:42 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.

https://access.redhat.com/errata/RHBA-2020:2956