Azure Database SQL Server Database Vulnerability Assessment Rule Baseline
This page shows how to write Terraform and Azure Resource Manager for Database SQL Server Database Vulnerability Assessment Rule Baseline and write them securely.
azurerm_mssql_database_vulnerability_assessment_rule_baseline (Terraform)
The SQL Server Database Vulnerability Assessment Rule Baseline in Database can be configured in Terraform with the resource name azurerm_mssql_database_vulnerability_assessment_rule_baseline
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_mssql_database_vulnerability_assessment_rule_baseline" "this" {
baseline_name = var.baseline_name
database_name = var.database_name
rule_id = var.rule_id
server_vulnerability_assessment_id = var.server_vulnerability_assessment_id
resource "azurerm_mssql_database_vulnerability_assessment_rule_baseline" "this" {
baseline_name = var.baseline_name
database_name = var.database_name
rule_id = var.rule_id
server_vulnerability_assessment_id = var.server_vulnerability_assessment_id
Parameters
-
baseline_name
optional - string -
database_name
required - string -
id
optional computed - string -
rule_id
required - string -
server_vulnerability_assessment_id
required - string -
baseline_result
set block-
result
required - list of string
-
-
timeouts
single block
Explanation in Terraform Registry
Manages a Database Vulnerability Assessment Rule Baseline. -> NOTE Database Vulnerability Assessment is currently only available for MS SQL databases.
Tips: Best Practices for The Other Azure Database Resources
In addition to the azurerm_mariadb_firewall_rule, Azure Database has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
azurerm_mariadb_firewall_rule
Ensure database firewalls do not permit public access
It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.
azurerm_mariadb_server
Ensure that access to Azure SQL Database is restricted
It is better to disable public access to the database to avoid unwilling communications with unknown services if not required.
azurerm_mssql_database_extended_auditing_policy
Ensure to configure retention periods of database auditing to enough duration
It is better to configure retention periods of database auditing to enough duration. It would be better to set greater than at least 90 days.
azurerm_mssql_server
Ensure to enable auditing on Azure SQL databases
It is better to enable auditing on Azure SQL databases. It helps you maintain regulatory compliance, monitor the activities indicating unexpected incidents or suspected security violations.
azurerm_mssql_server_security_alert_policy
Ensure to configure at least one email address for threat alerts
It is better to configure at least one email address for threat alerts. SQL Server is able to send alerts for threat detection via emails and it could support us to notice the incident on time.
azurerm_mysql_firewall_rule
Ensure database firewalls do not permit public access
It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.
azurerm_mysql_server
Ensure to disable public access to database
It is better to disable public access to the database to avoid unwilling communications with unknown services if not required.
azurerm_postgresql_firewall_rule
Ensure database firewalls do not permit public access
It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.
azurerm_postgresql_server
Ensure to disable public access to database
It is better to disable public access to the database to avoid unwilling communications with unknown services if not required.
azurerm_sql_firewall_rule
Ensure database firewalls do not permit public access
It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.
azurerm_sql_server
Ensure to enable auditing on Azure SQL databases
It is better to enable auditing on Azure SQL databases. It helps you maintain regulatory compliance, monitor the activities indicating unexpected incidents or suspected security violations.
Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines (Azure Resource Manager)
The servers/databases/vulnerabilityAssessments/rules/baselines in Microsoft.Sql can be configured in Azure Resource Manager with the resource name Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Frequently asked questions
What is Azure Database SQL Server Database Vulnerability Assessment Rule Baseline?
Azure Database SQL Server Database Vulnerability Assessment Rule Baseline is a resource for Database of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Database SQL Server Database Vulnerability Assessment Rule Baseline?
For Terraform, the kevinhead/azurerm and niveklabs/azurerm source code examples are useful. See the Terraform Example section for further details.