🛡️ Google Cloud SQL Instance IAM Database Authentication is not enabled🟢
- Contextual name: 🛡️ Cloud SQL Instance IAM Database Authentication is not enabled🟢
- ID:
/ce/ca/google/sql/instance-iam-database-authentication - Tags:
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logic
Description
Description
This policy checks whether IAM database authentication is enabled for Google Cloud SQL for MySQL and PostgreSQL instances. IAM database authentication allows users and applications to authenticate with IAM principals and short-lived tokens instead of static database passwords.
Rationale
IAM database authentication centralizes access control in Google Cloud IAM and reduces the need to distribute and rotate static database passwords. It also improves attribution because database access can be tied to user accounts and service accounts.
Impact
Applications and users may need connection changes to use IAM database authentication. Existing password-based database users should be reviewed and migrated carefully to avoid service interruption.
Audit
This policy flags a Google Cloud SQL Instance as
INCOMPLIANTwhen the instance is a MySQL or PostgreSQL instance and IAM database authentication is not enabled.For PostgreSQL instances, the
cloudsql.iam_authenticationdatabase flag must be set toon.... see more
Remediation
Remediation
From Google Cloud CLI
For PostgreSQL instances, enable IAM database authentication:
gcloud sql instances patch {{instance-name}} \
--database-flags=cloudsql.iam_authentication=onFor MySQL instances, enable IAM database authentication:
gcloud sql instances patch {{instance-name}} \
--database-flags=cloudsql_iam_authentication=onNote: Setting database flags with
gcloud sql instances patchcan overwrite existing flags. Include all existing database flags that must remain configured.Create IAM-authenticated database users as needed:
gcloud sql users create {{principal}} \
--instance={{instance-name}} \
--type=CLOUD_IAM_USERGrant required database privileges and Google Cloud IAM roles, including
roles/cloudsql.clientandroles/cloudsql.instanceUser, to the connecting principals.Test application and user connections before removing password-based access.
policy.yaml
Linked Framework Sections
| Section | Sub Sections | Internal Rules | Policies | Flags | Compliance |
|---|---|---|---|---|---|
| 💼 CIS GCP v5.0.0 → 💼 6.6 Ensure Cloud SQL Database Instances Have IAM Database Authentication Enabled - Level 1 (Manual) | 1 | no data | |||
| 💼 Cloudaware Framework → 💼 Secure Access | 61 | no data |