| name | cis-azure-database-9.7 |
| description | Ensure that 'Auditing' Retention is 'greater than 90 days' |
| category | cis-azure-database |
| version | 2.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","sql-database","sql-server"] |
| cis_id | 9.7 |
| cis_benchmark | CIS Microsoft Azure Database Services Benchmark v2.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
9.7 Ensure that 'Auditing' Retention is 'greater than 90 days' (Automated)
Profile Applicability
Description
SQL Server Audit Retention should be configured to be greater than 90 days.
Rationale
Audit Logs can be used to check for anomalies and give insight into suspected breaches or misuse of information and access.
Impact
None documented.
Audit Procedure
Audit from Azure Portal
- Go to
SQL servers.
- For each server instance.
- Click on
Auditing.
- If storage is selected, expand
Advanced properties.
- Ensure
Retention (days) setting is greater than 90 days or 0 for unlimited retention.
Audit from PowerShell
Get the list of all SQL Servers:
Get-AzSqlServer
For each Server:
Get-AzSqlServerAudit -ResourceGroupName <resource group name> -ServerName <server name>
Ensure that RetentionInDays is set to more than 90.
Note: If the SQL server is set with LogAnalyticsTargetState setting set to Enabled, run the following additional command:
Get-AzOperationalInsightsWorkspace | Where-Object {$_.ResourceId -eq <SQL Server WorkSpaceResourceId>}
Ensure that RetentionInDays is set to more than 90.
Audit from Azure Policy
Policy ID: 89099bee-89e0-4b26-a5f4-165451757743
Name: 'SQL servers with auditing to storage account destination should be configured with 90 days retention or higher'
Expected Result
Retention (days) should be greater than 90 days or 0 for unlimited retention.
Remediation
Remediate from Azure Portal
- Go to
SQL servers.
- For each server instance.
- Click on
Auditing.
- If storage is selected, expand
Advanced properties.
- Set the
Retention (days) setting greater than days or for unlimited retention.