Triage and Remediation
Remediation
Using Console
Using Console
To remediate the short auditing retention period for SQL databases in AZURE using the AZURE console, follow these steps:
- Log in to the AZURE portal and navigate to the SQL server that needs to be remediated.
- Click on the “Auditing” tab from the left-hand menu.
- Under the “Auditing” tab, click on the “Diagnostic settings” option.
- Click on the “Edit setting” option to modify the diagnostic settings.
- Under the “Retention (days)” option, increase the retention period to a value that meets your organization’s compliance requirements.
- Click on the “Save” button to save the changes.
- Once the changes are saved, you will receive a notification that the diagnostic settings have been updated successfully.
Using CLI
Using CLI
To remediate the short auditing retention period for SQL databases in Azure using Azure CLI, follow these steps:
-
Open the Azure CLI and login to your Azure account using the command:
-
Once you are logged in, select the subscription that contains the SQL database you want to remediate using the command:
Replace
<subscription-id>
with the ID of the subscription that contains the SQL database. -
Check the current auditing retention period for the SQL database using the command:
Replace
<database-name>
,<resource-group-name>
, and<server-name>
with the name of the SQL database, the resource group it belongs to, and the name of the server that hosts the database. -
If the retention period is less than the required duration, remediate it by setting the retention period to the required duration using the command:
Replace
<database-name>
,<resource-group-name>
, and<server-name>
with the name of the SQL database, the resource group it belongs to, and the name of the server that hosts the database. Replace<retention-period>
with the required retention period in days. - Verify that the retention period has been updated by running the command in step 3 again.
Using Python
Using Python
To remediate the short auditing retention period for SQL databases in Azure, you can use the following steps in Python:These steps will remediate the short auditing retention period for the specified SQL database in Azure.
- Import the required modules:
- Set up the credentials to authenticate with Azure:
- Instantiate the SQL Management client:
- Get the SQL server and database you want to remediate:
- Check the current auditing retention period for the database:
- Set the new auditing retention period for the database (e.g. 90 days):
- Verify that the new auditing retention period has been set: