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

azurerm_firewall_policy_rule_collection_group destination_ports argument does not support "*" #10918

Closed
schlickspringer opened this issue Mar 10, 2021 · 7 comments · Fixed by #11326

Comments

@schlickspringer
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

terraform 0.13.5
azurerm 2.49.0

Affected Resource(s)

  • azurerm_firewall_policy_rule_collection_group

Terraform Configuration Files

resource "azurerm_firewall_policy_rule_collection_group" "defaultgrouprules" {
  name               = "DefaultNetworkRuleCollectionGroup"
  firewall_policy_id = azurerm_firewall_policy.pol01.id
  priority           = 200
 network_rule_collection {
    name     = "CollectionforTesting"
    priority = 1000
    action   = "Allow"
    rule {
      name                  = "AllowAll"
      protocols             = ["Any","ICMP","TCP","UDP"]
      source_addresses      = ["*"]
      destination_addresses = ["*"]
      destination_ports     = ["*"]
    }
  }
}

Debug Output

Panic Output

Expected Behaviour

Apply the configuration.

Actual Behaviour

An error results when using "*" as a destination_ports argument. An asterisk is a valid destination_port argument when using the Azure Portal.

Error: invalid format of "network_rule_collection.0.rule.0.destination_ports.0"

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@adamday2
Copy link
Contributor

I believe this is a dupe of #10524 and #10187 where the recommendation was to set the value to 1-65535.

@schlickspringer
Copy link
Author

schlickspringer commented Mar 10, 2021

I have already tried this but have the strange behavior: When set to 1-65535 my ping to a destination behind FW does not work. As soon as I change the ports to "*" within Azure Portal my ping command works.

So I guess there is something different behind the scenes. At least for ICMP protocol.

@pauldotyu
Copy link

Any updates on this? I too have confirmed that using a port range of 1-65535 does not work for Azure Firewall Policy Manager rule collections.

@juicybaba
Copy link

ping and traceroute are reply on ICMP, and ICMP is a protocol on network layer which doesnt have the concept of port
https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol

To me, port should be ignored (by using "*") for ICMP traffic.

@jkroepke
Copy link
Contributor

@adamday2

where the recommendation was to set the value to 1-65535.

1-65535 != *

https://docs.microsoft.com/de-de/azure/firewall/rule-processing#network-rule-protocol

If a destination port is explicitly configured, then the rule is translated to a TCP+UDP rule.

That means, If a rule has port like 1-65535 defined, ICMP not longer works.

@ghost
Copy link

ghost commented Apr 16, 2021

This has been released in version 2.56.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.56.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented May 15, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants