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

Open all ICMP ports #2195

Closed
valkaitibor opened this issue Jun 21, 2023 · 3 comments
Closed

Open all ICMP ports #2195

valkaitibor opened this issue Jun 21, 2023 · 3 comments
Assignees
Labels

Comments

@valkaitibor
Copy link

Terraform provider version

1.35.1

Affected Resource(s)

  • opentelekomcloud_networking_secgroup_rule_v2

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

resource "opentelekomcloud_networking_secgroup_rule_v2" "admin_secgroup_rule_rds_icmp" {
description = "all ICMP ports"
direction = "ingress"
ethertype = "IPv4"
protocol = "icmp"
port_range_min = 0
port_range_max = 255
remote_ip_prefix = "0.0.0.0/0"
security_group_id = opentelekomcloud_networking_secgroup_v2.admin_secgroup.id
}

Debug Output/Panic Output

Steps to Reproduce

  1. terraform apply
  2. No error messages, a new security group rule is created with ICMP: 0-255

Expected Behavior

A new security group rule should be created with ICMP: All. The ping should work.
My aim is to get the same result as creating the ICMP: All security group rule. On AWS, the port range min and max should be -1 to have the same result. On OTC, it is not working, the error message says that only numbers from 0 to 255 can be used. It is obvious that if I am setting the range from 0 to 255, it should cause the same result as the ICMP: All rule. But in the case of ICMP:0-255, the ping is not working between the ECSs. After I am adding the ICMP: All rule manually, the ping is working. However, for using an RDS, other ICMP ports should be opened, so I really need the option to create the ICMP: All rule with terraform. Please create the opportunity to use -1 to activate this rule.

Actual Behavior

A new security group rule is created with ICMP: 0-255. The ping is not working.

Important Factoids

References

@vladimirvshivkov
Copy link
Contributor

icmp has no ports, so try to create rule without any ports like:

resource "opentelekomcloud_networking_secgroup_rule_v2" "admin_secgroup_rule_rds_icmp" {
    description = "all ICMP ports"
    direction = "ingress"
    ethertype = "IPv4"
    protocol = "icmp"
    remote_ip_prefix = "0.0.0.0/0"
    security_group_id = opentelekomcloud_networking_secgroup_v2.admin_secgroup.id
}

@valkaitibor
Copy link
Author

If i am not specifying the port range, then it will be a port range min 0 and port range max 0 by default, which means the echo reply will be allowed, instead of icmp:all

@anton-sidelnikov anton-sidelnikov self-assigned this Jun 21, 2023
otc-zuul bot pushed a commit that referenced this issue Jun 23, 2023
…_v2` (#2197)

[VPC] icmp any in `resource/opentelekomcloud_networking_secgroup_rule_v2`

Summary of the Pull Request
PR Checklist

 Refers to: #2195
 Tests added/passed.
 Documentation updated.
 Schema updated.
 Release notes added.

Acceptance Steps Performed
=== RUN   TestAccNetworkingV2SecGroupRule_basic
=== PAUSE TestAccNetworkingV2SecGroupRule_basic
=== CONT  TestAccNetworkingV2SecGroupRule_basic
--- PASS: TestAccNetworkingV2SecGroupRule_basic (54.77s)
=== RUN   TestAccNetworkingV2SecGroupRule_importBasic
=== PAUSE TestAccNetworkingV2SecGroupRule_importBasic
=== CONT  TestAccNetworkingV2SecGroupRule_importBasic
--- PASS: TestAccNetworkingV2SecGroupRule_importBasic (61.23s)
=== RUN   TestAccNetworkingV2SecGroupRule_timeout
=== PAUSE TestAccNetworkingV2SecGroupRule_timeout
=== CONT  TestAccNetworkingV2SecGroupRule_timeout
--- PASS: TestAccNetworkingV2SecGroupRule_timeout (54.78s)
=== RUN   TestAccNetworkingV2SecGroupRule_numericProtocol
=== PAUSE TestAccNetworkingV2SecGroupRule_numericProtocol
=== CONT  TestAccNetworkingV2SecGroupRule_numericProtocol
--- PASS: TestAccNetworkingV2SecGroupRule_numericProtocol (54.46s)
=== RUN   TestAccNetworkingV2SecGroupRule_noPorts
=== PAUSE TestAccNetworkingV2SecGroupRule_noPorts
=== CONT  TestAccNetworkingV2SecGroupRule_noPorts
--- PASS: TestAccNetworkingV2SecGroupRule_noPorts (54.33s)
=== RUN   TestAccNetworkingV2SecGroupRule_ICMP
=== PAUSE TestAccNetworkingV2SecGroupRule_ICMP
=== CONT  TestAccNetworkingV2SecGroupRule_ICMP
--- PASS: TestAccNetworkingV2SecGroupRule_ICMP (132.69s)
=== RUN   TestAccNetworkingV2SecGroupRule_noProtocolError
--- PASS: TestAccNetworkingV2SecGroupRule_noProtocolError (9.26s)
PASS


Process finished with the exit code 0

Reviewed-by: Artem Lifshits
Reviewed-by: Aloento
@anton-sidelnikov
Copy link
Member

Hi @valkaitibor, check on latest please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants