Study guide
3.3 Keys, Secrets, Certificates & Defender for Key Vault
Microsoft Certified: Cloud and AI Security Engineer Associate SC-500
Track your progress as you read
Finished sections get a check mark.
1 Introduction & Exam Overview
1.1 Current Exam Facts 1.2 Skills Measured & Weightings 1.3 Study Path, Prerequisites & Exam Strategy
2 Microsoft Entra ID Secure Access
2.1 Privileged Identity Management (PIM) 2.2 Conditional Access Policies 2.3 MFA and Passwordless Authentication 2.4 Application Identities, OAuth Consent & Managed Identities
3 Azure Key Vault Secrets and Keys
3.1 Deploy and Configure Key Vault 3.2 Access Control and Firewall for Key Vault 3.3 Keys, Secrets, Certificates & Defender for Key Vault
4 Governance, Policy & RBAC
4.1 Azure Policy for Security Controls 4.2 Defender for Cloud Compliance & Security Standards 4.3 Resource Locks and Azure RBAC 4.4 Custom Roles, Overprivileged Access, Backup & IaC Security
5 Secure Storage Accounts
5.1 Storage Account Security Fundamentals 5.2 Storage Firewalls and Access Policies 5.3 Defender for Storage
6 Secure Databases
6.1 Azure SQL Platform Security 6.2 Database Auditing 6.3 Defender for Databases
7 Network Security Groups & Virtual Network Manager
7.1 Network Security Groups and Application Security Groups 7.2 Azure Virtual Network Manager Security Admin Rules 7.3 Virtual WAN and VPN Security
8 Private Access, Private Link & Azure Firewall
8.1 Microsoft Entra Private Access 8.2 Private Endpoints and Private Link 8.3 Azure Firewall 8.4 Network Watcher Diagnostics and Effective Rules
9 Security for AI Workloads
9.1 Purview DSPM for AI and Data Overexposure 9.2 Copilot Studio Protection and Agent Management 9.3 Microsoft Entra Agent ID Security 9.4 Defender for AI, Foundry Guardrails & AI Gateway
10 Secure Servers and Virtual Machines
10.1 Disk Encryption 10.2 Azure Bastion and JIT VM Access 10.3 Azure Arc and Defender for Servers 10.4 Trusted Launch, VM Security Features & Machine Configuration
11 Application Platform Security
11.1 Containers: AKS, ACR, ACI, Container Apps & Defender for Containers 11.2 Azure Functions and Logic Apps Security 11.3 Azure App Service Security 11.4 Web Application Firewall and API Management Protection
12 Defender for Cloud Security Posture
12.1 Defender CSPM and Secure Score 12.2 Workload Protection Plans and Multicloud Connectors 12.3 Vulnerability Management and Defender EASM
13 Microsoft Sentinel Activity and Event Collection
13.1 Workspaces, Roles & Content Hub 13.2 Data Connectors, Syslog/CEF & Windows Event Collection 13.3 Custom Tables, Retention & Purview Audit 13.4 Automation Rules and Playbooks
14 Microsoft Security Copilot & Final Review
14.1 Microsoft Security Copilot Workspaces and Roles 14.2 Plugins and Security Agents 14.3 Final Review and Exam-Day Strategy
3.3 Keys, Secrets, Certificates & Defender for Key Vault
Key Takeaways Explain This Topic AI
Keys are cryptographic material for encrypt/sign/wrap; secrets are opaque values (passwords, connection strings); certificates bundle keys with X.509 metadata and policy-driven lifecycle.
Objects are versioned; rotation creates a new version—prefer versionless URIs for automatic pickup while retaining old versions until consumers finish re-wrap or cutover.
Soft-delete applies to keys, secrets, and certificates; recovery restores them, and purge is a privileged second step blocked by purge protection during retention.
Defender for Key Vault raises anomalous access alerts; Defender CSPM secret scanning finds exposed credentials in code, configs, and server disks so you can move them into Key Vault.
Prefer Key Vault over App Service application settings for secrets that need centralized ACL, rotation, auditing, and network isolation.
Last updated: July 2026
Keys vs Secrets vs Certificates
Object What it is Common operations Choose when
Key Cryptographic key (RSA, EC; HSM variants on Premium/Managed HSM) create, import, sign, verify, encrypt, decrypt, wrap, unwrap, rotate CMK for Storage/SQL/disks, app-level crypto, signing
Secret Arbitrary octet sequence (up to 25 KB), exposed as string to clients set, get, list, delete, recover, backup Connection strings, API tokens, passwords, shared keys
Certificate Managed X.509 cert with policy, optional auto-renewal via issuer create, import, renew, get (includes key/secret material as policy allows) TLS for apps, gateways, mutual TLS
Design rule: If the value is a password-like credential the app only needs to read , store a secret . If Azure or your app must perform crypto without exporting private key material , use a key . If you need a public cert + private key lifecycle for TLS, use a certificate (which may create related key/secret objects under the covers).
Secrets support optional contentType , nbf / exp , and enabled attributes. Note that get can still retrieve not-yet-valid or expired secrets for recovery/testing—expiration is informational for operational hygiene, not a hard crypto boundary.
Versioning
Every set/create/rotate produces a new version under a stable object name:
- Versioned URI: https://contoso.vault.azure.net/secrets/DbConn/<version-guid> — pins exact material
- Versionless URI: https://contoso.vault.azure.net/secrets/DbConn — resolves to the current version
Best practice for rotation-friendly apps: Configure consumers with versionless identifiers so they pick up new versions after rotation. Persist versioned identifiers with ciphertext when decrypting historical data (CMK wrap patterns), so unwrap still uses the key version that wrapped the DEK.
You can disable an old version without deleting it, list versions, and recover soft-deleted versions according to retention rules.
- Rotation
- Cryptographic keys
Key Vault supports rotation policies per key:
- Auto-rotate a given time after create (for example every 18 months)
- Or auto-rotate a given time before expiry (requires expiry on policy and key)
- Near-expiry Event Grid notifications for manual or custom automation
- On-demand Rotate now
Rotation creates new key material as a new version . For Azure CMK integrations, services re-wrap data encryption keys; they do not necessarily re-encrypt all customer data immediately. Keep prior key versions enabled until re-wrap completes. Microsoft guidance commonly cites rotating encryption keys at least about every two years; many policies use shorter intervals.
Permissions: manage rotation with Key Vault Crypto Officer (RBAC) or access-policy rotate / set rotation policy permissions.
Secrets and certificates
Secrets do not use the same built-in crypto rotation policy object; you set a new secret version (manual, pipeline, or Event Grid–driven automation) and update consumers. Certificates use certificate policy for lifetime, issuer, and auto-renewal—prefer Key Vault–managed renewal over shipping PFX files in repos.
Soft-Delete Recovery of Objects
Deleting a key, secret, or certificate with soft-delete enabled:
- Object becomes inaccessible for normal get/crypto use
- Remains listable via deleted items APIs for the retention window
- Recover restores it to active use
- Purge permanently destroys it (blocked while purge protection is active until retention ends)
- Name remains reserved while soft-deleted—you cannot create a conflicting new object with the same name
Exam scenario: An operator accidentally deletes secrets/PaymentApiKey . Correct response is recover the soft-deleted secret (with recover permission), not immediately create a new secret of the same name (may fail while deleted object exists) or rotate every dependent system without checking deleted items first.
If the entire vault was soft-deleted, recover the vault first, then re-create RBAC assignments and event subscriptions that were lost.
Microsoft Defender for Key Vault
Defender for Key Vault is a Defender for Cloud workload protection plan that detects unusual and potentially harmful access to vaults—anomalous callers, suspicious patterns, possible credential misuse.
- Feature Detail
- Alerts surface Vault Security blade, Defender for Cloud alerts, workload protections
- Alert content Object ID, UPN or IP when available; accessed secret/key details
Response themes Identify source → constrain network/RBAC → measure which objects were touched → rotate/disable affected secrets and keys
Response playbook (exam-aligned):
Do not dismiss an alert only because you recognize the app name—verify with the owner; stolen identity is the threat model.
If source IP is unexpected: enable/tighten firewall, private endpoints, remove broad access.
If principal is unauthorized: remove role assignments or access policies; reduce Entra privileges.
Review diagnostic logs for the caller IP / appId / OID around the alert time.
Rotate every secret/key/certificate that was accessed; disable old versions; audit downstream apps.
Defender CSPM Secret Scanning
Separately from runtime anomaly detection, Defender Cloud Security Posture Management (CSPM) and related Defender capabilities scan for exposed secrets so you can eliminate them at the source:
Surface What scanning finds Remediation direction
Code repositories (DevOps security / code scanning) Tokens, passwords, keys committed to GitHub, Azure DevOps, GitLab Revoke credential, rewrite history as needed, store in Key Vault, block via pipeline secret scanning
Cloud deployments / IaC Secrets embedded in templates, pipelines, deployment configs Parameterize with Key Vault references; use managed identity
Servers / VMs (with appropriate Defender plans) Secrets on disk snapshots (connection strings, keys in config files) Remove plaintext, move to Key Vault, harden residual access
SC-500 skill language: Scan for secrets by using Defender CSPM and Implement Defender for Key Vault . Treat them as complementary:
- CSPM scanning → find secrets that should never have left Key Vault (or never been created as plaintext)
- Defender for Key Vault → detect abuse of vaults that already hold the crown jewels
- Exam Scenarios: Key Vault vs App Settings
- Requirement Prefer Key Vault App settings / config alone may suffice
- Central ACL per secret with Entra RBAC Yes Weak—app settings inherit broad site contributor access
- Hardware-backed keys / non-export CMK Keys in Premium/Managed HSM Not available in app settings
- Full AuditEvent logging of each secret get Yes with diagnostics Limited platform logs; not a secrets inventory
- Network isolation of secret store Firewall + private endpoint App settings live with the app resource
Rotation without redeploying code Versionless URI + new version Requires app restart/config change for each value
Non-sensitive feature flags Optional Simple app settings are fine
Classic exam stem: “Developers stored SQL passwords in App Service application settings and checked a backup into source control. Leadership wants centralized control, rotation, and detection of odd access.”
Answer path: Move secrets to Key Vault; use managed identity + Secrets User; enable diagnostics; enable Defender for Key Vault; use CSPM/DevOps secret scanning to catch regressions; purge secrets from git and rotate everything exposed.
Another stem: “Storage account uses CMK. Security wants assurance keys cannot be purged by a compromised admin for 90 days.”
Answer: Soft-delete + purge protection on the vault holding the CMK; restrict Purge Operator; monitor with Defender for Key Vault.
- Operational Checklist
- Classify data: secret vs key vs certificate
- Enforce RBAC data roles + managed identity
- Versionless URIs for apps; versioned IDs for ciphertext metadata
- Rotation policies for CMKs; automated secret set for credentials
- Soft-delete recover drills; purge protection for encryption vaults
- Diagnostics → Log Analytics/Sentinel
- Defender for Key Vault on; CSPM secret scanning on code and cloud
- Prefer Key Vault over plaintext app settings for credentials
- SC-500 Exam Traps (Objects & Defender)
Certificate ≠ secret: TLS lifecycle needs certificate objects/policies.
Rotation ≠ delete-and-recreate under a new name when versioning exists.
Recover before recreating same-named objects.
Defender for Key Vault ≠ CSPM secret scanning—one is anomalous vault access, the other is finding leaked credentials.
App settings are not a substitute for Key Vault when the scenario stresses audit, RBAC, rotation, or CMK.