Skip to main content

Security Baseline

How to implement Microsoft Defender, encryption, threat detection, and compliance in landing zones.

Security Architecture Overview

Microsoft Defender for Cloud

Defender Plans

PlanCoverageKey Features
CSPM (Free)Posture managementSecure Score, recommendations
Defender for ServersVMsVulnerability scanning, EDR
Defender for ContainersAKS, ACRImage scanning, runtime
Defender for StorageStorage accountsMalware scanning
Defender for SQLSQL databasesThreat detection
Defender for App ServiceWeb appsOWASP protection
Defender for Key VaultKey VaultsAccess anomalies
Defender for ARMResource ManagerSuspicious operations
Defender for DNSDNSDomain threats

Enable Defender with Policy

targetScope = 'subscription'

resource defenderServers 'Microsoft.Security/pricings@2023-01-01' = {
name: 'VirtualMachines'
properties: {
pricingTier: 'Standard'
subPlan: 'P2'
}
}

resource defenderContainers 'Microsoft.Security/pricings@2023-01-01' = {
name: 'Containers'
properties: {
pricingTier: 'Standard'
}
}

resource defenderStorage 'Microsoft.Security/pricings@2023-01-01' = {
name: 'StorageAccounts'
properties: {
pricingTier: 'Standard'
subPlan: 'DefenderForStorageV2'
}
}

resource defenderSQL 'Microsoft.Security/pricings@2023-01-01' = {
name: 'SqlServers'
properties: {
pricingTier: 'Standard'
}
}

resource defenderKeyVault 'Microsoft.Security/pricings@2023-01-01' = {
name: 'KeyVaults'
properties: {
pricingTier: 'Standard'
}
}

Auto-Provisioning

resource autoProvisionMDE 'Microsoft.Security/autoProvisioningSettings@2017-08-01-preview' = {
name: 'default'
properties: {
autoProvision: 'On'
}
}

resource defenderAutoProvision 'Microsoft.Security/serverVulnerabilityAssessmentsSettings@2023-05-01' = {
name: 'default'
properties: {
selectedProvider: 'MdeTvm'
}
}

Microsoft Sentinel

Architecture

Essential Data Connectors

ConnectorDataPriority
Azure ActivityManagement plane operationsHigh
Entra IDSign-ins, audit logsHigh
Microsoft Defender for CloudSecurity alertsHigh
Azure FirewallNetwork trafficHigh
Microsoft 365Email, SharePointHigh
DNSQuery logsMedium
Azure Key VaultAccess logsMedium

Bicep: Sentinel Deployment

resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
name: 'log-sentinel-prod-001'
location: location
properties: {
sku: {
name: 'PerGB2018'
}
retentionInDays: 90
}
}

resource sentinel 'Microsoft.SecurityInsights/onboardingStates@2023-02-01' = {
name: 'default'
scope: logAnalytics
properties: {}
}

resource azureActivityConnector 'Microsoft.SecurityInsights/dataConnectors@2023-02-01' = {
name: 'azureActivity'
scope: logAnalytics
kind: 'AzureActivity'
properties: {
linkedResourceId: subscription().id
}
}

Encryption

Encryption Strategy

CMK Configuration

resource keyVault 'Microsoft.KeyVault/vaults@2023-02-01' = {
name: 'kv-cmk-prod-001'
location: location
properties: {
sku: {
family: 'A'
name: 'premium' // For HSM-backed keys
}
tenantId: subscription().tenantId
enableRbacAuthorization: true
enablePurgeProtection: true
enableSoftDelete: true
softDeleteRetentionInDays: 90
networkAcls: {
bypass: 'AzureServices'
defaultAction: 'Deny'
}
}
}

resource encryptionKey 'Microsoft.KeyVault/vaults/keys@2023-02-01' = {
parent: keyVault
name: 'storage-cmk'
properties: {
kty: 'RSA'
keySize: 4096
keyOps: ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
rotationPolicy: {
lifetimeActions: [
{
trigger: {
timeAfterCreate: 'P90D'
}
action: {
type: 'Rotate'
}
}
]
attributes: {
expiryTime: 'P1Y'
}
}
}
}

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: 'stcmkprod001'
location: location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${managedIdentity.id}': {}
}
}
properties: {
encryption: {
keySource: 'Microsoft.Keyvault'
keyvaultproperties: {
keyname: encryptionKey.name
keyvaulturi: keyVault.properties.vaultUri
}
identity: {
userAssignedIdentity: managedIdentity.id
}
services: {
blob: {
enabled: true
}
file: {
enabled: true
}
}
}
}
}

Security Policies

Azure Security Benchmark

The Azure Security Benchmark is Microsoft's recommended security baseline:

