-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable to create VPC portfowarding rules with source cidr #7081
enable to create VPC portfowarding rules with source cidr #7081
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7081 +/- ##
===========================================
Coverage 15.78% 15.78%
- Complexity 12565 12571 +6
===========================================
Files 5627 5627
Lines 492260 492351 +91
Branches 63882 61358 -2524
===========================================
+ Hits 77710 77728 +18
- Misses 406076 406148 +72
- Partials 8474 8475 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
SonarCloud Quality Gate failed. |
@RodrigoDLopez can you please look at the sonar warning? They look serious in this case. |
Have you tested
something are missing
Please also ask one of your colleagues to test it. |
Yes, our use case has been covered in the PR. Thanks a lot :-) |
cool, good to know it |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
@RodrigoDLopez can you please address the merge conflicts and check review comments |
ping @RodrigoDLopez |
Hi @RodrigoDLopez It seems the issue #7483 is fixed with this PR. Can target this PR for 4.19.1? |
@RodrigoDLopez can you look at the conflicts? |
@@ -107,8 +108,13 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P | |||
description = "the ID of the virtual machine for the port forwarding rule") | |||
private Long virtualMachineId; | |||
|
|||
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to forward traffic from. Multiple entries must be separated by a single comma character (,). This parameter is deprecated. Do not use.") | |||
private List<String> cidrlist; | |||
@Parameter(name = ApiConstants.CIDR_LIST, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we use SOURCE_CIDR_LIST
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm keeping the param as cidrlist
for now so that it matches the createLoadBalancerRule
API and so that we don't add another parameter or change an existing param's name while we don't have a well-defined protocol to introduce breaking changes. However, I'll address it as "source CIDR list" in the UI and change its description to provide a better idea on what the parameter represents.
collectionType = CommandType.STRING, | ||
description = "the CIDR list to allow traffic, all other CIDRs will be blocked. " + | ||
"Multiple entries must be separated by a single comma character (,). This param will be used only for VPC's networks. By default, all CIDRs are allowed.") | ||
private List<String> cidrList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also sourceCidrList
type = CommandType.LIST, | ||
collectionType = CommandType.STRING, | ||
description = "the CIDR list to allow traffic, all other CIDRs will be blocked. " + | ||
"Multiple entries must be separated by a single comma character (,). This param will be used only for VPC's networks. By default, all CIDRs are allowed.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember there are some changes for source cidr of load balancing rules. Does it work in isolated networks? If yes, this could be extended to support isolated networks as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be extended to also support isolated networks. However, I don't see a point in doing so, as a similar result can be accomplished by combining firewall and port forwarding rules when using isolated networks.
My bad, I missed this message. Yes, I'll target 4.19. |
4a438b6
to
0eacf15
Compare
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
@blueorangutan package |
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11493 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-11741)
|
@RodrigoDLopez @winterhazel , are you guys testing this? |
@DaanHoogland I already tested it in #7081 (comment), and consider this PR as ready for merge. |
* 4.20: UI: Tooltip on the host information card to display the CPU speed in MHz and the memory value in MB (to 3 decimal places) (#9971) UI: Allow accounts of the `User` type to add other accounts or users to projects through UI (#9927) enable to create VPC portfowarding rules with source cidr (#7081) Add new column `last_id` to the table volumes (#9759) Allow VMWare import via another host (#9787) Linstor: add support for ISO block devices and direct download (#9792) get expunged VM data for job result (#9949) fix section divider display on auth page (#9966)
Co-authored-by: Lopez <rodrigo@scclouds.com.br> Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
* 4.20: UI: Tooltip on the host information card to display the CPU speed in MHz and the memory value in MB (to 3 decimal places) (apache#9971) UI: Allow accounts of the `User` type to add other accounts or users to projects through UI (apache#9927) enable to create VPC portfowarding rules with source cidr (apache#7081) Add new column `last_id` to the table volumes (apache#9759) Allow VMWare import via another host (apache#9787) Linstor: add support for ISO block devices and direct download (apache#9792) get expunged VM data for job result (apache#9949) fix section divider display on auth page (apache#9966)
Description
Fixes: #7483
When a guest network is created, ACS allows the configuration of the firewall and port forwarding, load balancing, and VPN rules for all IPs associated with the network (including the source NAT). However, when creating a VPC, firewall configurations are possible only via ACLs; port forwarding and load balancing rules are only possible for other public IPs assigned to the network. Thus, situations, where it is necessary to combine firewall rules and port forwarding/load balancing in VPCs, are not possible.
To work around the situation, this PR implements an extension to allow the definition of source CIDR when creating port forwarding rules. If the
cidrlist
parameter is not informed, the current behavior is maintained. This attribute will only be used when creating port forwarding rules in VPCs, since in guest networks it is possible to combine firewall and port forwarding/load balancing rules directly on the public IPs allocated to that network.Furthermore, it was observed that when removing a port forwarding rule, even if the ACS confirmed the removal of said rule, it remained active in the VR. This behavior has changed so that the rule is removed properly.
Types of changes
Feature/Enhancement Scale
How Has This Been Tested?
For testing purposes, I created a VPC:
vpc-01
and a Tier:vpc-01-tier-01
. Using this tier three instancesPF01
,PF02
,PF03
was created and the port forward and ACL rules described below were created.Firewall Rules Applied (ACL)
Port forward rules
This way, after applying the ACL rule that authorizes access to port
22
from any IP (0.0.0.0/0
); access to other instances (PF02
andPF03
) turns out to be exposed. After applying the port forward rule limiting access to a list of CIDRs, the observed result was that access to the resources/services of instancesPF02
andPF03
was limited to the CIDR informed when creating the port forward ruleRegras de port forward