Azure Network Application Rule Collection
This page shows how to write Terraform for Network Application Rule Collection and write them securely.
azurerm_firewall_application_rule_collection (Terraform)
The Application Rule Collection in Network can be configured in Terraform with the resource name azurerm_firewall_application_rule_collection
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_firewall_application_rule_collection" "private_aks" {
name = "PrivateAKSAppRules"
azure_firewall_name = azurerm_firewall.azure_firewall_instance.name
resource_group_name = var.resource_group_name
priority = 100
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "aksbasics" {
name = "aksbasics"
azure_firewall_name = azurerm_firewall.fw.name
resource_group_name = var.resource_group
priority = 101
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "aksbasics" {
name = "aksbasics"
azure_firewall_name = azurerm_firewall.fw.name
resource_group_name = var.resource_group
priority = 101
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "httpbin" {
name = local.dns_httpbin_application_rule_collection
azure_firewall_name = azurerm_firewall.firewall.name
resource_group_name = azurerm_resource_group.hub.name
priority = 100
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "aksbasics" {
name = "aksbasics"
azure_firewall_name = azurerm_firewall.fw.name
resource_group_name = var.resource_group
priority = 101
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "aksbasics" {
name = "aksbasics"
azure_firewall_name = azurerm_firewall.fw.name
resource_group_name = var.resource_group
priority = 101
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "aksbasics" {
name = "aksbasics"
azure_firewall_name = azurerm_firewall.fw.name
resource_group_name = var.resource_group
priority = 101
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "aksbasics" {
name = "aksbasics"
azure_firewall_name = azurerm_firewall.fw.name
resource_group_name = azurerm_resource_group.core.name
priority = 101
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "aksbasics" {
name = "aksbasics"
azure_firewall_name = azurerm_firewall.fw.name
resource_group_name = var.resource_group
priority = 101
action = "Allow"
resource "azurerm_firewall_application_rule_collection" "httpbin" {
name = local.dns_httpbin_application_rule_collection
azure_firewall_name = azurerm_firewall.firewall.name
resource_group_name = azurerm_resource_group.hub.name
priority = 100
action = "Allow"
Parameters
-
action
required - string -
azure_firewall_name
required - string -
id
optional computed - string -
name
required - string -
priority
required - number -
resource_group_name
required - string -
rule
list block-
description
optional - string -
fqdn_tags
optional - set of string -
name
required - string -
source_addresses
optional - set of string -
source_ip_groups
optional - set of string -
target_fqdns
optional - set of string -
protocol
list block
-
-
timeouts
single block
Explanation in Terraform Registry
Manages an Application Rule Collection within an Azure Firewall.
Tips: Best Practices for The Other Azure Network Resources
In addition to the azurerm_network_security_group, Azure Network has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
azurerm_network_security_group
Ensure to disable RDP port from the Internet
It is better to disable the RDP port from the Internet. RDP access should not be accepted from the Internet (*, 0.0.0.0, /0, internet, any), and consider using the Azure Bastion Service.
azurerm_network_security_rule
Ensure to set a more restrictive CIDR range for ingress from the internet
It is better to set a more restrictive CIDR range not to use very broad subnets. If possible, segments should be divided into smaller subnets.
azurerm_network_watcher_flow_log
Ensure to enable Retention policy for flow logs and set it to enough duration
It is better to enable a retention policy for flow logs. Flow logs show us all network activity in the cloud environment and support us when we face critical incidents.
Azure Resource Manager Example
Azure Resource Manager code does not have the related resource.
Frequently asked questions
What is Azure Network Application Rule Collection?
Azure Network Application Rule Collection is a resource for Network of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Network Application Rule Collection?
For Terraform, the Azure/azure-spring-cloud-reference-architecture, ronak-agarwal/private-aks and patuzov/terraform-private-aks source code examples are useful. See the Terraform Example section for further details.