Azure Network Rules Engine
This page shows how to write Terraform for Network Rules Engine and write them securely.
azurerm_frontdoor_rules_engine (Terraform)
The Rules Engine in Network can be configured in Terraform with the resource name azurerm_frontdoor_rules_engine. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
The following arguments are supported:
name- (Required) The name of the Rules engine configuration. Changing this forces a new resource to be created.frontdoor_name- (Required) The name of the Front Door instance. Changing this forces a new resource to be created.resource_group_name- (Required) The name of the resource group. Changing this forces a new resource to be created.rule- (Required) Aruleblock as defined below.
The rule block supports the following:
name- (Required) The name of the rule.priority- (Required) Priority of the rule, must be unique per rules engine definition.action- (Required) Arule_actionblock as defined below.match_condition- One or morematch_conditionblock as defined below.
The action block supports the following:
request_header- Arequest_headerblock as defined below.response_header- Aresponse_headerblock as defined below.
The request_header block supports the following:
header_action_typecan be set toOverwrite,AppendorDelete.header_nameheader name (string).valuevalue name (string).
The response_header block supports the following:
header_action_typecan be set toOverwrite,AppendorDelete.header_nameheader name (string).valuevalue name (string).
The match_condition block supports the following:
variablecan be set toIsMobile,RemoteAddr,RequestMethod,QueryString,PostArgs,RequestURI,RequestPath,RequestFilename,RequestFilenameExtension,RequestHeader,RequestBodyorRequestScheme.selectormatch against a specific key whenvariableis set toPostArgsorRequestHeader. It cannot be used withQueryStringandRequestMethod. Defaults tonull.operatorcan be set toAny,IPMatch,GeoMatch,Equal,Contains,LessThan,GreaterThan,LessThanOrEqual,GreaterThanOrEqual,BeginsWithorEndsWithtransformcan be set to one or more values out ofLowercase,RemoveNulls,Trim,Uppercase,UrlDecodeandUrlEncodenegate_conditioncan be set totrueorfalseto negate the given condition. Defaults totrue.value(array) can contain one or more strings.
Explanation in Terraform Registry
Manages an Azure Front Door Rules Engine configuration and rules.
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.