TL;DR
Master Azure security with this comprehensive guide covering Azure Security Center, Microsoft Defender for Cloud, security policies, threat protection, and compliance management.
Azure Security Center and Defender: Securing Cloud Workloads
Executive Summary
Microsoft Defender for Cloud (the evolved Azure Security Center) does two jobs: cloud security posture management, which continuously assesses your resources against benchmarks and tells you what to fix, and workload threat protection, which detects attacks in progress on servers, databases, storage, containers, and Key Vault. This guide covers enabling the Defender plans that matter, connecting assessment data to a Log Analytics workspace, using secure score without gaming it, and turning on the controls — just-in-time VM access, adaptive application controls, regulatory compliance reporting — that change outcomes rather than dashboards.
Why This Matters
Cloud estates change daily, and point-in-time security reviews are stale within a week. The exposed storage account, the VM with a management port open to the internet, the unpatched server — these are configuration states that appear quietly and are found either by continuous assessment or by an attacker. Defender for Cloud exists to close that gap: it watches configuration continuously and adds behavioural detection for the attacks that configuration checks cannot see, such as brute-force attempts against SSH and RDP or malware execution on a server. Without it, most teams learn about both classes of problem from incident reports.
Core Concepts
Two Products in One Console
Foundational CSPM (free) inventories resources, evaluates them against the Microsoft Cloud Security Benchmark, and produces recommendations and a secure score. Defender plans (paid, per resource type) add threat detection, vulnerability assessment, and workload-specific controls. Defender CSPM adds agentless scanning, attack path analysis, and code-to-cloud context on top. Decide deliberately which subscriptions get which plans — enabling everything everywhere without an owner for the output produces cost and ignored recommendations.
Enabling Plans and Auto-Provisioning
Plans are switched on per subscription, and the Log Analytics agent (or its Azure Monitor Agent successor) is auto-provisioned to servers so Defender for Servers can see inside the guest:
# Enable Security Center Register-AzResourceProvider -ProviderNamespace 'Microsoft.Security' # Configure auto-provisioning Set-AzSecurityAutoProvisioningSetting -Name "default" -EnableAutoProvision # Enable standard tier Set-AzSecurityPricing -Name "VirtualMachines" -PricingTier "Standard" Set-AzSecurityPricing -Name "StorageAccounts" -PricingTier "Standard"
Enable plans by workload value — servers, SQL, containers, storage, Key Vault — rather than by habit:
# Enable Defender plans
$plans = @(
"VirtualMachines",
"SqlServers",
"AppServices",
"StorageAccounts",
"KeyVaults",
"Containers"
)
foreach ($plan in $plans) {
Set-AzSecurityPricing -Name $plan -PricingTier "Standard"
}
# Configure workspace mapping
Set-AzSecurityWorkspaceSetting -Name "default" `
-Scope "/subscriptions/$subscriptionId" `
-WorkspaceId "/subscriptions/$subscriptionId/resourceGroups/$resourceGroup/providers/Microsoft.OperationalInsights/workspaces/$workspaceName"Point the workspace mapping at your central security workspace so alerts and recommendations land where the security team actually queries.
Policy: Where Recommendations Come From
Defender's assessments are driven by Azure Policy. The built-in initiative aligned to the Microsoft Cloud Security Benchmark is assigned to subscriptions, and its effects decide whether violations are merely audited or actively denied:
{
"properties": {
"parameters": {
"allowedLocations": {
"value": [
"eastus",
"westus"
]
}
},
"displayName": "Security Baseline",
"policyDefinitions": [
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0015ea4d-51ff-4ce3-8d8c-f3f8f0179a56",
"parameters": {
"effect": {
"value": "Audit"
}
}
}
]
}
}Start new policies in Audit. Moving to Deny for a rule your estate widely violates will break deployments at scale; remediate against the audit data first, then tighten the effect. Exemptions exist for legitimate exceptions — use them with expiry dates instead of weakening the policy for everyone.
Secure Score
Secure score expresses how many of the applicable security controls are fully implemented. Used well, it is a prioritisation queue: fix the control that affects the most resources for the least effort first. Used badly, it becomes a target to game with exclusions. Review recommendations by resource count and severity, assign owners, and track burn-down — the score itself is a summary, not the work.
Alert Contacts and Continuous Export
Alerts that reach nobody protect nothing. Configure security contacts so high-severity alerts go to a monitored mailbox and to subscription owners:
{
"properties": {
"enabled": true,
"emailAddresses": [
"security@contoso.com"
],
"alertNotifications": {
"state": "On",
"minimalSeverity": "High"
},
"notificationsByRole": {
"state": "On",
"roles": [
"Owner",
"Contributor"
]
}
}
}For anything beyond a small estate, turn on continuous export so alerts and recommendations stream to Log Analytics or Event Hubs, where they can feed a SIEM such as Microsoft Sentinel and be retained beyond the portal's window.
Just-in-Time VM Access
Management ports are the most brute-forced surface on any VM. Just-in-time access keeps SSH and RDP ports closed by default and opens them for a named user, from a named source IP, for a bounded window, on approved request:
# Configure JIT VM access
$jitPolicy = @{
Name = "JIT VM Access"
VirtualMachines = @(
@{
id = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroup/providers/Microsoft.Compute/virtualMachines/$vmName"
ports = @(
@{
number = 22
protocol = "*"
allowedSourceAddressPrefix = @("*")
maxRequestAccessDuration = "PT3H"
},
@{
number = 3389
protocol = "*"
allowedSourceAddressPrefix = @("*")
maxRequestAccessDuration = "PT3H"
}
)
}
)
}
Set-AzJitNetworkAccessPolicy -ResourceGroupName $resourceGroup -Location $location -Name "default" -Kind "Basic" -VirtualMachine $jitPolicyIn real policies, scope the allowed source prefixes to your admin networks rather than any address, and prefer Azure Bastion for routine administration, with JIT as the control for exceptional access.
Adaptive Application Controls and Network Hardening
Adaptive application controls learn which processes legitimately run on a group of VMs and alert — or, in enforcement mode, block — when something new executes. It is a strong control against commodity malware, and it needs a tuning period in audit mode while the baseline settles. Adaptive network hardening works similarly on NSG rules, recommending restrictions based on the traffic a VM actually receives. Both controls share a lesson: behavioural baselines are valuable only if someone works the alerts during the tuning window.
Regulatory Compliance
Defender for Cloud maps your policy state to regulatory standards — PCI DSS, HIPAA, ISO 27001, NIST families among them — and reports control-by-control compliance from the same assessment data. This does not make you compliant; it gives auditors and engineers one shared, current view of which technical controls are in place and which are not, which is most of what evidence collection for those standards involves.
Workflow Automation
Defender can trigger a Logic App when an alert fires or a recommendation is created — the hook for auto-remediation and ticketing. Good first automations are boring and safe: open an incident with full context, notify the resource owner, snapshot a VM under active attack for forensics. Automating destructive remediation on day one, before alert quality is proven, is how teams disable the automation on day two.
Decision Framework
| Situation | Recommendation |
|---|---|
| New subscription, no security tooling | Foundational CSPM on, benchmark initiative in Audit, security contacts set |
| Production servers with internet exposure | Defender for Servers, auto-provisioning on, JIT access, vulnerability assessment enabled |
| Regulated workload (PCI, HIPAA) | Relevant Defender plans plus the matching regulatory initiative; continuous export to the SIEM |
| Alert volume overwhelming the team | Tune by severity and resource criticality; route through continuous export and Sentinel rather than email |
| Management ports must exist on VMs | Azure Bastion for routine access; JIT for exceptional access; never a standing open rule |
| Exceptions to a security policy | Time-boxed policy exemptions with an owner, not a weakened policy |
Implementation Checklist
Trade-offs
Defender plans are priced per resource, so full coverage of a large estate is a real line item, and partial coverage creates blind spots an auditor will find. Agent-based visibility inside servers is deeper than agentless scanning but adds an agent to operate; Defender offers both, and mixing them deliberately is normal. Secure score can distort behaviour toward easy points. And every behavioural control — adaptive application controls especially — trades tuning effort for protection: deployed without an owner, it produces alerts that get muted, which is worse than not deploying it, because it creates the appearance of coverage.
When Not to Use
Conclusion
Defender for Cloud earns its cost when its output is worked: recommendations triaged like vulnerabilities, alerts routed to owners, and behavioural controls tuned instead of muted. Enable the plans that match your workloads, wire the export to your SIEM, close the management ports with Bastion and JIT — and treat secure score as the summary of that work, not a substitute for it.
Why This Matters
Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.
Trade-offs to Consider
Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.
When NOT to Use This
Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.
Decision Framework
Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.