Bug 1856374 - [kuryr] hostnetwork pod can access MCS port 22623 or 22624 on master
Summary: [kuryr] hostnetwork pod can access MCS port 22623 or 22624 on master
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.5.z
Assignee: Michał Dulko
QA Contact: GenadiC
URL:
Whiteboard:
Depends On: 1856289
Blocks: 1858183
TreeView+ depends on / blocked
 
Reported: 2020-07-13 13:36 UTC by OpenShift BugZilla Robot
Modified: 2020-07-22 12:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-22 12:20:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-network-operator pull 706 0 None closed [release-4.5] Bug 1856374: Block MCS and metadata for host-networking pods 2020-08-25 10:12:52 UTC
Red Hat Product Errata RHBA-2020:2956 0 None None None 2020-07-22 12:21:05 UTC

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


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