| name | cis-gcp-foundations-6.6 |
| description | Ensure That Cloud SQL Database Instances Do Not Have Public IPs |
| category | cis-gcp-foundations |
| version | 4.0.0 |
| author | cyberstrike-official |
| tags | ["cis","gcp","cloud-sql","networking"] |
| cis_id | 6.6 |
| cis_benchmark | CIS Google Cloud Platform Foundation Benchmark v4.0.0 |
| tech_stack | ["gcp"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
6.6 Ensure That Cloud SQL Database Instances Do Not Have Public IPs (Automated)
Profile Applicability
Description
It is recommended to configure Second Generation Sql instance to use private IPs instead of public IPs.
Rationale
To lower the organization's attack surface, Cloud SQL databases should not have public IPs. Private IPs provide improved network security and lower latency for your application.
Impact
Removing the public IP address on SQL instances may break some applications that relied on it for database connectivity.
Audit
From Google Cloud Console
- Go to the Cloud SQL Instances page in the Google Cloud Console: https://console.cloud.google.com/sql/instances
- Ensure that every instance has a private IP address and no public IP address configured.
From Google Cloud CLI
- List all Cloud SQL database instances using the following command:
gcloud sql instances list
- For every instance of type
instanceType: CLOUD_SQL_INSTANCE with backendType: SECOND_GEN, get detailed configuration. Ignore instances of type READ_REPLICA_INSTANCE because these instances inherit their settings from the primary instance. Also, note that first generation instances cannot be configured to have a private IP address.
gcloud sql instances describe <INSTANCE_NAME>
- Ensure that the setting
ipAddresses has an IP address configured of type: PRIVATE and has no IP address of type: PRIMARY. PRIMARY IP addresses are public addresses. An instance can have both a private and public address at the same time. Note also that you cannot use private IP with First Generation instances.
Remediation
From Google Cloud Console
- Go to the Cloud SQL Instances page in the Google Cloud Console: https://console.cloud.google.com/sql/instances
- Click the instance name to open its Instance details page.
- Select the
Connections tab.
- Deselect the
Public IP checkbox.
- Click
Save to update the instance.
From Google Cloud CLI