feat(query): implements "Beta - SQL Database Without Data Encryption" #7858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.








Reason for Proposed Changes
Currently there is no query to ensure that resources of type "azurerm_mssql_database" have data encryption enabled.
Quoting CIS_Microsoft_Azure_Database_Services_Benchmark_v1.0.0 page 93: "
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.".Proposed Changes
Implemented the missing query.
The query will flag if a "
azurerm_mssql_database" resource sets the "transparent_data_encryption_enabled" field tofalse.Note - legacy "azurerm_sql_database" resources do not support this feature; additionally a query that are also related to sql databases only support said outdated resource and not the new "
azurerm_mssql_database", it is the "SQL Database Audit Disabled".Same for the "azurerm_postgresql_server" with the newer "azurerm_postgresql_flexible_server". At least one query is affected : "Geo Redundancy Is Disabled", 3 others queries check for "azurerm_postgresql_server" resources but the target fields are not present in the replacement "flexible server".
I submit this contribution under the Apache-2.0 license.