π Google GCE Instance has a public IP address π’
- Contextual name: π Instance has a public IP address π’
- ID:
/ce/ca/google/compute-engine/instance-public-ip
- Located in: π Google GCE
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Compute instances should not be configured to have external IP addresses.
Rationaleβ
To reduce your attack surface, Compute instances should not have public IP addresses. Instead, instances should be configured behind load balancers, to minimize the instance's exposure to the internet.
Impactβ
Removing the external IP address from your Compute instance may cause some applications to stop working.
Auditβ
From Google Cloud Consoleβ
- Go to the
VM instances
page by visiting: https://console.cloud.google.com/compute/instances.- For every VM, ensure that there is no
External IP
configured.From Google Cloud CLIβ
gcloud compute instances list --format=json
- The output should not contain an
accessConfigs
section undernetworkInterfaces
. Note that thenatIP
value is present only for instances that are running or for instances that are stopped but have a static IP address. For instances that are stopped and are configured to have an ephemeral public IP address, thenatIP
field will not be present. Example output:... see more
Remediationβ
Remediationβ
From Google Cloud Consoleβ
- Go to the
VM instances
page by visiting: https://console.cloud.google.com/compute/instances.- Click on the instance name to go the the
Instance detail page
.- Click
Edit
.- For each Network interface, ensure that
External IP
is set toNone
.- Click
Done
and then clickSave
.From Google Cloud CLIβ
Describe the instance properties:
gcloud compute instances describe <INSTANCE_NAME> --zone=<ZONE>
Identify the access config name that contains the external IP address. This access config appears in the following format:
networkInterfaces:
- accessConfigs:
- kind: compute#accessConfig
name: External NAT
natIP: 130.211.181.55
type: ONE_TO_ONE_NATDelete the access config.
gcloud compute instances delete-access-config <INSTANCE_NAME> --zone=<ZONE> --access-config-name <ACCESS_CONFIG_NAME>
In the above example, the
ACCESS_CONFIG_NAME
isExternal NAT
. The name of your access config might be different.
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ CIS GCP v3.0.0 β πΌ 4.9 Ensure That Compute Instances Do Not Have Public IP Addresses - Level 2 (Automated) | 1 | |||
πΌ Cloudaware Framework β πΌ Public and Anonymous Access | 24 |