🛡️ Google Cloud SQL Instance External Authorized Networks whitelists all public IP addresses🟢
- Contextual name: 🛡️ Instance External Authorized Networks whitelists all public IP addresses🟢
- ID:
/ce/ca/google/sql/instance-public-ip-whitelist - Tags:
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logic
Similar Policies
- Cloud Conformity: Check for Publicly Accessible Cloud SQL Database Instances
Description
Description
Database servers should accept connections only from trusted networks or IPs and restrict access from public IP addresses.
Rationale
To minimize the attack surface on a database server instance, only trusted and required IPs should be allowlisted to connect to it.
An authorized network should not have IPs/networks configured to
0.0.0.0/0which will allow access to the instance from anywhere in the world. Note that authorized networks apply only to instances with public IPs.Impact
The Cloud SQL database instance would not be available to public IP addresses.
Audit
From Google Cloud Console
- Go to the Cloud SQL Instances page in the Google Cloud Console by visiting https://console.cloud.google.com/sql/instances.
- Click the instance name to open its
Instance detailspage.- Under the
Configurationsection clickEdit configurations.- Under
Configuration optionsexpand theConnectivitysection.- Ensure that no authorized network is configured to allow
0.0.0.0/0.From Google Cloud CLI
... see more
Remediation
Remediation
From Google Cloud Console
- Go to the Cloud SQL Instances page in the Google Cloud Console by visiting https://console.cloud.google.com/sql/instances.
- Click the instance name to open its
Instance detailspage.- Under the
Configurationsection clickEdit configurations.- Under
Configuration optionsexpand theConnectivitysection.- Click the
deleteicon for the authorized network0.0.0.0/0.- Click
Saveto update the instance.From Google Cloud CLI
Update the authorized network list by removing any public addresses.
gcloud sql instances patch {{instance-name}} \
--authorized-networks={{ip-addr1}},{{ip-addr2}}