Review Compute Engine external IP access paths

Check whether Compute Engine needs an external IP and verify its effective inbound access.

Description

On a Compute Engine interface, accessConfigs can assign the VM an external IPv4 address. Routes, firewalls and listening services determine which ports can receive connections.

Potential impact

A reachable port can receive unwanted connections. Stolen credentials or vulnerable services can expose data.

Remediation

Remove the external IP from interfaces that do not need direct inbound access. First verify administration over IAP or a VPN and provide outbound connectivity such as Cloud NAT if needed. Check other interfaces, IPv6 and public load balancers or proxies. On intended public paths, apply firewalls, authentication and transport encryption, then test access.

Examples

Standard support for Deployment Manager has ended. These legacy excerpts show one interface. The first requests an external IPv4 address and the second omits it. Use supported tooling, replace network with the actual VPC and supply the remaining VM settings.

Before

yaml
resources:
  - name: instance
    type: compute.v1.instance
    properties:
      networkInterfaces:
        - accessConfigs:
            - name: External NAT
              type: ONE_TO_ONE_NAT

After

yaml
resources:
  - name: instance
    type: compute.v1.instance
    properties:
      networkInterfaces:
        - network: network

References