anishvedant/AzureSOC
GitHub: anishvedant/AzureSOC
一键部署的 Azure 云 SOC 实验环境,集成 AD、Sentinel SIEM、Suricata IDS 和 10 种 MITRE ATT&CK 攻击模拟,用于安全运营实战学习。
Stars: 0 | Forks: 0
# AzureSOC - 云安全运营中心
使用一条命令在 Azure 上部署完整的 SOC 实验环境。包含 Active Directory、Microsoft Sentinel SIEM、Suricata IDS、Sysmon 和 MITRE ATT&CK 攻击模拟。
## 部署
```
git clone https://github.com/anishvedant/AzureSOC.git
cd AzureSOC
az login
.\scripts\setup\master-deploy.ps1 -AdminPassword "YourStr0ngP@ss!"
```
自动扫描 10 个区域和 7 种 VM 规格。部署耗时 20–40 分钟。
**部署后 - 连接日志到 Sentinel:**
Portal → Microsoft Sentinel → law-azuresoc → Data connectors → Windows Security Events via AMA → Create DCR → select vm-dc01 → All Security Events
## 架构
```
┌─────────────────────────────────────────────────────────────────────────┐
│ INTERNET (Your laptop) │
└──────────────────┬──────────────────────┬───────────────────────────────┘
│ RDP :3389 │ SSH :22 / HTTP :80
│ │
┌──────────────────┴──────────────────────┴──────────────────────────────┐
│ Azure VNet: vnet-azuresoc (10.0.0.0/16) │
│ │
│ ┌────────────────────────────┐ ┌─────────────────────────────┐ │
│ │ snet-dc (10.0.1.0/24) │ │ snet-splunk (10.0.2.0/24) │ │
│ │ NSG: RDP + AD ports │ │ NSG: SSH + HTTP │ │
│ │ │ │ │ │
│ │ vm-dc01 (10.0.1.4) │ │ vm-splunk (10.0.2.4) │ │
│ │ Windows Server 2022 │ │ Ubuntu 22.04 LTS │ │
│ │ • Active Directory │nmap │ • Suricata IDS (65K rules) │ │
│ │ • DNS + Kerberos ◄───┼─────┤ • Apache 2.4 (honeypot) │ │
│ │ • Sysmon v15 │hydra│ • nmap, nikto, hydra │ │
│ │ • Azure Monitor Agent │nikto│ (attack tools) │ │
│ │ • 11 AD Users │ │ │ │
│ └────────────┬───────────────┘ └─────────────────────────────┘ │
│ │ │
│ │ SecurityEvent + Sysmon via AMA │
│ ┌────────────┴──────────────────────────────────────────────────┐ │
│ │ snet-honeypot (10.0.3.0/24) - NSG: ALLOW ALL (future trap) │ │
│ └───────────────────────────────────────────────────────────────┘ │
└───────────────────────────────┬────────────────────────────────────────┘
│
┌─────────────────┴──────────────────────┐
│ Data Collection Rule → Log Analytics │
│ → Microsoft Sentinel (SIEM) │
│ • 8 Data Connectors │
│ • 1000+ Security Events │
│ • Custom KQL Analytics Rules │
│ • Automated Incident Creation │
└────────────────────────────────────────┘
Supporting: Key Vault (secrets) • Storage Account (flow logs) • Network Watcher
```
共 18 项资源:2 台 VM、VNet、3 个 NSG、Sentinel、Key Vault、Storage、DCR、NICs、Public IPs、Network Watcher。
## 执行攻击
```
.\scripts\attack\run-attacks.ps1 -Action all # Scan + honeypot + web scan
.\scripts\attack\run-attacks.ps1 -Action scan # Nmap port scan
.\scripts\attack\run-attacks.ps1 -Action bruteforce # RDP brute force
```
AD 攻击(通过 RDP 在 DC 上手动运行):
```
net user /domain # T1087 Account Discovery
Add-Type -AssemblyName System.IdentityModel
New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/dc01.azuresoc.local:1433" # T1558.003 Kerberoasting
schtasks /create /tn "Test" /tr "cmd /c echo test" /sc hourly /f # T1053.005 Persistence
powershell -EncodedCommand dwBoAG8AYQBtAGkA # T1059.001 Encoded PS
wevtutil cl "Windows PowerShell" # T1070.001 Log Clearing
```
在 Sentinel → Logs 中检测:
```
SecurityEvent
| where TimeGenerated > ago(1h)
| where EventID in (4688, 4624, 4625, 4672, 4698, 4769, 1102)
| project TimeGenerated, EventID, Activity, Account, CommandLine
| sort by TimeGenerated desc
```
## MITRE ATT&CK 覆盖范围
| 技术 | ID | 检测 |
|-----------|----|-----------|
| Network Scanning | T1046 | Nmap + NSG logs |
| Brute Force RDP | T1110.001 | EventID 4625 analytics rule |
| Kerberoasting | T1558.003 | EventID 4769 |
| Account Discovery | T1087.001 | CommandLine monitoring |
| Encoded PowerShell | T1059.001 | EncodedCommand detection |
| Scheduled Task | T1053.005 | EventID 4698 |
| Log Clearing | T1070.001 | EventID 1102 |
| Web Scanning | T1595.002 | Nikto + Apache logs |
| SMB Enumeration | T1021.002 | EventID 5140 |
| LSASS Access | T1003.001 | Sysmon Event 10 |
## 管理
```
.\scripts\setup\verify-all.ps1 # Health check
.\scripts\setup\stop-all.ps1 # Stop VMs (~$0/hr)
.\scripts\setup\start-all.ps1 # Resume
```
成本:每次 8 小时会话约 $3。停止时约 $0.10/天。
## 仓库结构
```
├── infra/main.bicep # Bicep IaC (18 resources)
├── scripts/
│ ├── setup/
│ │ ├── master-deploy.ps1 # One-command deployment
│ │ ├── verify-all.ps1 # Health check
│ │ ├── start-all.ps1 / stop-all.ps1 # Cost management
│ ├── attack/
│ │ └── run-attacks.ps1 # All attacks in one script
│ └── detection/
│ └── sentinel-rules/all-detections.kql # 10 KQL rules
└── cspm/cspm_audit.py # Azure posture scanner
```
## 完整报告
包含网络拓扑、Kerberos 流程详解、从攻击到检测的管道以及取证截图的完整文档:
**[AzureSOC - 完整 SOC 实验报告](https://www.notion.so/32c021e08b218123a013fbbbccdbbbfc)**
## 许可证
MIT
标签:Active Directory, AI合规, AMSI绕过, Azure, Cloudflare, EDR, IPv6, KQL, Libemu, Metaprompt, Microsoft Sentinel, MITRE ATT&CK, OpenCanary, Plaso, PowerShell, RFI远程文件包含, Suricata, Sysmon, Terraform 安全, Windows 安全, 入侵检测系统, 威胁检测, 安全数据湖, 安全运营中心, 实验室, 底层分析, 攻击模拟, 时间线生成, 特权提升, 现代安全运营, 网络安全, 网络映射, 脆弱性评估, 脚本, 自动化部署, 逆向工具, 防御策略, 隐私保护, 驱动签名利用, 黑客技术