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

Disable SNAT regardless of the destination IP address (Firewall) since forced tunneling is turned on #194

Merged
merged 5 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/modules/firewall/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ resource "azurerm_firewall" "firewall" {
location = data.azurerm_resource_group.hub.location
resource_group_name = data.azurerm_resource_group.hub.name
sku_tier = var.firewall_sku
private_ip_ranges = var.disable_snat_ip_range
tags = var.tags

ip_configuration {
Expand Down
10 changes: 10 additions & 0 deletions src/modules/firewall/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ variable "tags" {
type = map(string)
default = {}
}

# With forced tunneling on, Configure Azure Firewall to never SNAT regardless of the destination IP address,
# use 0.0.0.0/0 as your private IP address range.
# With this configuration, Azure Firewall can never route traffic directly to the Internet.
# see: https://docs.microsoft.com/en-us/azure/firewall/snat-private-range
variable "disable_snat_ip_range" {
description = "The address space to be used to ensure that SNAT is disabled."
default = ["0.0.0.0/0"]
type = list
}