Add protocol number support for security group rules#3736
Conversation
Currently while creating ingress/egress rule for a security group, we can specify only TCP/UDP/ICMP. Sometimes we need to add rules for different protocol number or rules for all the above three mentioned protocols. In this new feature users can specify the protocol number or select "ALL" option which will apply rules for TCP/UDP/ICMP
weizhouapache
left a comment
There was a problem hiding this comment.
I have reviewed all changes, and tested it manually.
The integration test works fine as well.
| else: | ||
| dport = " --dport " + str(start) + ":" + str(end) | ||
|
|
||
| if protocol != 'all' and protocol != 'icmp' and protocol != 'tcp' and protocol != 'udp': |
There was a problem hiding this comment.
For ip6tables it's not 'icmp' which is used for the protocol, it's icmpv6, so don't we need to add a check there?
There was a problem hiding this comment.
In the UI, we only have options for "TCP", "UDP", "ICMP" and "ALL". There is no option for "ICMPv6" in UI. Once this is added in ui, we can have that check here as well.
There was a problem hiding this comment.
@rakgenius I'm aware, but underneath we translate ICMP to ICMPv6 when the CIDR/IP is an IPv6 adress. That's what we need to check.
There was a problem hiding this comment.
@wido the protocol is "icmp" in cloudstack, no matter the ip/cidr is ipv4 or ipv6.
look at the code below
https://github.com/apache/cloudstack/pull/3736/files/c27fdfee8c9f5ab06cf18dd6dc41ba356d75f4c4#diff-d10df45583c471e8de4a64128f95c802R1066-R1070
|
@wido @rhtyd @GabrielBrascher guys, can you review this when you get time? |
|
@DaanHoogland this PR has two approvals. could you kick off a trillian test ? |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-543 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-713)
|
Currently while creating ingress/egress rule for a security group, we can specify only TCP/UDP/ICMP. Sometimes we need to add rules for different protocol number or rules for all the above three mentioned protocols. In this new feature users can specify the protocol number or select "ALL" option which will apply rules for TCP/UDP/ICMP
Description
Currently while creating ingress/egress rule for a security group,
we can specify only TCP/UDP/ICMP. Sometimes we need to add rules
for different protocol numbers or rules for all the above three
mentioned protocols.
In this new feature, users can specify the protocol number or select
"ALL" option which will apply rules for TCP/UDP/ICMP in one shot
Types of changes
Screenshots (if appropriate):
Navigate to "Networks" and select "Security groups" from the drop-down menu on the top left
Select any security group name and click on either "ingress" or "egress" tab
How Has This Been Tested?
Adding a rule for a particular protocol number
For ex: Enter protocol number as 47 and cidr as "99.99.99.99/32"
The output should be as shown below
Adding a rule to all TCP/UDP/ICMP at a time
New integration test has been added in
test/integration/component/test_protocol_number_security_group.pyIntegration test can be run using
nosetests --with-marvin --marvin-config=<config file> test/integration/component/test_protocol_number_security_group.py