Skip to content
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

UI bug: the Source/Destination CIDR are set to empty not 0.0.0.0/0 #10002

Open
weizhouapache opened this issue Nov 28, 2024 · 4 comments · May be fixed by #10208
Open

UI bug: the Source/Destination CIDR are set to empty not 0.0.0.0/0 #10002

weizhouapache opened this issue Nov 28, 2024 · 4 comments · May be fixed by #10208

Comments

@weizhouapache
Copy link
Member

The issue happens when create a firewall rule for source nat, static nat, lb or pf on UI.

for example for port forwarding

  • specify the public/private port 22 , the rule is created with source cidr 0.0.0.0/0, which is fine.
  • specify the public/private port 23 , input some value as source cidr then clean the field, the rule is created with empty source cidr.

image

in the VR, there is no iptables rules for port 23, which is wrong.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

CLOUDSTACK VERSION
4.20, should exist in 4.19 as well
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE

EXPECTED RESULTS

ACTUAL RESULTS

@iishitahere
Copy link

Hi @weizhouapache, I’d like to work on this issue. From my understanding, the Source/Destination CIDR fields should default to 0.0.0.0/0 instead of being empty. Could you confirm if this is the expected behavior? If assigned, I’ll get started right away. Looking forward to contributing!

@DaanHoogland
Copy link
Contributor

Hi @weizhouapache, I’d like to work on this issue. From my understanding, the Source/Destination CIDR fields should default to 0.0.0.0/0 instead of being empty. Could you confirm if this is the expected behavior? If assigned, I’ll get started right away. Looking forward to contributing!

@iishitahere , that is correct. When first editting and thanclearing the field, the default of 0.0.0.0/0 should be used again. This can be a UI fix, but as I understand the problem it can also be solved in the API. What do you think @weizhouapache ?

@weizhouapache
Copy link
Member Author

Hi @weizhouapache, I’d like to work on this issue. From my understanding, the Source/Destination CIDR fields should default to 0.0.0.0/0 instead of being empty. Could you confirm if this is the expected behavior? If assigned, I’ll get started right away. Looking forward to contributing!

@iishitahere , that is correct. When first editting and thanclearing the field, the default of 0.0.0.0/0 should be used again. This can be a UI fix, but as I understand the problem it can also be solved in the API. What do you think @weizhouapache ?

@DaanHoogland @iishitahere
from what I know, most APIs with source/destination CIDR are able to process an empty list.
so it looks like a UI issue, UI passes a list with empty string as api parameter. it should not pass the value if the cidr is an empty string or only contains spaces.

@iishitahere
Copy link

i @weizhouapache, I’d like to work on this issue. From my understanding, the Source/Destination CIDR fields should default to 0.0.0.0/0 instead of being empty. Could you confirm if this is the expected behavior? If assigned, I’ll get started right away. Looking forward to contributing!

@iishitahere , that is correct. When first editting and thanclearing the field, the default of 0.0.0.0/0 should be used again. This can be a UI fix, but as I understand the problem it can also be solved in the API. What do you think @weizhouapache ?

@DaanHoogland @iishitahere from what I know, most APIs with source/destination CIDR are able to process an empty list. so it looks like a UI issue, UI passes a list with empty string as api parameter. it should not pass the value if the cidr is an empty string or only contains spaces.

Thank you, @weizhouapache and @DaanHoogland , for the clarification! Based on your input, it seems that addressing this as a UI fix would be the right approach. I’ll focus on ensuring that the UI does not pass an empty string or spaces as API parameters for the CIDR field and defaults to 0.0.0.0/0 when the field is cleared.

I’ll start working on this and keep you updated on my progress. Please let me know if there are any additional details or specific areas you'd like me to focus on. Thanks again for assigning me to this issue!

shwstppr added a commit to shapeblue/cloudstack that referenced this issue Jan 20, 2025
shwstppr added a commit to shapeblue/cloudstack that referenced this issue Jan 20, 2025
@shwstppr shwstppr linked a pull request Jan 20, 2025 that will close this issue
14 tasks
@shwstppr shwstppr linked a pull request Jan 20, 2025 that will close this issue
14 tasks
shwstppr added a commit to shapeblue/cloudstack that referenced this issue Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Dev In Progress
Development

Successfully merging a pull request may close this issue.

3 participants