How azure/microsoft-defender-for-cloud works
Purpose and Entry Points
This is a community automation catalog for operating Microsoft Defender for Cloud (MDC) at scale, not a single deployable application. Root entry points are README.md, Policy/readme.md, Workflow automation/README.md, and Workbooks/README.md. Consumers select and deploy individual Azure Policy definitions, ARM/Bicep templates, Logic Apps, PowerShell scripts, Terraform, dashboards, or query assets.
Governance and Preventive Control Plane
Custom Azure Policy artifacts define audit, deny, deploy-if-not-exists, and modification controls across subscriptions and resources. Policies are the preventive/at-scale boundary: Azure Policy evaluates resource state and can deploy supporting configuration.
• Policy/Configure-DCSPM-Extensions/azurepolicy.json
• Pricing & Settings/Azure Policy definitions/Azure Defender Plans/ASC-AzureDefender-for-All.json
• Remediation Policies/azuredeploy.json
Remediation Implementations
Recommendation remediation is delivered through interchangeable execution mechanisms: Azure Policy for continuous enforcement, ARM-deployed Logic Apps for event-driven remediation, and operator-run PowerShell for imperative bulk actions. This is a catalog of independently deployable solutions rather than a shared runtime.
• Remediation scripts/Enable auditing for the SQL server/Logic App/azuredeploy.json
• Remediation scripts/Enable auditing for the SQL server/PowerShell/Enable-AzSecuritySQLAuditing.ps1
• Remediation scripts/Require secure transfer to storage account/Azure Policy - Deny/Deny Policy.json
Event-Driven Workflow Automation
Workflow templates connect MDC alerts, recommendations, activity, and compliance events to notification, ticketing, reporting, enrichment, or containment actions. ARM templates provision Azure Logic Apps and associated connections; destinations include Azure DevOps, Jira, ServiceNow, Slack, Teams, Event Hubs, and email.
• Workflow automation/Open-DevOpsTaskRecommendation/azuredeploy.json
• Workflow automation/Create-SNOWIncfromASCAlert/azuredeploy.json
• Workflow automation/Export-ASCDataToEventHub/azuredeploy.json
MDC-to-Azure DevOps Connector
The repository contains one cohesive application subsystem: a Python Azure Functions/Durable Functions connector that receives MDC recommendation payloads through a Logic App, enriches and deduplicates them, resolves ownership, creates or updates Azure DevOps work items, assigns them, and renders a triage briefing.
• Trigger boundary: Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/logic-app/workflow.json
• Function entry point and orchestration: Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/function_app.py, Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/orchestrators/enrich_and_create.py
• Processing stages: Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/activities/gather_enrichment.py, Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/activities/dedupe_lookup.py, Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/activities/create_or_update_work_item.py
Connector Infrastructure and External Boundaries
The connector’s Bicep infrastructure provisions Function App, managed identity, Key Vault, Storage, Application Insights, and Logic App. Client adapters isolate calls to MDC, Azure Resource Graph, Microsoft Graph, and Azure DevOps; secrets and identity should remain at these infrastructure/client boundaries.
• Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/infra/main.bicep
• Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/infra/modules/function-app.bicep
• Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/clients/ado_client.py
• Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/clients/arg_client.py
Reporting, Investigation, and Enablement Assets
Kusto/Resource Graph queries supply operational data; Azure Workbooks and Power BI templates visualize it; onboarding, labs, simulations, and scripts support adoption across Azure, AWS, GCP, Azure Arc, and Defender integrations.
• Kusto/Azure Resource Graph/readme.md
• Workbooks/Defender CSPM Dashboard/azuredeploy.json
• PowerBI/MDC Plan Coverage/mdcCoverrage-v2.pbit
• Onboarding/AWS/GrantAccessToEksClusters.py
Main entry points: Workflow automation/README.md Workflow template catalog · enrich_and_create.py Enrich and create orchestrator · main.bicep Connector infrastructure · README.md Community automation catalog
Components 26
Governance & Remediation
Independently deployable policy and remediation assets.
- DCSPM extension policy · Applies preventive and deploy-if-not-exists controls.
Policy/Configure-DCSPM-Extensions/azurepolicy.json - Defender plans policy · Enables Defender plans at scale.
Pricing & Settings/Azure Policy definitions/Azure Defender Plans/ASC-AzureDefender-for-All.json - Remediation policy deployment · Deploys policy-based remediation configuration.
Remediation Policies/azuredeploy.json - SQL auditing remediation · Event-driven SQL auditing remediation.
Remediation scripts/Enable auditing for the SQL server/Logic App/azuredeploy.json - SQL auditing bulk action · Operator-run imperative remediation.
Remediation scripts/Enable auditing for the SQL server/PowerShell/Enable-AzSecuritySQLAuditing.ps1 - Secure transfer deny policy · Prevents noncompliant storage configuration.
Remediation scripts/Require secure transfer to storage account/Azure Policy - Deny/Deny Policy.json
Workflow Automation
ARM-deployed Logic App integrations.
- Workflow template catalog · Integrates MDC events with ticketing, notification, and export targets.
Workflow automation/README.md - DevOps recommendation task flow · Creates Azure DevOps tasks from recommendations.
Workflow automation/Open-DevOpsTaskRecommendation/azuredeploy.json - ServiceNow alert flow · Creates incidents from MDC alerts.
Workflow automation/Create-SNOWIncfromASCAlert/azuredeploy.json - Event Hub export flow · Exports MDC data for downstream processing.
Workflow automation/Export-ASCDataToEventHub/azuredeploy.json
MDC–Azure DevOps Connector
Durable Functions subsystem for recommendation triage.
- Recommendation intake · Receives MDC recommendation payloads.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/logic-app/workflow.json - Durable Functions app · Hosts connector triggers and orchestration.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/function_app.py - Enrich and create orchestrator · Coordinates recommendation triage stages.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/orchestrators/enrich_and_create.py - Recommendation enrichment · Gathers recommendation and ownership context.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/activities/gather_enrichment.py - Deduplication lookup · Finds existing work-item matches.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/activities/dedupe_lookup.py - Work-item upsert · Creates, updates, assigns, and renders triage work items.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/activities/create_or_update_work_item.py - Connector infrastructure · Provisions Function App, identity, Key Vault, Storage, Insights, and Logic App.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/infra/main.bicep - Function App module · Defines the Function App infrastructure boundary.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/infra/modules/function-app.bicep - Azure DevOps client · Isolates Azure DevOps work-item calls.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/clients/ado_client.py - Resource Graph client · Retrieves Azure resource context.
Workflow automation/MDC-Recommendations-to-AzureDevOps-Connector/src/function/clients/arg_client.py
Reporting & Enablement
Operational data, visualizations, and onboarding assets.
- Operational query assets · Supply investigation and reporting data.
Kusto/Azure Resource Graph/readme.md - Defender CSPM dashboard · Visualizes MDC operational data.
Workbooks/Defender CSPM Dashboard/azuredeploy.json - MDC plan coverage report · Reports Defender plan coverage.
PowerBI/MDC Plan Coverage/mdcCoverrage-v2.pbit - AWS EKS onboarding · Supports multi-cloud Defender adoption.
Onboarding/AWS/GrantAccessToEksClusters.py
Other components
- Community automation catalog · Consumers select and deploy individual assets.
README.md - Azure DevOps · Receives assigned triage work items.
Connections 23
- Community automation catalog → DCSPM extension policy: catalogs
- Community automation catalog → Workflow template catalog: catalogs
- Community automation catalog → Operational query assets: catalogs
- DCSPM extension policy → Remediation policy deployment: deploys supporting configuration
- Defender plans policy → Remediation policy deployment: enforces through
- Secure transfer deny policy → Remediation policy deployment: complements
- SQL auditing remediation → SQL auditing bulk action: alternative remediation
- Workflow template catalog → DevOps recommendation task flow: includes
- Workflow template catalog → ServiceNow alert flow: includes
- Workflow template catalog → Event Hub export flow: includes
- Connector infrastructure → Function App module: composes
- Connector infrastructure → Recommendation intake: provisions
- Connector infrastructure → Durable Functions app: provisions
- Recommendation intake → Durable Functions app: sends recommendations
- Durable Functions app → Enrich and create orchestrator: starts
- Enrich and create orchestrator → Recommendation enrichment: gathers context
- Enrich and create orchestrator → Deduplication lookup: checks duplicates
- Enrich and create orchestrator → Work-item upsert: upserts triage item
- Recommendation enrichment → Resource Graph client: queries through
- Work-item upsert → Azure DevOps client: uses
- Azure DevOps client → Azure DevOps: creates or updates
- Operational query assets → Defender CSPM dashboard: feeds
- Operational query assets → MDC plan coverage report: feeds