> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ingress Protection via Aviatrix Transit FireNet with Palo Alto in GCP

> This document describes how to configure ingress in GCP with traffic inspection, deployed directly in Transit FireNet. In this configuration you use the native GCP load balancers in Transit FireNet.

This document describes how to configure ingress in GCP with traffic inspection,
deployed directly in Transit FireNet. In this configuration you use the native
GCP load balancers in Transit FireNet. These load balancers are created after
you enable Transit FireNet as part of the

<a href={"/docs/enterprise/" + "10.1" + "/guides/security/firenet/transit-firenet-workflow-gcp"}>Transit FireNet Workflow for GCP</a>
.

The solution described below shows how to implement network load balancer
(NLB)-based ingress with Palo Alto firewalls in GCP.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp-ingress.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=f153985a3762d9398e8f5bc5d187efa4" alt="gcp_ingress" width="561" height="712" data-path="images/guides/security/firenet/gcp-ingress.png" />

<Note>
  In this NLB-based deployment in GCP, the original source address is preserved.
  The firewall then has to NAT the traffic source to its LAN interface IP;
  that's where the original source IP is rewritten (SNAT).
</Note>

This document provides a step-by-step guide for application ingress protection
via Aviatrix Transit FireNet using Palo Alto firewalls for Aviatrix Controller
version R6.6 and later.

For more information about Transit FireNet, see the following:

* <a href={"/docs/enterprise/" + "10.1" + "/guides/security/firenet/firewall-overview"}>Firewall Overview</a>
* <a href={"/docs/enterprise/" + "10.1" + "/concepts-architectures/architecture/security/firenet-design-patterns"}>Firewall Network Design Patterns</a>

## Design Considerations

This document describes NLB-based ingress in GCP. However, there are options
available for other traffic types. For HTTP/HTTPS load balancing, an HTTP(S)
load balancer with Network Endpoint groups could be another option, although
this method does not preserve the source IP address until the firewall is
reached. For a limited list of supported ports you can also use a TCP
proxy-based load balancer with Network Endpoint Groups.

Currently in GCP you cannot place a HTTP(S) or other form of load balancer into
a Spoke VPC, as load balancers are not tied to a subnet and would deliver
traffic directly to backend services instead of Spoke gateways. A third-party
appliance such as F5 could be used to do this in a spoke network if needed.

## Deployment Steps

### Deploy a Transit FireNet in GCP

Set up a Transit FireNet in GCP and enable centralized egress. For details on
setting up Transit FireNet see <a href={"/docs/enterprise/" + "10.1" +
"/guides/security/firenet/transit-firenet-workflow-gcp"}>Transit FireNet
Workflow</a>.

### Set up Firewall Instances for Egress

1. <a href={"/docs/enterprise/" + "10.1" + "/reference/security/firenet/paloalto-vmseries-gcp"}>Set up the firewall instances</a>
   .

2. Enable vendor integration with the firewalls by going to Security > FireNet >
   FireNet Gateways.

3. Next to the desired Transit FireNet, click the vertical ellipsis
   <img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/threedot.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=23c2dfda36beb50519e85b0b43f589c6" alt="vertical ellipsis" width="24" height="34" data-path="images/guides/security/firenet/threedot.png" /> and select
   *Vendor Integration*).

4. Click the Edit icon <img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/edit-icon.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=850942b0ccb8d08666d83c782763de02" alt="Edit icon" style={{display: 'inline', verticalAlign: 'middle', height: '1em'}} width="21" height="26" data-path="images/guides/security/firenet/edit-icon.png" /> next
   to the desired Transit FireNet. In the Edit Transit FireNet dialog, slide the
   Egress toggle to *On*.

### Verify Health Probe Status

In the GCP console open the Load balancing menu and check the health of the load
balancers used by the Transit FireNet. These load balancers were created during
the Transit FireNet setup for GCP. There will be one UDP and one TCP load
balancer. Backends should show as healthy.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp-health-status.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=f4d470943993249ab8ae222b9a5f186a" alt="gcp_be_lb_health" width="1475" height="282" data-path="images/guides/security/firenet/gcp-health-status.png" />

### Set up Palo Alto Firewalls for Ingress Load Balancing

#### Update Management Profile

Edit the management profile to restrict access to firewall management access
over WAN and LAN interfaces to only health probes.

Enable HTTP access since the legacy health probes in GCP only support HTTP and
not HTTPS.

The IP address ranges to add are:

* 169.254.169.254 (legacy health probe for External load balancer)
* 35.191.0.0/16 and 130.211.0.0/22 (health probes for Internal load balancer)

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/palo-alto-profile1.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=7123e298b934ffa269415a0d538368c2" alt="Management profile configuration" width="1391" height="670" data-path="images/guides/security/firenet/palo-alto-profile1.png" />

Add the management profile you have updated to the WAN interface of the
firewall.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/palo-alto-profile2.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=5289b34cd40f116ef3f4cc4f5227e046" alt="WAN interface profile" width="1920" height="1032" data-path="images/guides/security/firenet/palo-alto-profile2.png" />

### Create Ingress Load Balancer in GCP

