Skip to main content

Compliance Controls & Advanced Security

Security Feature Architecture Map​

Security Feature Map
πŸ’Ύ
TDE (At Rest)
Encrypts entire database files + backups with AES-256. Always on by default.
πŸ”
Always Encrypted (In Use)
Client-side column encryption. DB engine never sees plaintext.
🎭
Dynamic Data Masking
Masks sensitive data in query output. Presentation-layer only.
πŸ”’
Row-Level Security
Filter predicate controls which rows users can access per tenant.
πŸ“
Data Classification
Discovers and labels sensitive columns. Integrates with auditing.
πŸ›‘οΈ
Defender for SQL
Vulnerability assessment + threat protection (SQL injection, anomalies).

Data Classification​

Discovers, labels, and protects sensitive data columns.

LabelExample DataSensitivity
PublicProduct names, categoriesLow
GeneralEmployee names, departmentMedium
ConfidentialEmail addresses, phone numbersHigh
Highly ConfidentialSSN, credit card, medical recordsCritical

How it works:

  1. Azure SQL scans columns using built-in patterns (SSN, credit card, email, etc.)
  2. Recommends classifications β†’ you accept or customize
  3. Labels are stored as extended properties on columns
  4. Integrated with auditing β€” queries on classified data are logged with sensitivity labels
🎯 Exam Focus

Data Classification is informational β€” it does NOT enforce access control. It works with Auditing to track who accessed sensitive data. For enforcement, combine with RLS (row filtering) or Dynamic Data Masking (column masking).

Always Encrypted with VBS Enclaves​

Full coverage β€” enable order, key hierarchy, attestation, in-place encryption, troubleshooting β€” lives on the dedicated Always Encrypted with VBS Enclaves page. Don't memorize it twice.

One-line decision: "Need LIKE / range / ORDER BY on encrypted columns" β†’ AE with VBS enclaves. Standard AE = equality only.

Database Ledger​

Provides tamper-proof audit trail using cryptographic hashing. Proves data hasn't been modified.

Database Ledger β€” Tamper-Proof Audit
πŸ“
DML Operation
INSERT, UPDATE, or DELETE on ledger table
Change is recorded alongside data
πŸ”—
Cryptographic Hash
Each transaction gets a SHA-256 hash
Hash chain links to previous transaction
πŸ“œ
Digest Storage
Hash digest stored externally (Azure Blob, ACL)
Cannot be modified by anyone
βœ…
Verification
sp_verify_database_ledger validates integrity
Proves data has not been tampered with

Two types:

  • Updatable ledger tables β€” normal DML allowed, but all changes are cryptographically recorded
  • Append-only ledger tables β€” INSERT only (no UPDATE/DELETE)

Use case: Financial records, regulatory compliance, legal evidence where you must prove data integrity.

Ledger setup β€” enable order​

Enable Database Ledger
1
Enable on database
Azure SQL DB: ALTER DATABASE ... SET LEDGER = ON
Or check the "Enable ledger" box at create time
2
Choose ledger table type
CREATE TABLE ... WITH (LEDGER = ON) β†’ updatable
CREATE TABLE ... WITH (LEDGER = ON (APPEND_ONLY = ON)) β†’ append-only
3
Configure digest storage
Azure Blob (immutable container) or Azure Confidential Ledger
Auto-generation interval (default 30 min)
4
Verify periodically
EXEC sp_verify_database_ledger @digests
Schedule via SQL Agent / Logic App
Common ordering trap

Digest storage must be immutable (Blob with time-based retention policy or Azure Confidential Ledger). If the destination is writable by an admin, the tamper-proof guarantee is broken β€” the auditor will reject it.

🎯 Exam Focus

Ledger is NOT encryption β€” it's integrity verification. It proves data hasn't been tampered with after the fact. For encryption β†’ TDE or Always Encrypted. For access control β†’ RLS. For tamper-proof audit β†’ Ledger.

Change Tracking vs Change Data Capture​

