Skip to main content

Encryption & Network Security

For a quick comparison of all security features (TDE vs Always Encrypted vs RLS vs DDM vs Auditing), see the Security Controls Comparison.

Encryption Layers — The Complete Picture

Three States of Encryption
💾
At Rest — TDE
Encrypts data files, log files, and backups with AES-256. Enabled by default on Azure SQL DB.
🌐
In Transit — TLS
All connections encrypted with TLS 1.2+. Enforced by default. Protects against network sniffing.
🔐
In Use — Always Encrypted
Column-level client-side encryption. DB engine never sees plaintext. Even DBAs can't read data.
🎯 Exam Focus

Memorize the three states: At rest → TDE, In transit → TLS, In use → Always Encrypted. This is the most tested encryption framework on DP-300.

Transparent Data Encryption (TDE)

Encrypts data at rest — database files, backups, and transaction logs.

AspectDetails
AlgorithmAES-256
Enabled by default✅ Yes, on Azure SQL Database
Performance impact~3-5% (minimal)
What's encrypted.mdf, .ndf, .ldf files, and backup .bak files
Key managementService-managed key (default) or BYOK via Key Vault
GranularityEntire database (you can't encrypt selectively)

TDE Key Hierarchy

TDE Key Hierarchy
🔑
TDE Protector
Service-managed key (default) or BYOK via Key Vault
Top-level key that protects everything below
🔐
Database Encryption Key (DEK)
Per-database AES-256 key
Encrypted by the TDE Protector
💾
Encrypted Data
Data files (.mdf/.ndf), log files (.ldf)
Backup files (.bak) — all encrypted transparently
🏢 Real-World DBA Note

Oracle DBA parallel: Azure TDE = Oracle TDE, but simpler. Oracle TDE requires wallet creation, ALTER TABLESPACE ENCRYPT, per-tablespace setup. Azure TDE is always on and encrypts the entire database automatically. The BYOK option maps to Oracle's external keystore.

⚠️ Watch Out

TDE encrypts backups too! If you restore a TDE-encrypted backup to another server, you need access to the same TDE protector key. With service-managed keys, Azure handles this. With BYOK (Key Vault), the target server must have access to the same Key Vault key.

Always Encrypted

Encrypts sensitive columns — data is encrypted by the client application. The SQL engine never sees plaintext.

Architecture

Always Encrypted — Data Flow
📱
Client App
App has access to Column Master Key (CMK)
ADO.NET / JDBC driver handles encryption
🔒
Encrypt on Client
Driver encrypts plaintext values before sending
Uses Column Encryption Key (CEK)
🗄️
SQL Server Stores Ciphertext
Database only sees encrypted bytes
Even DBAs cannot read the data
🔓
Decrypt on Client
Driver decrypts on retrieval
Plaintext only exists in client memory

Encryption Types

TypeSame input →Can query with = ?Can JOIN?Security Level
DeterministicSame ciphertextGood
RandomizedDifferent ciphertext each timeBest

Key Hierarchy

ComponentStored WherePurpose
Column Master Key (CMK)Key Vault / Windows Cert StoreProtects the CEK
Column Encryption Key (CEK)Inside the database (encrypted form)Actually encrypts column data
⚠️ Watch Out

Always Encrypted limitations: No LIKE queries, no range comparisons (>, <), no computed columns referencing encrypted columns, no server-side operations on encrypted data. The client driver handles all crypto — the server only stores/retrieves ciphertext.

🎯 Exam Focus

When to choose Always Encrypted vs TDE: TDE protects against stolen disk/backups (physical theft). Always Encrypted protects against even DBAs seeing sensitive data. If the question says "DBAs should not see SSN/credit cards" → Always Encrypted. If it says "encrypt data at rest" → TDE.

Network Security — Defense in Depth

Security Architecture - Defense in Depth

Connectivity Options (Most → Least Secure)

OptionTraffic PathExam Scenario
Private EndpointPrivate IP in your VNet → Azure backbone"Most secure" / "no public internet"
VNet Service EndpointSubnet → Azure backbone (but IP is still public)"Restrict to specific subnet"
Firewall RulesPublic IP allowlist"Allow specific client IPs"
Allow Azure Services (0.0.0.0)Any Azure service can connect⚠️ "Allow Azure services" toggle — overly broad for production
🎯 Exam Focus

If the exam says "no data should traverse the public internet" → the answer is Private Endpoint. VNet Service Endpoints still use a public IP (traffic goes over the Azure backbone, but the endpoint is technically public). Private Endpoint assigns a truly private IP inside your VNet.

Private Endpoint Architecture

Private Endpoint Architecture
🏠
Your VNet
Private Endpoint creates a NIC with a private IP (e.g., 10.0.1.5) inside your subnet
🔗
Azure Private Link
Traffic flows over Azure backbone via Private Link. Never traverses the public internet.
🗄️
Azure SQL Server
Public endpoint can be disabled entirely. Only accessible via private IP in your VNet.
⚠️ Watch Out

When using Private Endpoints, also disable public access on the SQL Server. Otherwise, the database is accessible via both private AND public endpoints. Disable public access via the "Public network access" setting = Disabled.

Auditing — Where Do Logs Go?

DestinationUse CaseRetention
Log AnalyticsKQL queries, Azure Monitor integration, dashboardsConfigurable (30-730 days)
Storage AccountLong-term archival, complianceUnlimited
Event HubReal-time streaming to SIEM (Sentinel, Splunk)Streaming (no built-in retention)
🏢 Real-World DBA Note

Best practice: Send audit logs to Log Analytics for querying + Storage Account for compliance archival. Use Event Hub only if you have a SIEM that needs real-time feed. This mirrors Oracle Unified Audit → Oracle Audit Vault + AVDF pattern.

Microsoft Defender for SQL

FeatureWhat It Does
Vulnerability AssessmentScans for misconfigurations (weak passwords, excessive permissions)
Advanced Threat ProtectionDetects SQL injection, anomalous access, brute force attacks
Data ClassificationDiscovers and labels sensitive data (PII, financial, health)
🎯 Exam Focus

Defender for SQL combines all three features. If the exam asks about "detecting SQL injection attempts" → Advanced Threat Protection. "Finding unencrypted sensitive columns" → Data Classification. "Checking for security misconfigurations" → Vulnerability Assessment.


Flashcards

What does TDE encrypt?
Click to reveal answer
Data at rest — database files (.mdf/.ndf), log files (.ldf), and backups (.bak)
1 / 6

Quiz

Q1/3
0 correct
Which encryption feature protects data at rest including backup files?