Skip to main content

Task 01: Enable Defender for Cloud

Runbook Azure

DOCUMENT CATEGORY: Runbook
SCOPE: The free level of Microsoft Defender for Cloud
PURPOSE: Show the Azure Local security settings and recommendations in the Azure portal
MASTER REFERENCE: Microsoft Learn - Manage system security with Microsoft Defender for Cloud

Status: Active

This task turns on the two free items of Microsoft Defender for Cloud that Azure Local uses. Nothing in this task costs money.

What this task turns on​

ItemCostWhat it gives you
Foundational CSPMFreeThe basic Defender for Cloud plan. It gives security recommendations for Azure Local and your other Azure and Arc resources.
Microsoft cloud security benchmarkFreeA policy initiative assigned to the subscription. The Azure Local security settings show in the Azure portal only when it is applied.
Paid plans are not part of this task

The guide and the toolkit turn on no paid Defender plan: no Defender for Servers, Storage, Key Vault, Resource Manager, DNS or Defender CSPM, and no agent auto-provisioning. Microsoft Sentinel is not set up either.

Microsoft's page lists Defender for Servers as a further step. It adds security alerts for individual machines and Azure Local VMs, and it is billed per server. Whether to buy it is your decision, made outside this guide. If you want it, follow Enable the Defender for Servers plan.

Prerequisites​

  • The Azure Local instance is deployed, registered and connected to Azure.
  • Owner or Contributor on the subscription of the instance, to turn on Foundational CSPM.
  • Resource Policy Contributor (or Owner) on the subscription, to assign the initiative.

Variables from infrastructure.yml​

KeyWhat it isExample
azure.subscription_idSubscription of the instance00000000-0000-0000-0000-000000000000
security.defender_for_cloud.enabledfalse skips this tasktrue
security.defender_for_cloud.apply_cloud_security_benchmarkfalse leaves the initiative unassignedtrue
security.defender_for_cloud.security_contact_emailAddress for Defender for Cloud notifications. Set only when the subscription has no security contact; an existing one is never replaced. Freesecurity@improbability.cloud
security.defender_for_cloud.alert_notificationsDefender for Cloud sends security_contact_email the security alerts (default true). Read by the Terraform security module; since schema 5.6.28true
security.defender_for_cloud.alerts_to_adminsDefender for Cloud sends the security alerts to the subscription owners too (default true). Read by the Terraform security module; since schema 5.6.28true

The older registry entries security.defender.def_alert_notifications and def_alerts_to_admins are deprecated: use the two keys above.

Procedure​

Step 1: Turn on Foundational CSPM​

  1. In the Azure portal, search for and select Microsoft Defender for Cloud.
  2. Follow Enable Defender for Cloud on your Azure subscription. Turn on no plan other than Foundational CSPM; any offer to upgrade starts paid plans.
  3. Under Management, select Environment settings, select the subscription and check that Foundational CSPM is the only plan that is on.

Step 2: Apply the Microsoft cloud security benchmark​

  1. Under Management, select Environment settings and select the subscription.
  2. Select Security policies.
  3. For Microsoft cloud security benchmark, set Status to On.
  4. Wait at least one hour for the first evaluation.

Validation​

$subscriptionId = "<your-subscription-id>"
$benchmarkId = "/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8"

# Foundational CSPM: the provider is registered
(Get-AzResourceProvider -ProviderNamespace Microsoft.Security | Select-Object -First 1).RegistrationState

# The initiative is assigned
Get-AzPolicyAssignment -Scope "/subscriptions/$subscriptionId" | Where-Object {
$id = if ($_.PSObject.Properties['PolicyDefinitionId']) { $_.PolicyDefinitionId } else { $_.Properties.PolicyDefinitionId }
$id -eq $benchmarkId
} | Select-Object Name

Expected Output​

Registered

Name
----
SecurityCenterBuiltIn

After the first evaluation, open the Azure Local instance in the portal and select Security (preview) > Microsoft Defender for Cloud. The recommendations for the instance are listed there.

Recommendations you can ignore for Azure Local​

Microsoft lists recommendations that do not apply to the storage account, the Key Vault and the machines of an Azure Local instance, for example private link, shared key access and a vulnerability assessment solution on the machines. See Security recommendation exclusions before you act on a recommendation.


Troubleshooting​

IssueCauseResolution
The security settings do not show on the instanceThe Microsoft cloud security benchmark is not assignedDo Step 2, then wait at least one hour
Defender for Cloud shows no data for the subscriptionMicrosoft.Security is not registeredRegister-AzResourceProvider -ProviderNamespace Microsoft.Security, then wait a few minutes
No recommendations after the assignmentThe first evaluation is not completeWait up to 24 hours
The toolkit script stops on SecurityCenterBuiltInAn assignment of that name points at another definitionRemove or rename that assignment, or set apply_cloud_security_benchmark to false and assign the initiative yourself

Next Steps​

Proceed to Task 02: Apply Azure Policy Initiatives.

PreviousUpNext
← Phase 02: Monitoring & ObservabilityPhase 04: Security & GovernanceTask 02: Azure Policy →

Version Control​

VersionDateAuthorChanges
2.0.02026-11-12Azure Local CloudThe task turns on only the free level Azure Local needs; paid plans removed
1.0.02025-03-25Azure Local CloudInitial release