IaC gaps

What is NOT Terraform

This page is generated from capability `configuration_methods.terraform` data. Use it to decide where a baseline needs REST, Graph, PowerShell, Microsoft365DSC, or manual validation instead of Terraform.

Terraform Gap Rollup

CapabilityProductCategoryGapMicrosoft References
Advanced HuntingMicrosoft Defender for EndpointInvestigationAdvanced hunting is a query capability, not a desired-state resource. Automate saved queries or query execution through Graph/REST scripts.Advanced hunting in Microsoft Defender XDRUse the Microsoft Graph security APIsecurity: runHuntingQuery
Attack Surface ReductionMicrosoft Defender for EndpointPreventionNo azurerm resource exists for ASR policy. Use Intune/Graph automation or Microsoft365DSC rather than Terraform.Overview of attack surface reduction capabilities
Automated Investigation and ResponseMicrosoft Defender for EndpointDetection and responseAutomation level and investigation settings are tenant/device-group configuration exposed only via the Defender for Endpoint API and Graph Security API, not ARM/Terraform. Automate with a script step inside the same pipeline that runs Terraform, not Terraform itself.Automated investigation and response
Endpoint Detection and ResponseMicrosoft Defender for EndpointDetection and responseMDE onboarding and EDR settings are not ARM/Terraform resources. Automate onboarding packages and Intune/Graph policy outside Terraform.Endpoint detection and response
Threat and Vulnerability ManagementMicrosoft Defender for EndpointExposure managementVulnerability inventory and recommendations are operational data exposed through APIs, not Terraform-managed desired state.Microsoft Defender Vulnerability Management
Defender for Identity SensorsMicrosoft Defender for IdentityDeploymentSensor deployment and directory service account configuration have no ARM/Terraform/Graph desired-state surface. Treat as manual/scripted PowerShell plus host configuration, not tenant IaC.Manage and update Microsoft Defender for Identity sensorsMicrosoft Defender for Identity deployment overview
Identity Alerts and IncidentsMicrosoft Defender for IdentityDetectionAlerts and incidents are operational records exposed through Graph/Defender XDR, not Terraform-managed resources.What is Microsoft Defender for Identity?Use the Microsoft Graph security API
Identity Health IssuesMicrosoft Defender for IdentityMonitoringHealth issues are monitoring data, not desired-state configuration.Use the Microsoft Graph security API
Identity Response ActionsMicrosoft Defender for IdentityResponseIdentity response actions are operational Graph/portal actions, not Terraform desired state.Use the Microsoft Graph security API
Attack Simulation TrainingMicrosoft Defender for Office 365EducationNo azurerm/azapi resource exists for Attack Simulation Training campaigns.Microsoft Defender for Office 365 Features service description
Explorer and Real-time DetectionsMicrosoft Defender for Office 365InvestigationExplorer is an investigation surface, not Terraform-managed configuration.Microsoft Defender for Office 365 documentation
MDO Advanced HuntingMicrosoft Defender for Office 365HuntingAdvanced hunting query execution is API/script automation, not Terraform desired state.Advanced hunting in Microsoft Defender XDRMicrosoft Defender for Office 365 service description
Microsoft Defender XDR IntegrationMicrosoft Defender for Office 365IntegrationDefender XDR integration is service-side capability wiring, not an ARM/Terraform resource.Microsoft Defender for Office 365 service description
Office 365 Automated Investigation and ResponseMicrosoft Defender for Office 365ResponseMDO AIR is a Defender XDR operational capability, not an azurerm/azapi resource.Microsoft Defender for Office 365 documentation
Preset Security PoliciesMicrosoft Defender for Office 365ConfigurationPreset security policy assignments are Defender portal/Exchange Online configuration, not ARM/Terraform resources. Automate through PowerShell where supported.Preset security policies
Safe AttachmentsMicrosoft Defender for Office 365ProtectionNo azurerm/azapi resource exists for Safe Attachments policies. Use Exchange Online PowerShell or Microsoft365DSC. AlternativeSet up Safe Attachments policies in Microsoft Defender for Office 365
Safe LinksMicrosoft Defender for Office 365ProtectionNo azurerm/azapi resource exists for Exchange Online Protection policies. Manage via Exchange Online PowerShell wrapped in a pipeline task, or via Microsoft365DSC (M365DSCConfig resource EXOSafeLinksPolicy) for a declarative/idempotent alternative. AlternativeMicrosoft Defender for Office 365 Features service description
Threat SubmissionsMicrosoft Defender for Office 365InvestigationThreat submissions are operational actions, not desired-state infrastructure.Use the Microsoft Graph security API
Content HubMicrosoft SentinelContent managementNo azurerm resource exists for Content Hub package installation. Use REST/azapi or deploy the package artifacts as explicit resources.Discover and deploy Microsoft Sentinel out-of-the-box content and solutions
IncidentsMicrosoft SentinelInvestigationIncidents are operational records, not desired-state configuration. Manage incident state through REST/Graph automation, not Terraform.Manage your SOC better with incident metrics in Microsoft SentinelIncidents - REST API
Threat IntelligenceMicrosoft SentinelThreat managementThreat intelligence indicators are operational data. Ingest with the Sentinel STIX upload API from a pipeline/script step, not Terraform.Threat intelligence in Microsoft SentinelImport threat intelligence to Microsoft Sentinel with the upload API
User and Entity Behavior AnalyticsMicrosoft SentinelAnalyticsNo dedicated azurerm resource is recorded for UEBA configuration. Use REST/azapi if automating tenant-specific settings.Identify advanced threats with User and Entity Behavior Analytics in Microsoft Sentinel

Declarative Alternatives

For Microsoft 365 policy surfaces that are not ARM resources, use Microsoft365DSC where it has resource coverage and Microsoft Graph where the policy surface is Graph-native.

Defender for Office Safe Links policy with Microsoft365DSC

powershell
EXOSafeLinksPolicy 'BaselineSafeLinks' {
    Identity                     = 'Baseline Safe Links'
    EnableSafeLinksForEmail      = $true
    EnableSafeLinksForTeams      = $true
    EnableSafeLinksForOffice     = $true
    TrackClicks                  = $true
    AllowClickThrough            = $false
    ScanUrls                     = $true
}

Defender for Office Safe Attachments policy with Microsoft365DSC

powershell
EXOSafeAttachmentPolicy 'BaselineSafeAttachments' {
    Identity           = 'Baseline Safe Attachments'
    Enable             = $true
    Action             = 'Block'
    Redirect           = $false
}

Export Microsoft 365 tenant state with Microsoft365DSC

powershell
Export-M365DSCConfiguration \
  -Components @('EXOSafeLinksPolicy', 'EXOSafeAttachmentPolicy') \
  -Path './m365dsc'

Conditional Access named location with Microsoft Graph

http
POST https://graph.microsoft.com/v1.0/identity/conditionalAccess/namedLocations
Authorization: Bearer <graph-token>
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.ipNamedLocation",
  "displayName": "Corporate egress",
  "isTrusted": true,
  "ipRanges": [
    {
      "@odata.type": "#microsoft.graph.iPv4CidrRange",
      "cidrAddress": "203.0.113.0/24"
    }
  ]
}