|
| 1 | +--- |
| 2 | +short_title: Common CloudNGFW |
| 3 | +type: refarch |
| 4 | +show_in_hub: false |
| 5 | +swfw: cloudngfw |
| 6 | +--- |
| 7 | +# Reference Architecture with Terraform: Cloud NGFW in Azure, Virtual Network Design Model. |
| 8 | + |
| 9 | +Palo Alto Networks produces several [validated reference architecture design and deployment documentation guides](https://www.paloaltonetworks.com/resources/reference-architectures), which describe well-architected and tested deployments. |
| 10 | +When deploying Cloud NGFWs in a public cloud, the reference architecturesguide users toward the best security outcomes, |
| 11 | +whilst reducing rollout time and avoiding common integration efforts. |
| 12 | + |
| 13 | +The Terraform code presented here will deploy Palo Alto Networks Cloud NGFW firewall in Azure based on a centralized virtual network design model with common Cloud NGFW for all traffic; for a discussion of other options, please see the design guide from |
| 14 | +[the reference architecture guides](https://www.paloaltonetworks.com/resources/reference-architectures). |
| 15 | + |
| 16 | +## Detailed Architecture and Design |
| 17 | + |
| 18 | +### Centralized Virtual Network Design |
| 19 | + |
| 20 | +This code implements: |
| 21 | + |
| 22 | +- a *centralized virtual network design*, a hub-and-spoke topology with a Transit VNet containing Cloud NGFW to inspect all inbound, outbound, east-west, and enterprise traffic. |
| 23 | + |
| 24 | +This design uses a Transit VNet. Application functions and resources are deployed across multiple VNets that are connected in |
| 25 | +a hub-and-spoke topology. The hub of the topology, or transit VNet, is the central point of connectivity for all inbound, |
| 26 | +outbound, east-west, and enterprise traffic. You integrate Cloud NGFW with the transit VNet. Please see the [Cloud NGFW design guide](https://www.paloaltonetworks.com/apps/pan/public/downloadResource?pagePath=/content/pan/en_US/resources/guides/securing-apps-with-cloud-ngfw-for-azure-design-guide). |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +This reference architecture consists of: |
| 31 | + |
| 32 | +- a VNET containing: |
| 33 | + - 2 subnets dedicated to the Cloud NGFW: private and public |
| 34 | + - Route Tables and Network Security Groups |
| 35 | +- 1 Cloud NGFW: |
| 36 | + - with 2 network interfaces: public, private |
| 37 | + - with 2 public IP addresses assigned to public interface |
| 38 | + - Destination Network Address Translation rules |
| 39 | +- _(optional)_ test workloads with accompanying infrastructure: |
| 40 | + - 2 Spoke VNETs with Route Tables and Network Security Groups |
| 41 | + - 2 Spoke VMs serving as WordPress-based web servers |
| 42 | + - 2 Azure Bastion managed jump hosts |
| 43 | + |
| 44 | +**NOTE!** |
| 45 | +- In order to deploy the architecture without test workloads described above, empty the `test_infrastructure` map in |
| 46 | + `example.tfvars` file. |
| 47 | + |
| 48 | +## Prerequisites |
| 49 | + |
| 50 | +A list of requirements might vary depending on the platform used to deploy the infrastructure but a minimum one includes: |
| 51 | + |
| 52 | +- _(in case of non cloud shell deployment)_ credentials and (optionally) tools required to authenticate against Azure Cloud, |
| 53 | + see [AzureRM provider documentation for details](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#authenticating-to-azure) |
| 54 | +- [supported](#requirements) version of [`Terraform`](<https://developer.hashicorp.com/terraform/downloads>) |
| 55 | + |
| 56 | +**NOTE!** |
| 57 | +- after the deployment the firewalls remain not configured and not licensed |
| 58 | +- to manage Cloud NGFW via Panorama, an existing Panorama instance is required. Please see the [Panorama integration guide](https://docs.paloaltonetworks.com/cloud-ngfw/azure/cloud-ngfw-for-azure/panorama-policy-management/panorama-integration-overview). |
| 59 | + |
| 60 | + |
| 61 | +## Usage |
| 62 | + |
| 63 | +### Deployment Steps |
| 64 | + |
| 65 | +- checkout the code locally (if you haven't done so yet) |
| 66 | +- copy the [`example.tfvars`](./example.tfvars) file, rename it to `terraform.tfvars` and adjust it to your needs |
| 67 | + (take a closer look at the `TODO` markers) |
| 68 | +- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice |
| 69 | +- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value |
| 70 | + in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged |
| 71 | + option, we don't recommend putting the Subscription ID in clear text inside the code). |
| 72 | +- initialize the Terraform module: |
| 73 | + |
| 74 | + ```bash |
| 75 | + terraform init |
| 76 | + ``` |
| 77 | + |
| 78 | +- _(optional)_ plan you infrastructure to see what will be actually deployed: |
| 79 | + |
| 80 | + ```bash |
| 81 | + terraform plan |
| 82 | + ``` |
| 83 | + |
| 84 | +- deploy the infrastructure (you will have to confirm it with typing in `yes`): |
| 85 | + |
| 86 | + ```bash |
| 87 | + terraform apply |
| 88 | + ``` |
| 89 | + |
| 90 | + The deployment takes couple of minutes. |
| 91 | + |
| 92 | +### Post deploy |
| 93 | + |
| 94 | +Firewall in this example is configured for management via Panorama. |
| 95 | +To manage the firewall, all configurations are handled through the Panorama instance. |
| 96 | + |
| 97 | +### Cleanup |
| 98 | + |
| 99 | +To remove the deployed infrastructure run: |
| 100 | + |
| 101 | +```sh |
| 102 | +terraform destroy |
| 103 | +``` |
0 commit comments