Overview
Enable Transparent Data Encryption on every SQL server.
Rationale
Azure SQL Database transparent data encryption helps protect against the threat of malicious activity by performing real-time encryption and decryption of the database, associated backups, and transaction log files at rest without requiring changes to the application.
Default Value
By default, Data encryption is set to On.
Additional Information
- Transparent Data Encryption (TDE) can be enabled or disabled on individual
SQL Databaselevel and not on theSQL Serverlevel. - TDE cannot be used to encrypt the logical master database in SQL Database. The master database contains objects that are needed to perform the TDE operations on the user databases.
References
- https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption-with-azure-sql-database
- https://learn.microsoft.com/en-us/security/benchmark/azure/security-controls-v3-data-protection#dp-4-enable-data-at-rest-encryption-by-default
- https://learn.microsoft.com/en-us/powershell/module/az.sql/set-azsqldatabasetransparentdataencryption?view=azps-9.2.0
Remediation guidance
Remediate from Azure Portal
- Go to
SQL databases - For each DB instance, under
Security, clickData Encryption - Under
Transparent data encryption, setData encryptiontoOn - Click
Save
Remediate from Azure CLI
Use the below command to enable Transparent data encryption for SQL DB instance.
az sql db tde set --resource-group <resourceGroup> --server <dbServerName> --database <dbName> --status Enabled
Remediate from PowerShell
Use the below command to enable Transparent data encryption for the SQL DB instance.
Set-AzSqlDatabaseTransparentDataEncryption -ResourceGroupName <rg_name> -ServerName -DatabaseName -State 'Enabled'
Note
-
TDE cannot be used to encrypt the logical master database in SQL Database. The master database contains objects that are needed to perform the TDE operations on the user databases.
-
Azure Portal does not show master databases per SQL server. However, CLI/API responses will show master databases.
Service-wide remediation
Recommended when many resources are affected: fix the platform baseline first so new resources inherit the secure setting, then remediate the existing flagged resources in batches.
Azure
Use management group or subscription Azure Policy assignments, remediation tasks where supported, landing-zone standards, and IaC modules so drift is prevented at scale.
Operational rollout
- Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
- Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
- Re-scan and track approved exceptions with an owner and expiry date.
Query logic
These are the stored checks tied to this control.
'Data encryption' is set to 'On' on a SQL Database
Connectors
Covered asset types
Expected check: eq []
{sqlDatabases(where: {encrypted: false}){...AssetFragment}}
Microsoft Azure