FeatureChange Tracking (CT)Change Data Capture (CDC)
What it tells youWhich rows changed (PK only)What changed (old + new values)
Performance impactLowMedium
StorageMinimal (PK + version)Higher (full change records)
CleanupAutomaticAutomatic (configurable retention)
AsyncSynchronousAsynchronous (reads log)
Available onSQL DB, MI, VMMI, VM (SQL DB: limited)
Best forSync scenarios (Data Sync)ETL, auditing, replication
🎯 Exam Focus

CT = "did this row change?" (lightweight, for sync). CDC = "what exactly changed and when?" (detailed, for ETL/audit). The exam tests whether you can choose the right one based on requirements.

CDC enable order (SQL MI / SQL Server)​

Enable CDC on a table
1
Enable at database level
EXEC sys.sp_cdc_enable_db
Creates cdc schema + change tables
2
Enable per source table
EXEC sys.sp_cdc_enable_table
@source_schema, @source_name, @role_name
3
Verify capture/cleanup jobs
SQL Agent jobs: cdc.<db>_capture and cdc.<db>_cleanup
On Azure SQL DB β€” jobs are managed automatically
4
Consume changes
cdc.fn_cdc_get_all_changes_<capture>
cdc.fn_cdc_get_net_changes_<capture>
Common ordering trap

You must enable CDC on the database first (sp_cdc_enable_db) before enabling on any table. Without it, sp_cdc_enable_table fails. On SQL Server (not Azure), SQL Agent must be running β€” the capture job won't start otherwise.

Change Tracking enable order (lighter‑weight)​

Enable Change Tracking
1
Enable at database level
ALTER DATABASE ... SET CHANGE_TRACKING = ON
Set CHANGE_RETENTION + AUTO_CLEANUP
2
Enable per table
ALTER TABLE ... ENABLE CHANGE_TRACKING
Optional WITH (TRACK_COLUMNS_UPDATED = ON)
3
Query changes
CHANGETABLE(CHANGES <table>, @last_version)
Compare against CHANGE_TRACKING_CURRENT_VERSION()

SQL Auditing β€” enable order​

Enable Azure SQL Auditing
1
Pick scope
Server-level (covers all DBs, recommended) or DB-level only
2
Choose destination(s)
Log Analytics (KQL queries)
Storage Account (long-term archive)
Event Hub (SIEM streaming)
3
Grant identity to destination
Server MI needs Storage Blob Data Contributor / LA Contributor
Skip = audit silently fails to write
4
Enable auditing
Portal: SQL Server β†’ Auditing β†’ ON
Or PowerShell Set-AzSqlServerAudit
5
Verify with a test query
Run a SELECT, then check sys.fn_get_audit_file or LA AzureDiagnostics
Common ordering trap

If you turn on auditing before the server identity has write access to the destination, audits are silently dropped β€” no error in the portal. Always grant the role first.

Microsoft Purview Integration​

Purview provides unified data governance across your entire Azure estate.

Purview FeatureWhat It Does for SQL
Data MapAuto-discovers and catalogs SQL databases, schemas, tables
Data ClassificationScans and labels sensitive data in SQL databases
Data LineageTracks data flow from source β†’ transforms β†’ SQL
Access PoliciesEnforce access governance from Purview (preview)

Microsoft Defender for SQL β€” Deep Dive​

FeatureWhat It Detects
Vulnerability AssessmentWeak passwords, excessive permissions, unencrypted sensitive columns, missing TDE
Advanced Threat ProtectionSQL injection attempts, anomalous access patterns, brute-force login, data exfiltration
Security AlertsReal-time alerts to email, Security Center, SIEM
Microsoft Defender for SQL
πŸ”
Vulnerability Assessment
Scans for weak passwords, excessive permissions, unencrypted columns, missing TDE
🚨
Advanced Threat Protection
Detects SQL injection, anomalous access, brute-force logins, data exfiltration
πŸ“Š
Security Alerts
Real-time alerts to email, Security Center, and SIEM integration
🎯 Exam Focus

Defender for SQL = Vulnerability Assessment + Advanced Threat Protection in one package. If the exam asks about "detecting SQL injection" β†’ ATP. "Finding misconfigured databases" β†’ Vulnerability Assessment. "Both" β†’ Defender for SQL.


