> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/monitoring/appsec2-azure-13.md).

# Azure SQL server Defender setting is set to Off misconfiguration detected in code

## Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC2\_AZURE\_13                   |
| Category - Subcategory | Monitoring - Unintegrated            |
| Provider               | AZURE                                |
| Severity               | LOW                                  |
| Framework              | Terraform, Terraform Plan            |
| Mapped CSPM/KSPM Rule  | d7d19f58-2868-47a1-9ed6-63bf8074770d |

## Impact

Azure Defender for SQL provides a new layer of security, which enables customers to detect and respond to potential threats as they occur by providing security alerts on anomalous activities. Users will receive an alert upon suspicious database activities, potential vulnerabilities, SQL injection attacks, as well as anomalous database access patterns. Advanced threat protection alerts provide details of suspicious activity and recommend action on how to investigate and mitigate the threat.

## How to Fix

*Resource:* azurerm\_sql\_server, azurerm\_mssql\_server\_security\_alert\_policy

* *Arguments:* server\_name (of *azurerm\_mssql\_server\_security\_alert\_policy* ) \[source,go]

***

{ "resource "azurerm\_sql\_server" "sql\_server\_good\_1" { name = "mysqlserver" resource\_group\_name = "group" location = "location" version = "12.0" administrator\_login = "4dm1n157r470r" administrator\_login\_password = "4-v3ry-53cr37-p455w0rd" }

resource "azurerm\_sql\_server" "sql\_server\_good\_2" { name = "mysqlserver" resource\_group\_name = "group" location = "location" version = "12.0" administrator\_login = "4dm1n157r470r" administrator\_login\_password = "4-v3ry-53cr37-p455w0rd" }

resource "azurerm\_mssql\_server\_security\_alert\_policy" "alert\_policy\_good" { resource\_group\_name = "group" server\_name = azurerm\_sql\_server.sql\_server\_good\_1.name state = "Enabled" retention\_days = 20 }

## ", }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/monitoring/appsec2-azure-13.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