targetScope = 'managementGroup'

resource asbInitiative 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
name: 'azure-security-benchmark'
location: location
identity: {
type: 'SystemAssigned'
}
properties: {
policyDefinitionId: '/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8'
displayName: 'Azure Security Benchmark'
enforcementMode: 'Default'
parameters: {}
}
}

Essential Security Policies

PolicyEffectPurpose
Require secure transferDenyHTTPS only for storage
Require TLS 1.2DenyMinimum TLS version
Deny public blob accessDenyPrevent data exposure
Require private endpointsAuditNetwork isolation
Require disk encryptionAuditData at rest
Deploy DefenderDeployIfNotExistsEnable protection
Require diagnosticsDeployIfNotExistsSecurity logging
Deny public IPDenyLimit internet exposure

Bicep: Custom Security Policy

resource denyPublicStorage 'Microsoft.Authorization/policyDefinitions@2021-06-01' = {
name: 'deny-public-blob-access'
properties: {
displayName: 'Deny public blob access on storage accounts'
policyType: 'Custom'
mode: 'All'
metadata: {
category: 'Storage'
}
policyRule: {
if: {
allOf: [
{
field: 'type'
equals: 'Microsoft.Storage/storageAccounts'
}
{
field: 'Microsoft.Storage/storageAccounts/allowBlobPublicAccess'
notEquals: false
}
]
}
then: {
effect: 'Deny'
}
}
}
}

Private Endpoints

Bicep: Private Endpoint

resource privateEndpoint 'Microsoft.Network/privateEndpoints@2023-05-01' = {
name: 'pe-st-prod-001'
location: location
properties: {
privateLinkServiceConnections: [
{
name: 'storage-connection'
properties: {
privateLinkServiceId: storageAccount.id
groupIds: ['blob']
}
}
]
subnet: {
id: privateEndpointSubnet.id
}
}
}

resource privateDnsZoneGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-05-01' = {
parent: privateEndpoint
name: 'default'
properties: {
privateDnsZoneConfigs: [
{
name: 'privatelink-blob'
properties: {
privateDnsZoneId: blobPrivateDnsZone.id
}
}
]
}
}

DDoS Protection

DDoS Architecture

Bicep: DDoS Protection

resource ddosPlan 'Microsoft.Network/ddosProtectionPlans@2023-05-01' = {
name: 'ddos-prod-001'
location: location
properties: {}
}

resource vnet 'Microsoft.Network/virtualNetworks@2023-05-01' = {
name: 'vnet-prod-001'
location: location
properties: {
addressSpace: {
addressPrefixes: ['10.0.0.0/16']
}
ddosProtectionPlan: {
id: ddosPlan.id
}
enableDdosProtection: true
}
}

Security Monitoring

Key Security Logs

LogSourceRetention
Azure ActivitySubscription2 years
Entra ID Sign-insAzure AD2 years
Entra ID AuditAzure AD2 years
NSG Flow LogsNetwork90 days
Firewall LogsAzure Firewall90 days
Key Vault LogsKey Vault2 years
Defender AlertsMDC90 days

Security Alerts Configuration

resource securityAlert 'Microsoft.Insights/activityLogAlerts@2020-10-01' = {
name: 'security-configuration-change'
location: 'global'
properties: {
enabled: true
scopes: [
subscription().id
]
condition: {
allOf: [
{
field: 'category'
equals: 'Security'
}
{
field: 'operationName'
equals: 'Microsoft.Security/policies/write'
}
]
}
actions: {
actionGroups: [
{
actionGroupId: securityActionGroup.id
}
]
}
}
}

Security Checklist

✅ Identity

  • MFA enforced for all users
  • Conditional Access policies active
  • PIM enabled for privileged roles
  • Break glass accounts configured

✅ Network

  • Azure Firewall deployed
  • NSG on all subnets
  • Private endpoints for PaaS
  • DDoS Protection enabled
  • WAF for public apps

✅ Data

  • Encryption at rest enabled
  • TLS 1.2+ enforced
  • Customer-managed keys for sensitive data
  • Key rotation configured

✅ Monitoring

  • Microsoft Defender enabled
  • Sentinel deployed
  • Security alerts configured
  • Log retention set

✅ Governance

  • Azure Security Benchmark assigned
  • Security policies enforced
  • Compliance dashboard reviewed

Quick Reference Card

ComponentConfiguration
DefenderEnable all plans for landing zones
SentinelCentralized in Management subscription
EncryptionCMK for sensitive workloads
Private EndpointsRequired for Corp landing zones
TLS1.2 minimum, 1.3 preferred
Key VaultPremium SKU, RBAC authorization

Next Steps

Continue to Governance & Policy to learn about Azure Policy, compliance, and cost management.