A production-ready, enterprise-grade Security Orchestration, Automation, and Response (SOAR) platform that consolidates Microsoft Defender product capabilities with advanced risk scoring, entity normalization, and multi-tenant support for MSSP environments.
Deploy DefenderXSOAR to Azure in minutes with our one-click deployment:
π Complete Deployment Guide | π§ Prerequisites | π Architecture
DefenderXSOAR is a comprehensive orchestration platform that:
- Integrates all Microsoft Defender products (MDE, MDC, MCAS, MDI, MDO, Entra ID)
- Normalizes entities across different security products using official Microsoft Sentinel entity schemas
- Calculates risk scores using a unified scoring engine (Microsoft + STAT + Custom)
- Automates incident response decisions with ML-like analytics
- Supports multi-tenant MSSP scenarios
- Provides production-ready hunting playbooks with real KQL queries
- Uses direct Microsoft API calls (no Logic Apps connectors required)
- Executes workers in parallel for improved performance
- Implements circuit breaker patterns for resilience
DefenderXSOAR/
βββ Modules/
β βββ DefenderXSOARBrain.psm1 # Central orchestrator
β βββ Common/
β β βββ AuthenticationHelper.psm1 # Multi-tenant auth
β β βββ EntityNormalizer.psm1 # Entity unification
β β βββ DataTableManager.psm1 # Log Analytics integration
β β βββ UnifiedRiskScorer.psm1 # β NEW: Unified risk scoring engine
β βββ Workers/
β β βββ MDEWorker.psm1 # Microsoft Defender for Endpoint
β β βββ MDCWorker.psm1 # Microsoft Defender for Cloud
β β βββ MCASWorker.psm1 # Microsoft Defender for Cloud Apps
β β βββ MDIWorker.psm1 # Microsoft Defender for Identity
β β βββ MDOWorker.psm1 # Microsoft Defender for Office 365
β β βββ EntraIDWorker.psm1 # Microsoft Entra ID
β βββ Playbooks/
β βββ MDEPlaybooks.psm1 # MDE hunting queries
β βββ MDCPlaybooks.psm1 # MDC hunting queries
β βββ MCASPlaybooks.psm1 # MCAS hunting queries
β βββ MDIPlaybooks.psm1 # MDI hunting queries
β βββ MDOPlaybooks.psm1 # MDO hunting queries
β βββ EntraIDPlaybooks.psm1 # Entra ID hunting queries
βββ Functions/
β βββ Start-DefenderXSOAROrchestration.ps1 # Main entry point
βββ Config/
β βββ DefenderXSOAR.json # Configuration template
βββ Deploy/
βββ defenderxsoar-deploy.json # ARM template
βββ createUiDefinition.json # Azure Portal UI
βββ Deploy-DefenderXSOAR.ps1 # Legacy deployment script
βββ Deploy-DefenderXSOARCode.ps1 # Code deployment
βββ Grant-DefenderXSOARPermissions.ps1 # Permission setup (β
Included)
βββ Configure-DefenderXSOAR.ps1 # Post-deployment config
βββ Test-DefenderXSOAR.ps1 # Validation tests
βββ Create-MultiTenantApp.ps1 # MSSP app registration
βββ Grant-CustomerConsent.ps1 # Customer consent workflow
βββ Setup-Monitoring.ps1 # Monitoring configuration
βββ Documentation/ # Complete documentation
βββ Prerequisites.md
βββ Permissions.md
βββ Architecture.md
βββ Deployment.md # β
New: Complete deployment guide
βββ Configuration.md # β
New: Configuration guide
βββ API-Reference.md # β
New: API documentation
βββ Troubleshooting.md
βββ Upgrade.md
- Device compromise detection
- Malware analysis and file reputation
- Process tree analysis
- Network connection analysis
- Lateral movement detection
- Advanced hunting with KQL
- Cloud security posture analysis
- Vulnerability assessment
- Compliance deviation detection
- Resource configuration analysis
- Azure Secure Score integration
- Cloud app risk assessment
- Data exfiltration detection
- User behavior analytics (UEBA)
- OAuth app analysis
- Anomaly detection
- Identity compromise detection
- Lateral movement analysis
- Privilege escalation detection
- Kerberos attack detection (Golden/Silver Ticket)
- Active Directory security
- Phishing campaign detection
- Safe Attachments analysis
- Email security posture
- Collaboration security (Teams/SharePoint)
- Threat intelligence integration
- Risky sign-in analysis
- Conditional Access violations
- Identity Protection alerts
- MFA bypass detection
- Anomalous authentication patterns
- Centralized Orchestration: Controls all workers and coordinates enrichment
- Decision Engine: Makes intelligent decisions on incident handling (escalate, investigate, close)
- Risk Scoring: Advanced risk calculation across all products
- Multi-Tenant: Full MSSP support with tenant isolation
- Workflow Integration: Triggers external Logic Apps/Function Apps
- Unified entity format across all products
- Support for: Users, Devices, IPs, Files, URLs, Processes, Emails, Cloud Apps, Azure Resources
- Automatic entity correlation and deduplication
- Unified Risk Scoring Engine: Combines Microsoft native scores (35%), STAT analytics (35%), and custom scoring (30%)
- ML-like Feature Extraction: Behavioral patterns, temporal analysis, geographic anomalies
- Confidence Scoring: Score agreement validation and data completeness checks
- Contextual Adjustments: After-hours boost, critical asset boost
- Explainability: Detailed breakdown of scoring factors and top contributors
- Actionable Recommendations: Risk-based guidance for incident response
- Product-weighted risk calculation (fallback mode)
- Threat intelligence integration
- UEBA behavioral analysis
- Configurable thresholds and weights
- Custom Log Analytics table (DefenderXSOAR_CL)
- Automatic incident comments
- Workbook-ready data structure
- 90-day retention by default
Deploy DefenderXSOAR to Azure in minutes with our comprehensive deployment package:
- β Azure Function App (PowerShell 7.2 runtime)
- β Storage Account (Standard_LRS)
- β Key Vault (RBAC-enabled, soft delete)
- β Application Insights (linked to Sentinel)
- β System-Assigned Managed Identity
- β Pre-configured application settings
- ARM Template: ~5 minutes
- Post-deployment scripts: ~20 minutes
- Total: ~30 minutes
- Consumption Plan: $30-130/month
- Premium EP1: $215-318/month
π Complete Deployment Guide | Prerequisites | Troubleshooting
- PowerShell 7.0 or later
- Azure subscription with Sentinel workspace
- Azure AD app registration with appropriate permissions
- Access to Microsoft Defender products
- Log Analytics workspace
git clone https://github.com/akefallonitis/defenderc2enrichement.git
cd defenderc2enrichement/DefenderXSOAR.\Deploy\Deploy-DefenderXSOAR.ps1 `
-SubscriptionId "your-subscription-id" `
-ResourceGroupName "DefenderXSOAR-RG" `
-Location "eastus" `
-WorkspaceName "defenderxsoar-workspace" `
-CreateAppRegistration $true.\Deploy\Grant-DefenderXSOARPermissions.ps1 `
-ApplicationId "your-app-id" `
-TenantId "your-tenant-id"Follow the on-screen instructions to grant required permissions in Azure Portal.
Edit Config/DefenderXSOAR.json with your environment details:
{
"Tenants": [
{
"TenantName": "Production",
"TenantId": "your-tenant-id",
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"SubscriptionId": "your-subscription-id",
"Enabled": true
}
],
"LogAnalytics": {
"Enabled": true,
"WorkspaceId": "your-workspace-id",
"SharedKey": "your-shared-key"
}
}# Import the orchestration function
. .\Functions\Start-DefenderXSOAROrchestration.ps1
# Define incident entities
$entities = @(
@{
Type = "User"
UserPrincipalName = "user@domain.com"
},
@{
Type = "Device"
HostName = "DESKTOP-001"
},
@{
Type = "IP"
Address = "192.168.1.100"
}
)
# Start orchestration
$result = .\Functions\Start-DefenderXSOAROrchestration.ps1 `
-ConfigPath ".\Config\DefenderXSOAR.json" `
-IncidentId "12345" `
-IncidentArmId "/subscriptions/.../incidents/12345" `
-Entities $entities `
-TenantId "your-tenant-id" `
-Products @('MDE', 'MDC', 'MCAS', 'MDI', 'MDO', 'EntraID'){
"type": "Function",
"inputs": {
"method": "POST",
"body": {
"IncidentId": "@{triggerBody()?['object']?['properties']?['incidentNumber']}",
"IncidentArmId": "@{triggerBody()?['object']?['id']}",
"Entities": "@{triggerBody()?['object']?['properties']?['entities']}",
"TenantId": "@parameters('TenantId')"
},
"function": {
"id": "/subscriptions/.../functions/DefenderXSOAR"
}
}
}Create an automation rule in Sentinel:
- Trigger: When incident is created
- Condition: Incident severity is Medium or higher
- Action: Run playbook β DefenderXSOAR
- Result: Automatic enrichment and incident comments
- DeviceCompromiseDetection: Detects device compromise indicators
- MalwareAnalysis: Comprehensive malware analysis
- ProcessTreeAnalysis: Analyzes process hierarchies
- NetworkConnectionAnalysis: Identifies suspicious network activity
- FileReputationCheck: Assesses file reputation
- LateralMovementDetection: Detects lateral movement
- SecurityPostureAnalysis: Cloud security posture
- VulnerabilityAssessment: Vulnerability prioritization
- ComplianceDeviation: Compliance gap analysis
- ResourceConfigAnalysis: Configuration change analysis
- CloudAppRiskAssessment: Cloud app risk scoring
- DataExfiltrationDetection: Data exfiltration patterns
- UserBehaviorAnalytics: UEBA analysis
- OAuthAppAnalysis: OAuth application risks
- IdentityCompromiseDetection: Identity compromise indicators
- LateralMovementAnalysis: Lateral movement patterns
- PrivilegeEscalationDetection: Privilege escalation attempts
- KerberosAttackDetection: Kerberos-based attacks
- PhishingCampaignDetection: Phishing campaigns
- SafeAttachmentsAnalysis: Malicious attachments
- EmailSecurityAnalysis: Email security posture
- CollaborationSecurity: Teams/SharePoint security
- RiskySignInAnalysis: Risky authentication events
- ConditionalAccessViolations: CA policy violations
- IdentityProtectionAlerts: Identity risk detections
- MFABypassAttempts: MFA bypass detection
- AnomalousSignInPatterns: Behavioral anomalies
- SecurityEvents.Read.All
- SecurityAlert.Read.All
- IdentityRiskEvent.Read.All
- IdentityRiskyUser.Read.All
- User.Read.All
- AuditLog.Read.All
- Directory.Read.All
- Machine.Read.All
- Alert.Read.All
- File.Read.All
- AdvancedQuery.Read.All
- Vulnerability.Read.All
- Security Reader
- Log Analytics Reader
DefenderXSOAR_CL
βββ TimeGenerated
βββ IncidentId
βββ Product
βββ RiskScore
βββ Severity
βββ EntitiesCount
βββ RelatedAlertsCount
βββ ThreatIntelCount
βββ WatchlistMatches
βββ UEBAInsights
βββ Recommendations
βββ EnrichmentData (JSON)
## DefenderXSOAR Enrichment Results
**Product:** All Products
**Risk Score:** 75/100
**Severity:** High
### Entities Analyzed
15 entities processed
### Related Alerts
23 related alerts found
### Recommendations
- High risk score detected - prioritize investigation
- Multiple behavioral anomalies detected
- User signing in from 15 different IPs - possible account compromise"RiskScoring": {
"Thresholds": {
"Critical": 80,
"High": 60,
"Medium": 40,
"Low": 20
},
"Weights": {
"MDE": 1.2,
"MDC": 1.0,
"MCAS": 1.1,
"MDI": 1.3,
"MDO": 1.0,
"EntraID": 1.2
}
}"IncidentDecisions": {
"AutoEscalate": {
"Enabled": true,
"MinimumRiskScore": 80,
"RequiredThreatIntelCount": 3
},
"AutoClose": {
"Enabled": false,
"MaximumRiskScore": 10
}
}Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- akefallonitis - Initial work
- Microsoft Defender product teams
- Microsoft Sentinel community
- PowerShell community
For issues, questions, or contributions, please open an issue on GitHub.
- v1.0.0 - Initial release with full product integration
- All 6 product workers implemented
- 25+ hunting playbooks with real KQL queries
- Multi-tenant support
- Risk scoring engine
- Log Analytics integration
- Machine learning-based anomaly detection
- Automated remediation actions
- Custom playbook designer
- Advanced threat hunting UI
- Integration with third-party SIEM
- Extended UEBA capabilities
- Threat intelligence enrichment APIs