Skip to main content

Security Controls Comparison

TDE, Always Encrypted, RLS, DDM, Auditing — five features, five different problems. This page makes it clear what each one does, what it doesn't do, and when to use them together.

For detailed configuration, see Encryption & Network Security and Authentication & Authorization.


The Matrix

FeatureWhat It ProtectsEncryption?Who Can Still See Data?Azure SQL DBMIVMExam Weight
TDEData at rest (files, backups)✅ AES-256Anyone with DB access (decrypted transparently)✅ ON by default🎯 High
Always EncryptedSpecific columns (in use)✅ Client-sideNot even the DBA or SQL engine🎯 High
RLSRow-level accessOnly rows matching your predicate🎯 High
DDMColumn display (masking)Users with UNMASK permission🎯 Medium
AuditingActivity tracking (who did what)Auditors reviewing logs🎯 High

What Problem Does Each Solve?

Threat / ProblemFeatureHow It Helps
Stolen database files or backupsTDEFiles are encrypted — useless without the key
DBA shouldn't see salary/SSN dataAlways EncryptedData encrypted before reaching SQL engine — DBA sees ciphertext
Tenant A shouldn't see Tenant B's dataRLSFilter predicate hides rows per user/tenant
Support staff shouldn't see full credit card numbersDDMShows XXXX-XXXX-XXXX-4321 instead of full number
"Who deleted those records?"AuditingLogs every query, login, schema change to storage/Log Analytics
Compliance requirement for encryption at restTDESatisfies encryption-at-rest checkbox
Compliance requirement for column-level encryptionAlways EncryptedColumn never exists in plaintext on server
GDPR "right to know who accessed my data"AuditingFull access trail per user per query

Where Does Encryption Happen?

FeatureEncrypted Where?Decrypted Where?Key Location
TDEStorage layer (data files, log, backups)SQL engine (transparent to queries)Server certificate or Azure Key Vault
Always EncryptedClient app (before sending to SQL)Client app (after receiving from SQL)Client-side key store (Key Vault, cert store)
TLS 1.2Network (in transit)SQL engine / clientCertificate on server
🎯 Exam Focus

The critical distinction: TDE encrypts data at rest — anyone who can query the database sees plaintext (decryption is transparent). Always Encrypted encrypts data in use — even the DBA and SQL engine see only ciphertext. TDE protects stolen files. Always Encrypted protects from privileged users.


Who Can Still See the Data?

RoleTDEAlways EncryptedRLSDDM
DBA / sysadmin✅ Sees plaintext❌ Sees ciphertext✅ Sees all rows (unless filtered)✅ Sees unmasked
App with correct keys✅ Sees plaintextDepends on predicate✅ Sees unmasked
App without keys❌ Ciphertext onlyDepends on predicateSees masked
User with UNMASKDepends on predicate✅ Sees unmasked
User without UNMASKFiltered rows onlySees masked
Someone with stolen .mdf file❌ Encrypted❌ EncryptedN/AN/A
Azure platform admin❌ (with BYOK)N/AN/A
⚠️ Watch Out

DDM is not security — it's obfuscation. Users with SELECT permission and UNMASK can see full data. Users can also infer values through WHERE clauses (e.g., WHERE SSN = '123-45-6789'). DDM prevents casual viewing, not determined access.


Configuration Complexity

FeatureSetup EffortOngoing MaintenanceImpact on Queries
TDE1 min (ON by default in Azure)None (auto key rotation with service-managed)Zero — completely transparent
Always EncryptedHigh (client driver changes, key management)Key rotation requires planningCan't use WHERE, JOIN, ORDER BY on encrypted columns (deterministic exception)
RLSMedium (write predicate function + policy)Update predicate when tenant model changesSlight overhead on every query
DDMLow (ALTER TABLE ADD MASKING)Minimal — masks are declarativeZero overhead
AuditingLow (enable in portal)Storage management, log reviewMinimal overhead (< 5%)

Always Encrypted: Deterministic vs Randomized

Encryption TypeAllows Equality Checks?Allows Range/LIKE?Use For
DeterministicWHERE col = @valueColumns you need to search (SSN, email)
RandomizedColumns you only display (salary, notes)
🎯 Exam Focus

Deterministic Always Encrypted allows equality comparisons (=, IN, GROUP BY, JOIN) because the same plaintext always produces the same ciphertext. Randomized doesn't allow any server-side operations — it's more secure but less functional.


Common Combinations

CombinationWhat It Achieves
TDE + AuditingStandard compliance baseline — encryption at rest + full audit trail
TDE + RLSMulti-tenant isolation with encrypted storage
TDE + Always EncryptedAt-rest encryption + column-level protection from privileged users
RLS + DDMRow filtering + column masking for defense-in-depth
TDE + RLS + DDM + AuditingFull security stack for regulated industries
Always Encrypted + AuditingSensitive column protection + activity tracking
🏢 Real-World DBA Note

Most production deployments use: TDE (on by default) + Auditing (compliance requirement) + RLS (if multi-tenant). Always Encrypted is used selectively for the most sensitive columns (SSN, payment data) because of its query limitations.


Common Exam Traps

TrapReality
"TDE protects data from DBAs"❌ TDE is transparent — DBAs see plaintext. Use Always Encrypted to protect from DBAs.
"DDM prevents data access"❌ DDM only prevents casual viewing. UNMASK permission or inference attacks bypass it.
"Always Encrypted works with all queries"❌ Only deterministic encryption allows equality checks. No LIKE, no range queries, no ORDER BY.
"RLS protects data at rest"❌ RLS is a query-time filter. Someone with file access bypasses it entirely. Combine with TDE.
"Auditing prevents attacks"❌ Auditing detects and logs — it doesn't prevent. It's for accountability, not access control.
"TDE needs to be turned on manually in Azure SQL DB"❌ TDE is ON by default in Azure SQL DB. You only need to act if using BYOK (customer-managed key).

Decision Guide

"I need to..."Use This
Encrypt the entire database at restTDE (already on)
Prevent the DBA from reading salary dataAlways Encrypted
Show different data to different tenantsRLS
Hide credit card digits from support staffDDM
Track who accessed what and whenAuditing
Use my own encryption key (not Microsoft's)TDE with BYOK via Key Vault
Protect data in transitTLS 1.2 (always on)
Satisfy PCI-DSS requirementsTDE + Always Encrypted + Auditing + RLS

Flashcards

What does TDE protect against?
Click to reveal answer
Stolen database files and backups. TDE encrypts data at rest with AES-256. It does NOT protect against authorized users querying the database — decryption is transparent.
1 / 8

Quiz

Q1/5
0 correct
A company needs to ensure that even their DBAs cannot read employee salary data stored in Azure SQL Database. Which feature should they use?