Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1507871 - [hwivBoNF] Should not be able to access the denied network which defined in EgressNetworkPolicy via the egressIP
[hwivBoNF] Should not be able to access the denied network which defined in E...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking (Show other bugs)
3.7.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.7.0
Assigned To: Dan Winship
Meng Bo
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-31 07:01 EDT by Meng Bo
Modified: 2017-11-28 17:20 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-11-28 17:20:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Origin (Github) 17099 None None None 2017-10-31 16:26 EDT
Red Hat Product Errata RHSA-2017:3188 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-28 21:34:54 EST

  None (edit)
Description Meng Bo 2017-10-31 07:01:35 EDT
Description of problem:
Add both egressIPs and EgressNetworkPolicy to the project, try to access the network which is defined as denied in the EgressNetworkPolicy.

It will be able to access the network through the egressIP.


Version-Release number of selected component (if applicable):
v3.7.0-0.188.0

How reproducible:
always

Steps to Reproduce:
1. Setup multi node env with multitenant or networkpolicy plugin

2. Add the egressIP to one of the node
10.66.140.100

3. Add the egressIP defined above to the user's netnamespace

4. Add the following egressnetworkpolicy to the same project above
{
    "kind": "EgressNetworkPolicy",
    "apiVersion": "v1",
    "metadata": {
        "name": "default"
    },
    "spec": {
        "egress": [
            {
                "type": "Deny",
                "to": {
                    "cidrSelector": "10.66.140.0/23"
                }
            }
        ]
    }
}

5. Try to access the denied network which defined in above rule from the pod in the project.


Actual results:
The denied network is able to be accessed by the pod which landed on the egressNode.

Expected results:
Should not be able to access the denied network by the pods.

Additional info:
Looks like the openflow rules for the egressnetworkpolicy which defined in table 101 was bypassed, since the packet goes out from table 100.


# ovs-appctl ofproto/trace br0 "in_port=6,ip,ct_state(trk),nw_dst=10.66.141.175,nw_src=10.128.0.29,tun_id=0x696634"
Flow: ct_state=trk,ip,tun_id=0x696634,in_port=6,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,nw_src=10.128.0.29,nw_dst=10.66.141.175,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0

bridge("br0")
-------------
 0. ip, priority 100
    goto_table:20   
20. ip,in_port=6,nw_src=10.128.0.29, priority 100
    load:0x696634->NXM_NX_REG0[]
    goto_table:21   
21. priority 0
    goto_table:30   
30. ip, priority 0  
    goto_table:100  
100. ip,reg0=0x696634, priority 100
    set_field:0xa428c64->pkt_mark
    output:2

Final flow: pkt_mark=0xa428c64,ct_state=trk,ip,reg0=0x696634,tun_id=0x696634,in_port=6,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,nw_src=10.128.0.29,nw_dst=10.66.141.175,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
Megaflow: pkt_mark=0,recirc_id=0,ip,in_port=6,nw_src=10.128.0.29,nw_dst=10.0.0.0/9,nw_frag=no
Datapath actions: set(skb_mark(0xa428c64)),2
Comment 1 Dan Winship 2017-10-31 10:47:11 EDT
added a fix for this to the existing PR https://github.com/openshift/origin/pull/17099
Comment 3 Meng Bo 2017-11-06 21:54:20 EST
Tested on ocp v3.7.0-0.194.0

Issue has been fixed, all the connections will follow the rules defined in egressnetworkpolicy.
Comment 6 errata-xmlrpc 2017-11-28 17:20:29 EST
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/RHSA-2017:3188

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