Uh oh!
There was an error while loading. Please reload this page.
CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR. - #1581
Conversation
| @@ -0,0 +1,34 @@ | |||
| package com.cloud.agent.api.routing; | |||
There was a problem hiding this comment.
@pdube Jenkins fails because this file has no license.
spellgen
commented
Jun 3, 2016
the changes look good to me |
remibergsma
commented
Jun 4, 2016
@pdube Travis timed out, you may want to try the Travis Lottery again ;-) Is this ready for testing? |
pdube
commented
Jun 6, 2016
@remibergsma Yes, the rules should appear in the right order now. |
remibergsma
commented
Jun 6, 2016
@pdube Thanks, will give it a try soon |
pdube
commented
Jun 6, 2016
The Travis build has timed out 3 times now. Is there any known issue with Travis right now @swill ? |
aaronhurt
commented
Jun 6, 2016
Looks clean and the added test case should prevent this from happening again. According to the "git blame" the comparator was switched back in 2013 and has been broken since. |
swill
commented
Jun 6, 2016
The only known issue is that it this periodically happens. I have not had a chance to dig deeper... |
dmabry
commented
Jun 9, 2016
I just kicked off a build that includes this PR. I'm going to push this to our lab for testing and report back. |
I tested this in our lab with advanced networking verified the patch is working as expected. I used the following test process.
2 iptables looked like the following on the VPC VR 3 I added an additional rule of: 4 iptables looked like the following on the VPC VR In summary, it looks like this patch works verified by manual testing in my lab. In short, LGTM based on testing. |
pdube
commented
Jun 10, 2016
Thanks @dmabry |
dmabry
commented
Jun 10, 2016
@pdube No problem. Think you could kick this off again and see if Travis comes back green? |
swill
commented
Jun 13, 2016
@pdube can you close and reopen this one? thx... |
swill
commented
Jun 14, 2016
CI RESULTSAssociated Uploads
Uploads will be available until Comment created by |
kishankavala
commented
Jun 15, 2016
@pdube though the fix looks good, the root of the issue is different. |
swill
commented
Jun 15, 2016
I'm not sure what to make of this comment @kishankavala. Is that a LGTM? |
kishankavala
commented
Jun 15, 2016
@swill This is a regression caused by VR refactor. There could be more such issues. I would prefer a fix in the VR script. Current fix is more like reversing the order twice to make it correct. |
swill
commented
Jun 15, 2016
@pdube can you review @kishankavala's comments. I want to cut an RC soon, but we have other pending issues in the VR right now which @kiwiflyer, @dmabry and team are working on... |
aaronhurt
commented
Jun 15, 2016
Looking through the |
pdube
commented
Jun 15, 2016
@kishankavala I think that the ultimate fix will be in the VR. However, the inversion of the list is fixed with this patch, and does not require a VR update. This is a good enough fix for now, as the ordering inversion is a critical security bug, since the rule numbers you are giving are not being applied as expected. |
kishankavala
commented
Jun 15, 2016
@leprechau ACL rule ordering was introduced in 2013 in ACS 4.2. Since 4.2 release, the order was never changed. |
kishankavala
commented
Jun 15, 2016
@pdube Current fix is good enough. I'm only concerned about more such issues in VR. |
aaronhurt
commented
Jun 15, 2016
@kishankavala Understood, thank you for the explanation. The long history of the project makes digging into some of these things difficult. |
* Fixed ordering of network ACL rules being sent to the VR. The comparator was inverted * Added unit test to verify ordering * Added ASF license to unit test file
bvbharatk
commented
Jun 21, 2016
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no):https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 Failed tests:
Skipped tests: Passed test suits: |
CLOUDSTACK-9404 Fixed ordering of network ACL rules being sent to the VR. The comparator was inverted. Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404 In this example, I created rules with the port numbers the same as the rule numbers. Chain ACL_INBOUND_eth2 (1 references) target prot opt source destination ACCEPT all -- anywhere 225.0.0.50 ACCEPT all -- anywhere vrrp.mcast.net DROP tcp -- anywhere anywhere tcp dpt:netstat DROP tcp -- anywhere anywhere tcp dpt:10 DROP tcp -- anywhere anywhere tcp dpt:5 DROP tcp -- anywhere anywhere tcp dpt:3 DROP tcp -- anywhere anywhere tcp dpt:2 DROP all -- anywhere anywhere We can see above that the rules are inverted. After the fix: Chain ACL_INBOUND_eth2 (1 references) target prot opt source destination ACCEPT all -- anywhere 225.0.0.50 ACCEPT all -- anywhere vrrp.mcast.net DROP tcp -- anywhere anywhere tcp dpt:2 DROP tcp -- anywhere anywhere tcp dpt:3 DROP tcp -- anywhere anywhere tcp dpt:5 DROP tcp -- anywhere anywhere tcp dpt:10 DROP tcp -- anywhere anywhere tcp dpt:netstat DROP all -- anywhere anywhere * pr/1581: Added ASF license to unit test file Added unit test to verify ordering Fixed ordering of network ACL rules being sent to the VR. The comparator was inverted Signed-off-by: Will Stevens <williamstevens@gmail.com>
The comparator was inverted.
Issue: https://issues.apache.org/jira/browse/CLOUDSTACK-9404
In this example, I created rules with the port numbers the same as the rule numbers.
Chain ACL_INBOUND_eth2 (1 references)
target prot opt source destination
ACCEPT all -- anywhere 225.0.0.50
ACCEPT all -- anywhere vrrp.mcast.net
DROP tcp -- anywhere anywhere tcp dpt:netstat
DROP tcp -- anywhere anywhere tcp dpt:10
DROP tcp -- anywhere anywhere tcp dpt:5
DROP tcp -- anywhere anywhere tcp dpt:3
DROP tcp -- anywhere anywhere tcp dpt:2
DROP all -- anywhere anywhere
We can see above that the rules are inverted.
After the fix:
Chain ACL_INBOUND_eth2 (1 references)
target prot opt source destination
ACCEPT all -- anywhere 225.0.0.50
ACCEPT all -- anywhere vrrp.mcast.net
DROP tcp -- anywhere anywhere tcp dpt:2
DROP tcp -- anywhere anywhere tcp dpt:3
DROP tcp -- anywhere anywhere tcp dpt:5
DROP tcp -- anywhere anywhere tcp dpt:10
DROP tcp -- anywhere anywhere tcp dpt:netstat
DROP all -- anywhere anywhere