GCP - Cloud SQL Enum
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:
HackTricks Training GCP Red Team Expert (GRTE)
Basic Information
Google Cloud SQL is a managed service that simplifies setting up, maintaining, and administering relational databases like MySQL, PostgreSQL, and SQL Server on Google Cloud Platform, removing the need to handle tasks like hardware provisioning, database setup, patching, and backups.
Key features of Google Cloud SQL include:
Fully Managed: Google Cloud SQL is a fully-managed service, meaning that Google handles database maintenance tasks like patching, updates, backups, and configuration.
Scalability: It provides the ability to scale your database's storage capacity and compute resources, often without downtime.
High Availability: Offers high availability configurations, ensuring your database services are reliable and can withstand zone or instance failures.
Security: Provides robust security features like data encryption, Identity and Access Management (IAM) controls, and network isolation using private IPs and VPC.
Backups and Recovery: Supports automatic backups and point-in-time recovery, helping you safeguard and restore your data.
Integration: Seamlessly integrates with other Google Cloud services, providing a comprehensive solution for building, deploying, and managing applications.
Performance: Offers performance metrics and diagnostics to monitor, troubleshoot, and improve database performance.
Password
In the web console Cloud SQL allows the user to set the password of the database, there also a generate feature, but most importantly, MySQL allows to leave an empty password and all of them allows to set as password just the char "a":
![](https://cloud.hacktricks.xyz/~gitbook/image?url=https%3A%2F%2F430239558-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F5uvPQhxNCPYYTqpRwsuS%252Fuploads%252FLgKluEBLcGQn0OVXGOCw%252Fimage.png%3Falt%3Dmedia%26token%3D86f6bf07-e2fa-4ea6-be3a-fe24ccc3be3a&width=768&dpr=4&quality=100&sign=dacafd2c&sv=1)
It's also possible to configure a password policy requiring length, complexity, disabling reuse and disabling username in password. All are disabled by default.
SQL Server can be configured with Active Directory Authentication.
Zone Availability
The database can be available in 1 zone or in multiple, of course, it's recommended to have important databases in multiple zones.
Encryption
By default a Google-managed encryption key is used, but it's also possible to select a Customer-managed encryption key (CMEK).
Connections
Private IP: Indicate the VPC network and the database will get an private IP inside the network
Public IP: The database will get a public IP, but by default no-one will be able to connect
Authorized networks: Indicate public IP ranges that should be allowed to connect to the database
Private Path: If the DB is connected in some VPC, it's possible to enable this option and give other GCP services like BigQuery access over it
![](https://cloud.hacktricks.xyz/~gitbook/image?url=https%3A%2F%2F430239558-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F5uvPQhxNCPYYTqpRwsuS%252Fuploads%252F6g2GznYtD8J3v0F9hVeK%252Fimage.png%3Falt%3Dmedia%26token%3De1c2fc0c-2c28-4d0d-8c25-1beb0a120b91&width=768&dpr=4&quality=100&sign=ac842b1d&sv=1)
Data Protection
Daily backups: Perform automatic daily backups and indicate the number of backups you want to maintain.
Point-in-time recovery: Allows you to recover data from a specific point in time, down to a fraction of a second.
Deletion Protection: If enabled, the DB won't be able to be deleted until this feature is disabled
Enumeration
Unauthenticated Enum
GCP - Cloud SQL Unauthenticated EnumPost Exploitation
GCP - Cloud SQL Post ExploitationPersistence
GCP - Cloud SQL PersistenceLearn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:
HackTricks Training GCP Red Team Expert (GRTE)
Last updated