Azure Network Security Partner Provider

This page shows how to write Terraform and Azure Resource Manager for Network Security Partner Provider and write them securely.

azurerm_virtual_hub_security_partner_provider (Terraform)

The Security Partner Provider in Network can be configured in Terraform with the resource name azurerm_virtual_hub_security_partner_provider. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

virtual_hub.tf#L48
resource "azurerm_virtual_hub_security_partner_provider" "spp" {
  depends_on = [azurerm_vpn_gateway.s2s_gateway]
  for_each   = try(var.virtual_hub_config.security_partner_provider, {})

  name                   = azurecaf_name.spp[each.key].result
  resource_group_name    = var.resource_group_name
virtual_hub.tf#L48
resource "azurerm_virtual_hub_security_partner_provider" "spp" {
  depends_on = [azurerm_vpn_gateway.s2s_gateway]
  for_each   = try(var.virtual_hub_config.security_partner_provider, {})

  name                   = azurecaf_name.spp[each.key].result
  resource_group_name    = var.resource_group_name
virtual_hub.tf#L48
resource "azurerm_virtual_hub_security_partner_provider" "spp" {
  depends_on = [azurerm_vpn_gateway.s2s_gateway]
  for_each   = try(var.virtual_hub_config.security_partner_provider, {})

  name                   = azurecaf_name.spp[each.key].result
  resource_group_name    = var.resource_group_name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Security Partner Provider which could be associated to virtual hub.

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.

risk-label

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.

risk-label

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.

risk-label

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.

Review your Azure Network settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Microsoft.Network/virtualHubs (Azure Resource Manager)

The virtualHubs in Microsoft.Network can be configured in Azure Resource Manager with the resource name Microsoft.Network/virtualHubs. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

routeserver.json#L49
            "type": "Microsoft.Network/virtualHubs",
            "apiVersion": "2021-02-01",
            "name": "[parameters('routeserverName')]",
            "location": "[parameters('location')]",
            "properties": {
                "sku": "Standard",
azuredeploy.json#L130
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-05-01",
      "name": "[variables('virtual_hub1_cfg').name]",
      "location": "[parameters('hub1_location')]",
       "dependsOn": [
        "[resourceId('Microsoft.Network/virtualWans', parameters('vWANname'))]"
main.json#L52
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-05-01",
      "name": "[variables('virtual_hub_cfg').name]",
      "location": "[parameters('location')]",
      "properties": {
        "addressPrefix": "[variables('virtual_hub_cfg').addressSpacePrefix]",
azuredeploy.json#L130
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-05-01",
      "name": "[variables('virtual_hub1_cfg').name]",
      "location": "[parameters('hub1_location')]",
       "dependsOn": [
        "[resourceId('Microsoft.Network/virtualWans', parameters('vWANname'))]"
azuredeploy.json#L130
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-05-01",
      "name": "[variables('virtual_hub1_cfg').name]",
      "location": "[parameters('hub1_location')]",
       "dependsOn": [
        "[resourceId('Microsoft.Network/virtualWans', parameters('vWANname'))]"
azuredeploy.json#L130
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-05-01",
      "name": "[variables('virtual_hub1_cfg').name]",
      "location": "[parameters('hub1_location')]",
       "dependsOn": [
        "[resourceId('Microsoft.Network/virtualWans', parameters('vWANname'))]"
azuredeploy.json#L100
            "type": "Microsoft.Network/virtualHubs",
            "apiVersion": "2020-05-01",
            "name": "[variables('virtual_hub1_cfg').name]",
            "location": "[parameters('hub1_location')]",
            "dependsOn": [
                "[resourceId('Microsoft.Network/virtualWans', parameters('vWANname'))]"
azuredeploy.json#L130
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-05-01",
      "name": "[variables('virtual_hub1_cfg').name]",
      "location": "[parameters('hub1_location')]",
       "dependsOn": [
        "[resourceId('Microsoft.Network/virtualWans', parameters('vWANname'))]"
template.json#L106
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-06-01",
      "name": "[parameters('firstRouteServerName')]",
      "location": "[parameters('location')]",
      "dependsOn": [
          "[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]",
azuredeploy.json#L130
      "type": "Microsoft.Network/virtualHubs",
      "apiVersion": "2020-05-01",
      "name": "[variables('virtual_hub1_cfg').name]",
      "location": "[parameters('hub1_location')]",
       "dependsOn": [
        "[resourceId('Microsoft.Network/virtualWans', parameters('vWANname'))]"

Parameters

  • name required - string
  • type required - string
  • apiVersion required - string
  • location required - string

    Resource location.

  • tags optional - string

    Resource tags.

  • properties required
      • virtualWan optional
          • id required - string

            Resource ID.

      • vpnGateway optional
          • id required - string

            Resource ID.

      • p2SVpnGateway optional
          • id required - string

            Resource ID.

      • expressRouteGateway optional
          • id required - string

            Resource ID.

      • azureFirewall optional
          • id required - string

            Resource ID.

      • securityPartnerProvider optional
          • id required - string

            Resource ID.

      • addressPrefix optional - string

        Address-prefix for this VirtualHub.

      • routeTable optional
          • routes optional array
              • addressPrefixes optional - array

                List of all addressPrefixes.

              • nextHopIpAddress optional - string

                NextHop ip address.

      • securityProviderName optional - string

        The Security Provider name.

      • virtualHubRouteTableV2s optional array
          • properties optional
              • routes optional array
                  • destinationType optional - string

                    The type of destinations.

                  • destinations optional - array

                    List of all destinations.

                  • nextHopType optional - string

                    The type of next hops.

                  • nextHops optional - array

                    NextHops ip address.

              • attachedConnections optional - array

                List of all connections attached to this route table v2.

          • name optional - string

            The name of the resource that is unique within a resource group. This name can be used to access the resource.

      • sku optional - string

        The sku of this VirtualHub.

      • routingState optional - string

        The routing state.

      • virtualRouterAsn optional - integer

        VirtualRouter ASN.

      • virtualRouterIps optional - array

        VirtualRouter IPs.

      • allowBranchToBranchTraffic optional - boolean

        Flag to control transit for VirtualRouter hub.

Frequently asked questions

What is Azure Network Security Partner Provider?

Azure Network Security Partner Provider 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 Security Partner Provider?

For Terraform, the aztfmod/terraform-azurerm-caf, pkhuntia/aztfmod and anmoltoppo/Terraform source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the dmauser/azure-hub-spoke-base-lab, naveenpolla/ARM-Templates and s-KaiNet/monaco-csharp-poc source code examples are useful. See the Azure Resource Manager Example section for further details.