Azure Database for MySQL server not configured with private endpoint misconfiguration detected in co
Rule Details
Cortex AppSec Rule ID
APPSEC2_AZURE_44
Category - Subcategory
Public Exposure - VPC VCN VNet
Provider
AZURE
Severity
MEDIUM
Framework
Terraform, Terraform Plan
Mapped CSPM/KSPM Rule
bd6e2410-2f98-4d6d-a24d-7484c0407113
Impact
This rule checks whether Azure MySQL database servers are configured with private endpoints. Private endpoint connections are essential for ensuring secure communication, establishing exclusive, private connectivity to Azure Database for MySQL. Configuring a private endpoint ensures access only from recognized networks, preventing entry from potentially malicious or unknown IP addresses, including those within Azure. It is recommended to establish a private endpoint to enhance the security of communication for your Azure MySQL database.
How to Fix
Resource: azurerm_mysql_server, azurerm_private_endpoint
Arguments: private_connection_resource_id
To fix this issue and establish secure communication with your network, configure your Azure MySQL server with a private endpoint.
This code enhances Azure MySQL server security by enabling a private endpoint connection. The private endpoint allows secure connections between your virtual network and the service, traversing exclusively over the Azure network. This prevents exposure to the public internet, and helps to reduce the threat of data leakage and external threats. [source,go]
resource "azurerm_mysql_server" "example" { name = "example-mysql-server" //... }
resource "azurerm_private_endpoint" "example" { name = "example-private-endpoint" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name subnet_id = azurerm_subnet.example.id
private_service_connection { name = "example-privateserviceconnection" private_connection_resource_id = azurerm_mysql_server.example.id subresource_name = "mysqlServer" is_manual_connection = false } }
Last updated
Was this helpful?
