Skip to main content

More Info:

MySQL Database Server should have enforce ssl connection enabled

Risk Level

Medium

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS AZURE
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • Cloudanix Best Practice
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • HIPAA
  • HITRUST CSF
  • ISO 27001
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST CSF
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • PCI
  • SOC2
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

Sure, here are the step-by-step instructions to remediate the MySQL Database Server Should Enforce SSL Connection misconfiguration in Azure using the Azure console:
  1. Log in to the Azure portal (https://portal.azure.com/).
  2. Navigate to the Azure Database for MySQL server that you want to remediate.
  3. Click on the “Connection security” option under the “Security” section in the left-hand menu.
  4. In the “Connection security” section, toggle the “Enforce SSL connection” option to “Enabled”.
  5. Click the “Save” button at the top of the page to save the changes.
  6. Once the changes are saved, the MySQL database server will now enforce SSL connections.
That’s it! By following these steps, you have successfully remediated the MySQL Database Server Should Enforce SSL Connection misconfiguration in Azure using the Azure console.

To remediate the MySQL Database Server Should Enforce SSL Connection misconfiguration in Azure using Azure CLI, you can follow the below steps:
  1. Open the Azure CLI and log in to your Azure account using the command az login.
  2. Once you are logged in, select the Azure subscription that contains your MySQL database by using the command az account set --subscription <subscription_id>.
  3. Next, retrieve the resource ID of your MySQL server using the command az mysql server list --resource-group <resource_group_name> --query [0].id --output tsv.
  4. Now, enable SSL enforcement for the MySQL server by running the command az mysql server update --resource-group <resource_group_name> --name <mysql_server_name> --ssl-enforcement Enabled.
  5. Finally, verify that SSL enforcement is enabled by running the command az mysql server show --resource-group <resource_group_name> --name <mysql_server_name> --query sslEnforcement.
If the output of the above command is “Enabled”, then SSL enforcement has been successfully enabled for your MySQL server in Azure.
To remediate the misconfiguration of MySQL Database Server Should Enforce SSL Connection in AZURE, you can follow the below steps using Python:
  1. First, you need to install the ‘azure-mgmt-rdbms’ package. You can install it using the following command:
  1. Next, you need to authenticate to your Azure account. You can use the following code to authenticate:
  1. After authentication, you need to create a client object for the Azure Database for MySQL server. You can use the following code to create the client object:
  1. Once you have the client object, you can update the server configuration to enforce SSL connection. You can use the following code to update the server configuration:
  1. Finally, you can verify if the SSL connection is enforced by checking the server configuration. You can use the following code to check the server configuration:
That’s it! You have successfully remediated the misconfiguration of MySQL Database Server Should Enforce SSL Connection in Azure using Python.
Changing ssl_enforcement_enabled from false to true is an in-place update and does not force replacement of the server.To verify, terraform plan should show a single in-place change on this resource, with ssl_enforcement_enabled changing from false (or null) to true.