Create a Load Balancer in GCP that points to the WAN interface of your
firewalls. A Network Load Balancer can terminate any kind of application.

1. Click *Create Load Balancer* on the Load balancing page.

2. Select TCP Load Balancing > Start Configuration.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp-createlb2.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=5bb8f1d9bbb7ba69a983ea8016ef8629" alt="TCP Load Balancing configuration" width="1922" height="588" data-path="images/guides/security/firenet/gcp-createlb2.png" />

3. Select the load balancer options as shown below: *From Internet to my VMs*,
   *Single region only*, and *Target Pool or Target Instance*.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp_create_lb_3.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=2984e03605b4106368233daae45ef7b0" alt="Load balancer options" width="1922" height="773" data-path="images/guides/security/firenet/gcp_create_lb_3.png" />

4. Enter a Name and select a Region (must match Transit FireNet's region), click
   *Select Existing Instances* and select the firewall instances.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp_create_lb_4.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=f294c60d8e874325c1095996cfc5fb77" alt="Load balancer name and region" width="1922" height="730" data-path="images/guides/security/firenet/gcp_create_lb_4.png" />

5. In the Health Check area, create a health probe for the Load Balancer. Use
   port 80 and enter this path: /php/login.php. This path must be set for the
   health probe to succeed. Click *Save*.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp_create_lb_5.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=fbf37e46b7bbaeb1aae61d5a8f040546" alt="Health check configuration" width="1922" height="1034" data-path="images/guides/security/firenet/gcp_create_lb_5.png" />

6. Click *Frontend configuration* on the Load Balancer Page and set up a
   frontend for the ingress public IP.
   1. Set up one frontend per application (or per public IP needed).
   2. Specify the port needed for the application. Note that you cannot modify
      this port later, so if you are unsure, set up 1-65535 as this allows all
      ports to be forwarded to the firewall for this IP address.
   3. Click *Create* to create the load balancer.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp-createlb6.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=5e56ac84085cdbc4b904f901a86721e4" alt="Frontend configuration" width="1079" height="850" data-path="images/guides/security/firenet/gcp-createlb6.png" />

### Set up Firewalls for Ingress Application Traffic

#### Create NAT Rules

Now that the load balancer is created, you must create a NAT rule for the
firewall to answer those probes destined for the frontend IP address of the load
balancer.

In the firewall UI, create a DNAT rule for each frontend IP, to ensure that the
health check will work.

Next, create a DNAT/SNAT rule for each application to DNAT/SNAT traffic to the
actual application IP in the Spoke. The following screenshot shows an example
for these rules.

This example uses the following parameters:

* Fronted IP: 35.187.7.41
* Ingress application port: 80 (this must always be 80 for the health probe NAT
  rule)
* Firewall's WAN interface IP address: 10.0.1.19
* Application IP in spoke: 10.0.2.18

You need to SNAT traffic to the firewall's LAN port to make sure returning
traffic hits the same firewall.

Make sure you always add the health probe NAT rule above the ingress app rule,
as that is more specific in case the application and the health probe use the
same port.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/paloalto-dnat1.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=2c864eeb77cf79f520c32f2fc5c0df80" alt="DNAT rules configuration" width="1922" height="1034" data-path="images/guides/security/firenet/paloalto-dnat1.png" />

#### Update Firewall Policy

* Update the security policy on the firewall to enable access to the Frontend IP
  address of your load balancer from the health probe address (169.254.169.254)
  using HTTP (this will be the original health probe packet).
* Set up the firewall's security policy to enable the application ingress
  traffic.

### Set up GCP Firewall Rules for Ingress

* Add an ingress firewall rule to the GCP firewall to allow ingress traffic to
  the firewall for the application. Use the tag `avx-<egress_vpc_name>-gbl` for
  matching the firewall instances. Allow the application's port from 0.0.0.0/0
  in.
* Use the name of your egress VPC as a parameter in the tag's
  `<egress_vpc_name>`. In the example below the egress VPC name is
  "gcp-fw-egress-vpc" resulting in the tag name of "avx-gcp-fw-egress-vpc-gbl".

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp_fwrule_ingress.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=dd828e9a7b5992bb2d2036566f8377b9" alt="GCP firewall rule for ingress" width="943" height="1341" data-path="images/guides/security/firenet/gcp_fwrule_ingress.png" />

### Validate the Setup

Check that the load balancer in the GCP console shows the backend as healthy for
the firewalls. Note that when you reboot a firewall, it might take up to 30
minutes to respond to health checks on port 80.

<img src="https://mintcdn.com/aviatrix-14b37c43/mOZ0lmP7pRPIryx3/images/guides/security/firenet/gcp-health-check.png?fit=max&auto=format&n=mOZ0lmP7pRPIryx3&q=85&s=6ea1fc60b14b07ac6339f1eab0f593bd" alt="GCP health check" width="1298" height="451" data-path="images/guides/security/firenet/gcp-health-check.png" />

Initiate traffic from the Internet toward your application hosted in the spoke
VPC. To do so, use the frontend IP address of the load balancer you created and
the defined frontend port. Your application should respond.