Anti-Patterns​

  • "Defender for SQL only on production." Fine for cost control β€” but dev/test where developers keep prod-like data is exactly where data exfil happens. Score the risk per-environment, not just per-tier.
  • "Vulnerability Assessment baseline = clean = secure." VA flags misconfigs. "Baseline approved" only means you accepted the current state, not that the state is secure. Re-baseline whenever schema or roles change.
  • "Data Classification = data protection." Discovery + labeling only. It does NOT enforce access. Pair labels with Auditing (SENSITIVITY_CLASSIFICATION column in audit logs) and DDM/RLS to act on the labels.
  • "Auditing to Storage is enough." Storage retention is cheap; querying it at scale is painful. Pair Storage with Log Analytics (or Event Hub β†’ SIEM) so SOC can KQL across all DBs.
  • "Compliance Manager score = compliance." It's a posture indicator, not an audit. The auditor wants evidence β€” audit logs, change records, key rotation history. CM scores guide the gap, not the certificate.
  • "Disable Defender alerts that are noisy." Tune them, don't disable. Disabled alerts come back during audits as un-evidenced risk acceptances.
⚠️ Watch Out

Defender for SQL on Azure SQL DB and on SQL Server (via Arc) are billed separately. Same product family, two SKUs. A 200-server estate that's 50 % PaaS, 50 % VM is two line items in the invoice β€” plan budget accordingly.


Migration Between Compliance Postures​

From β†’ ToPathCost
No Defender β†’ Defender for SQLToggle plan in Defender for Cloud per scopePer-server billing; gain VA + ATP + alerts
Defender on Azure SQL DB β†’ also on SQL VM via ArcArc-enable SQL VMs + enable Defender planTwo SKUs to track; unified portal view
Storage-only auditing β†’ Storage + Log AnalyticsAdd LA destination at server levelAdds ingest cost; gain KQL + Sentinel ready
Manual VA review β†’ VA + Express ConfigurationToggle Express config; baselines auto-appliedEasier ops; less granular per-finding tuning
Email alerts β†’ Sentinel rulesConnect Defender for SQL to Sentinel; build analytics rulesAdds Sentinel cost; gain orchestration + playbooks
Defender for SQL alone β†’ Defender for SQL + Defender for EndpointEnable MDE on host VMs; correlation appearsDoubles cost; gains host-level forensics
No data classification β†’ Data Classification + auto-labelingAuto-label via VA; review labels quarterlyFree feature; ops cost = label review
Per-server config β†’ Defender plan via Azure PolicyAssign policy at MG scopeDrift prevention; standardized posture

Most expensive moves: adopting Sentinel on top (orchestration tier) and rolling out Defender for Endpoint alongside (host-level posture).


Real Scenarios​

  1. Regulated bank, SOC 2 + PCI β†’ Defender for SQL + VA Express + Auditing to LA + Sentinel rules + automated playbook to disable suspicious logins. Driver: detect + respond. Trade-off: Defender + LA + Sentinel = three line items.
  2. Hospital with PHI β†’ Defender for SQL + Data Classification with PHI labels + Auditing to Storage (cold) and LA (hot 30d) + Always Encrypted on labeled columns. Driver: HIPAA + breach detection. Trade-off: complexity in alert tuning.
  3. Mid-market SaaS, cost-conscious β†’ Defender for SQL on prod only + Auditing to Storage + quarterly VA review. Driver: 80 % posture for ~20 % cost. Trade-off: dev/test gaps must be compensated by network controls.
  4. Government tenant, key custody mandate β†’ Defender for SQL + BYOK TDE + Auditing to LA in same region as workload + audit log retention 7y in immutable storage. Driver: regulator audit-ability. Trade-off: cross-region restrictions on the LA workspace.
  5. Compliance Manager dashboard β†’ evidence collection β†’ Defender + Audit + Policy assignments scored in CM as evidence sources. Driver: pre-audit readiness. Trade-off: ongoing curation; not zero-effort.

Flashcards​

What does Data Classification do?
Click to reveal answer
Discovers and labels sensitive data columns (SSN, credit card, etc.) using built-in patterns. Labels integrate with Auditing to track access to sensitive data. Does NOT enforce access control.
1 / 6

Quiz​

Q1/3
0 correct
You need to encrypt a phone number column but still allow LIKE '%555%' queries. What feature do you use?