Azure Security
Hardening the Snips environment·55 minutes
The security review findings
The Snips Security team has completed a review of the Azure environment. They have found several issues: RDP is permanently open to the internet, disks are not encrypted, secrets are stored in plain text in application settings, and there is no centralised security monitoring. You need to address their findings.
Security is not a one-time task — it is an ongoing process. This module introduces the Azure security tools that help you maintain a strong security posture as the environment grows and changes.
What you will learn
Security review findings
Work through the Security team's findings. Select each one to see the recommended fix:
Security review findings — Snips Azure environment
Select a finding to see the recommended fix.
Microsoft Defender for Cloud
Defender for Cloud is the central security management tool for Azure. It continuously assesses your environment against security best practices and provides a Secure Score — a percentage that measures how many recommendations you have implemented.
Secure Score
A percentage measuring how many security recommendations have been implemented. Higher is better. Each recommendation has a score impact — prioritise high-impact items first.
Security recommendations
Specific actions to improve security posture. Grouped by control (e.g. 'Enable MFA', 'Encrypt data at rest'). Each recommendation links to remediation steps.
Just-in-time VM access
Keeps RDP/SSH ports closed by default. Access is granted on request for a specified duration and source IP, then automatically revoked.
Defender plans
Enhanced protection for specific resource types (VMs, storage, databases, containers). Each plan adds threat detection and advanced security features.
Azure Key Vault
Azure Key Vault is the correct place for all secrets, keys and certificates. Never store credentials in code, configuration files or application settings as plain text.
Secrets
Any sensitive value: passwords, connection strings, API keys, storage account keys. Versioned — you can update a secret and roll back to a previous version.
Keys
Cryptographic keys used for encryption, signing and key wrapping. The private key material never leaves the vault — operations are performed inside Key Vault.
Certificates
X.509 certificates with their private keys. Key Vault can auto-renew certificates from supported CAs, eliminating certificate expiry incidents.
Managed identities in practice
The correct pattern for an App Service or Function App reading from Key Vault:
- 1.Assign a system-assigned managed identity to the App Service.
- 2.Grant the identity the Key Vault Secrets User role on the vault.
- 3.Reference the secret in App Service configuration using a Key Vault reference:
@Microsoft.KeyVault(SecretUri=...) - 4.The App Service retrieves the secret at runtime — no credentials stored anywhere.
Microsoft Sentinel
Microsoft Sentinel is a cloud-native SIEM (Security Information and Event Management) and SOAR (Security Orchestration, Automation and Response) solution. It collects security data from across the environment, detects threats using analytics rules, and provides investigation and response capabilities.
Data connectors
Connect Sentinel to data sources: Azure Activity, Entra ID sign-in logs, Microsoft 365, third-party security tools.
Analytics rules
KQL-based rules that detect suspicious patterns in the collected data and create incidents for investigation.
Incidents
Groups of related alerts that represent a potential security threat. Analysts investigate incidents and take response actions.
Playbooks
Azure Logic Apps that automate response actions — for example, blocking an IP address or disabling a user account when a threat is detected.
Key Vault and security CLI commands
# Create an Azure Key Vault
az keyvault create \
--name kv-snips-prod-uks-001 \
--resource-group rg-security-prod-uks-001 \
--location uksouth \
--enable-rbac-authorization true \
--enable-soft-delete true \
--retention-days 90
# Store a secret
az keyvault secret set \
--vault-name kv-snips-prod-uks-001 \
--name db-connection-string \
--value "Server=snips-db.database.windows.net;..."
# Grant a managed identity access to read secrets
az role assignment create \
--role "Key Vault Secrets User" \
--assignee "<managed-identity-object-id>" \
--scope "/subscriptions/<sub-id>/resourceGroups/rg-security-prod-uks-001/providers/Microsoft.KeyVault/vaults/kv-snips-prod-uks-001"
# Enable JIT VM access (via Defender for Cloud)
az security jit-policy create \
--resource-group rg-compute-prod-uks-001 \
--name default \
--virtual-machines "[{"id":"/subscriptions/<sub-id>/resourceGroups/rg-compute-prod-uks-001/providers/Microsoft.Compute/virtualMachines/vm-contractordocportal-prod-uks-001","ports":[{"number":3389,"protocol":"TCP","allowedSourceAddressPrefix":"*","maxRequestAccessDuration":"PT3H"}]}]"- 1.Review the Secure Score in Defender for Cloud and identify the top 3 recommendations.
- 2.Enable Just-in-time VM access on the Contractor Document Portal VM.
- 3.Create an Azure Key Vault with soft delete and purge protection enabled.
- 4.Store a test secret in Key Vault.
- 5.Assign a managed identity to the App Service and grant it Key Vault Secrets User.
- 6.Replace a plain-text application setting with a Key Vault reference.
1.Microsoft Defender for Cloud shows the Snips environment has a Secure Score of 42%. What does this score represent?
2.The Security team wants to allow RDP access to the Contractor Document Portal VM only when needed, without leaving port 3389 permanently open. Which feature provides this?
3.The Applications team needs to store the database connection string for the internal API securely. Where should it be stored?
4.What is the difference between a Key Vault secret and a Key Vault key?
5.Snips wants a single dashboard showing security alerts, incidents and threat intelligence across the entire Azure environment. Which service provides this?
Module summary
The Snips security posture is significantly improved. RDP is protected by JIT access, secrets are in Key Vault, managed identities replace stored credentials, and Defender for Cloud is monitoring the environment. The Security team's findings have been addressed.
Ready to mark this module complete?
Mark complete when you have read all sections, attempted the lab and completed the knowledge check.
- Manage Azure identities and governance
- Configure and manage virtual networking