> 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/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/azure-sql-database-with-auditing-retention-less-than-90-days.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# Azure SQL Database with Auditing Retention less than 90 days

### Synopsis

| Field               | Value                                                        |
| ------------------- | ------------------------------------------------------------ |
| Rule Type           | Detection                                                    |
| Finding Type        | Azure SQL Database with Auditing Retention less than 90 days |
| Finding ID          | 60000082                                                     |
| Generates a Finding | This detection rule also generates a finding                 |
| Severity            | Informational                                                |
| Category            | CONFIGURATION                                                |
| Cloud Providers     | AZURE                                                        |
| Platform Module     | CSPM                                                         |
| Asset Types         | AZURE\_SQL\_DATABASE                                         |

### Description

Azure SQL Databases with auditing retention periods shorter than 90 days present a significant security risk. Insufficient audit log retention hinders effective investigation of security incidents and compliance violations.

Azure SQL Database auditing logs activity within the database. A short retention period limits the window for detecting and responding to malicious activity such as data breaches or unauthorized access. Attackers could exploit this by remaining undetected for extended periods, potentially exfiltrating sensitive data before their actions are discovered.

Compromised audit logs severely hamper incident response and forensic analysis. Maintaining at least 90 days of audit data allows security teams to thoroughly investigate suspicious events, identify attack vectors, and implement effective remediation strategies. This aligns with regulatory requirements and best practices for maintaining a robust security posture.

To mitigate this risk, ensure all Azure SQL Databases have an audit retention policy of at least 90 days. Disable database-level auditing, relying instead on server-level auditing to maintain a comprehensive audit trail. Regularly review and adjust retention policies based on organizational needs and regulatory compliance mandates.

### Remediation

If server auditing is enabled, it always applies to the database. The database will be audited, regardless of the database auditing settings. It is recommended that you enable only server-level auditing setting and leave the database-level auditing disabled for all databases.

To configure the Server level audit setting:

1. Log in to the Azure Portal
2. Go to SQL servers
3. Choose the reported each DB server
4. Select 'Auditing', and verify that 'Enable Azure SQL Auditing' is set
5. If Storage is selected, expand 'Advanced properties'
6. Set the Retention (days) setting is greater than 90 days or 0 for unlimited retention.

   Note: The default value for the retention period is 0 (unlimited retention).
7. Click on 'Save'

It is recommended to avoid enabling both server auditing and database blob auditing together, unless; If you want to use a different storage account, retention period or Log Analytics Workspace for a specific database or want to use for audit event types or categories for a specific database that differ from the rest of the databases on the server.

To configure the Database level audit setting:

1. Log in to the Azure Portal
2. Go to SQL databases
3. Choose the reported each DB
4. Select 'Auditing', and verify that 'Enable Azure SQL Auditing' is set
5. If Storage is selected, expand 'Advanced properties'
6. Set the Retention (days) setting is greater than 90 days or 0 for unlimited retention.

   Note: The default value for the retention period is 0 (unlimited retention).
7. Click on 'Save'


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/azure-sql-database-with-auditing-retention-less-than-90-days.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
