Skip to content

Network Rules Module

This module will output an object containing a default set of network rules, which can be used for all of the various forms Azure/Terraform requires.

The default set is made up of BitBucket deployment IPs, support staff home offices for troubleshooting and debugging, corporate-wide WAN/VPN egress IPs, and on-prem networks that are peered via Virtual Gateways

Usage Examples:

Use only default rules

module "network_rules" {
}

Add additional rules to the default list

module "network_rules" {
  additional_network_acls = {
    Allowed = [
      {
        name = "User1-Host"
        ip   = "192.168.0.1"
      },
      {
        name = "User2-Host"
        ip   = "192.168.0.2/32"
      },
      {
        name = "Vendor3-Network"
        ip   = "8.8.8.8/24"
      },
    ]
    Denied = {
      name = "BadActor-1"
      ip   = "4.4.4.4"
    }
  }
}
`

Requirements

Name Version
terraform >= 1.0

Inputs

Name Description Type Default Required
additional_network_acls Object containing Allow and Deny IPs/CIDRs, will be merged with a default set. List so ordering is preserved
object({
Allowed = list(object({
name = string
ip = string
}))
Denied = list(object({
name = string
ip = string
}))
})
{
"Allowed": [],
"Denied": []
}
no
default_allowed_ip_list List of objects containing the default allowed IPs (Corporate, and Engineer Support Staff). Set to an empty list ([]) if not desired
list(object({
name = string
ip = string
}))
[
{
"ip": "104.3.19.97",
"name": "NTERSOL"
},
{
"ip": "108.44.192.0/18",
"name": "Mickey"
},
{
"ip": "192.26.129.0/24",
"name": "CMG-Main"
},
{
"ip": "206.171.1.0/24",
"name": "CMG-Block2"
},
{
"ip": "63.207.211.0/24",
"name": "CMG-Block3"
},
{
"ip": "98.97.0.0/20",
"name": "Andy-Starlink"
},
{
"ip": "129.222.0.0/21",
"name": "Andy-Starlink_Temp"
},
{
"ip": "208.104.0.0/16",
"name": "Jeff-Slaughter"
},
{
"ip": "174.50.196.0/22",
"name": "Aaron-Hurst"
}
]
no

Outputs

Name Description
ip_objects n/a
keyvault_network_allowed_ips n/a
sql_network_allowed_ips n/a
storage_account_network_allowed_ips n/a
webapp_ip_restriction_rules n/a
webapp_network_allowed_ips n/a