L7. Securing Azure SQL: Auditing, Platform Controls & Defender for Databases
Video generating
Check back soon for the video lesson on Securing Azure SQL: Auditing, Platform Controls & Defender for Databases
Course outlineLesson 7 of 18
Encryption at rest is table stakes; the real database security work is proving who touched what data, blocking the legacy SQL authentication path entirely, and catching the query pattern that looks like reconnaissance.
Platform-Level Security Configurations
Azure SQL Database and Azure SQL Managed Instance share several platform-enforced protections:
- Transparent Data Encryption (TDE): encrypts the data and log files at rest automatically, enabled by default, using either a Microsoft-managed key or a customer-managed key in Key Vault for organizations needing control over key rotation and revocation
- Always Encrypted: goes further than TDE by encrypting specific sensitive columns *client-side*, so even a database administrator with full access to the server never sees plaintext values, only ciphertext
- Dynamic Data Masking: obscures sensitive column data (like a full credit card number) from non-privileged query results in real time, without altering the stored data, useful for limiting exposure to support staff or reporting users who need query access but not the raw value
- Row-Level Security: restricts which rows a given user can see or modify, enforced by the database engine itself rather than relying on every application query to filter correctly
Authentication: Enforcing Microsoft Entra ID-Only
Azure SQL supports both SQL authentication (username/password local to the database) and Microsoft Entra ID authentication. Entra-only authentication can be enforced at the server level, disabling SQL authentication entirely, so every connection is tied to a centrally managed identity subject to Conditional Access, MFA, and PIM, rather than a separate local credential that lives outside the identity governance model entirely.
Network Protection
- Firewall rules at the server or database level restrict connecting IP ranges
- Private endpoints remove public endpoint exposure entirely, matching the same private-link pattern used for storage and Key Vault
- Microsoft Defender for SQL (part of Defender for Databases) adds Advanced Threat Protection: vulnerability assessment scans for risky configurations and missing patches, and threat detection alerts on suspicious activity like potential SQL injection or brute-force login attempts
Configuring Auditing
Azure SQL auditing tracks database events (logins, schema changes, query execution depending on configured categories) and writes them to one or more destinations:- Azure Storage account (long-term retention, lowest cost)
- Log Analytics workspace (enables KQL querying and Sentinel integration)
- Event Hub (for streaming to a third-party SIEM)
Audit logs are what satisfy the "who accessed or changed this data, and when" requirement common to compliance frameworks like PCI DSS or SOC 2, and are typically configured at the server level so every database inherits the same policy automatically.
Defender for Databases Coverage
Defender for Databases protects more than just Azure SQL:
| Service | Protected by |
|---|---|
| Azure SQL Database / Managed Instance | Defender for SQL |
| SQL Server on Azure VMs / on-premises (via Arc) | Defender for SQL servers on machines |
| Azure Cosmos DB | Defender for Cosmos DB |
| Open-source relational databases (PostgreSQL, MySQL, MariaDB) | Defender for open-source relational databases |
- ✓TDE encrypts data at rest transparently; Always Encrypted encrypts specific columns client-side so even a full-access DBA never sees plaintext
- ✓Dynamic Data Masking obscures sensitive values in query results in real time without changing stored data, but does not stop a privileged principal from bypassing it
- ✓Enforcing Microsoft Entra ID-only authentication disables legacy SQL authentication, bringing every connection under Conditional Access, MFA, and PIM
- ✓Azure SQL auditing can write to a storage account, Log Analytics workspace, or Event Hub, with Log Analytics enabling Sentinel integration
- ✓Defender for Databases covers Azure SQL, SQL Server on VMs/on-premises via Arc, Cosmos DB, and open-source relational engines as separate, independently-enabled plans
1. A compliance requirement states that database administrators, despite having full administrative access to the SQL server, must never be able to view plaintext national ID numbers stored in a specific column. Which feature satisfies this?
2. An organization wants to guarantee that every connection to its Azure SQL Database is authenticated through Microsoft Entra ID, with no local SQL login path remaining as a bypass. What should be configured?
3. A security team wants their Azure SQL audit logs to be queryable with KQL and correlated with other signals in Microsoft Sentinel. Which auditing destination should they choose?
Recommended: Pluralsight
This free course covers the theory. Pluralsight adds structured Cloud and AI Security Engineer learning paths, hands-on Azure and Defender for Cloud labs, and timed practice exams to make it stick before exam day.