π Google Cloud MySQL Instance allows anyone to connect with administrative privileges π’
- Contextual name: π MySQL Instance allows anyone to connect with administrative privileges π’
- ID:
/ce/ca/google/sql/mysql-instance-allows-administrative-access
- Located in: π Google Cloud SQL
Flagsβ
- π’ Impossible policy
- π’ Policy with categories
- π’ Policy with type
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
Descriptionβ
Descriptionβ
It is recommended to set a password for the administrative user (
root
by default) to prevent unauthorized access to the SQL database instances.This recommendation is applicable only for MySQL Instances. PostgreSQL does not offer any setting for No Password from the cloud console.
Rationaleβ
At the time of MySQL Instance creation, not providing an administrative password allows anyone to connect to the SQL database instance with administrative privileges. The root password should be set to ensure only authorized users have these privileges.
Impactβ
Connection strings for administrative clients need to be reconfigured to use a password.
Auditβ
From Google Cloud CLIβ
List All SQL database instances of type MySQL:
gcloud sql instances list --filter='DATABASE_VERSION:MYSQL* --project <project_id> --format="(NAME,PRIMARY_ADDRESS)"'
For every MySQL instance try to connect using the
PRIMARY_ADDRESS
, if available:mysql -u root -h <mysql_instance_ip_address>
The command should return either an error message or a password prompt.
... see more
Remediationβ
Remediationβ
From Google Cloud Consoleβ
- Go to the Cloud SQL Instances page in the Google Cloud Platform Console using https://console.cloud.google.com/sql/
- Select the instance to open its Overview page.
- Select
Access Control > Users
.- Click the
More actions icon
for the user to be updated.- Select
Change password
, specify aNew password
, and clickOK
.From Google Cloud CLIβ
Set a password to a MySql instance:
gcloud sql users set-password root --host=<host> --instance=<instance_name> --prompt-for-password
A prompt will appear, requiring the user to enter a password:
Instance Password:
With a successful password configured, the following message should be seen:
Updating Cloud SQL user...done.
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ CIS GCP v3.0.0 β πΌ 6.1.1 Ensure That a MySQL Database Instance Does Not Allow Anyone To Connect With Administrative Privileges - Level 1 (Manual) | 1 | |||
πΌ Cloudaware Framework β πΌ Secure Access | 43 |