hassanzahid176/SDA-Pro
GitHub: hassanzahid176/SDA-Pro
SDA-Pro:安全事件响应与威胁缓解平台
Stars: 0 | Forks: 0
# SDA-Pro — 安全事件响应与威胁缓解平台
**软件设计与架构 — 学期项目**
| 字段 | 详细信息 |
|---|---|
| **项目名称** | SDA-Pro — 安全事件响应与威胁缓解平台 |
| **团队成员** | Hassan Zahid (54481) · Malik Hamza Shahid (54523) |
| **提交日期** | 2026年6月3日 |
| **语言** | Java |
## 主端到端流程
```
Mock Splunk / Firewall / CrowdStrike Alert
→ Adapter converts external format into RawAlert
→ Factory Method selects AlertNormalizer
→ RawAlert becomes CanonicalAlert
→ Composite groups alerts into AlertCampaign / IncidentCluster
→ Abstract Factory builds enrichment pipeline (Premium or Standard tier)
→ Chain of Responsibility enriches alert (Dedup → GeoIP → ThreatIntel → Asset → Classify)
→ Caching Proxy + Rate Limit Proxy + Access Control Proxy wrap the ThreatIntel adapter
→ Incident is created and published via Singleton EventBusPublisher (Observer)
→ State Pattern controls incident lifecycle (New → Triage → Containment → Eradication → Recovery → Review → Closed)
→ Strategy selects response actions (Aggressive / Balanced / Conservative / WatchAndWait)
→ Factory Method creates actions (BlockIP, IsolateEndpoint, DisableUser, QuarantineFile, Escalate)
→ Decorator adds Audit / ApprovalGate / Rollback / Metrics layers
→ Proxy checks authorization before execution
→ Facade orchestrates the entire response workflow
→ Observer / EventBus updates dashboard, audit, notification, and metrics
→ MVC Dashboard renders real-time analyst view
```
## 运行方法
### Linux / macOS / Git Bash
```
javac -d out $(find src -name "*.java")
java -cp out MainDemo
```
### Windows PowerShell
```
Get-ChildItem -Recurse src -Filter *.java | ForEach-Object { $_.FullName } > sources.txt
javac -d out @sources.txt
java -cp out MainDemo
```
### Docker Compose
```
docker compose up --build
```
### Makefile
```
make run
make smoke
```
## 设计模式(全部12种)
| # | 模式 | 主要类 | 目的 |
|---|---|---|---|
| 1 | **单例** | `IngestionConfigManager`, `ThreatIntelCache`, `EventBusPublisher` | 共享配置、缓存和事件总线 |
| 2 | **工厂方法** | `AlertNormalizerFactory`, `ResponseActionFactory` | 创建标准化器和响应动作 |
| 3 | **抽象工厂** | `EnrichmentProviderFactory`, `PremiumEnrichmentFactory`, `StandardEnrichmentFactory`, `NotificationFactory` | 创建一系列增强提供者和通知通道 |
| 4 | **组合** | `AlertComponent`, `SingleAlert`, `AlertCampaign`, `IncidentCluster` | 统一处理单个和分组警报 |
| 5 | **外观** | `IncidentResponseFacade` | 简化响应编排 |
| 6 | **适配器** | `SplunkAdapter`, `FirewallAdapter`, `CrowdStrikeAdapter`, `VirusTotalAdapter`, `MISPAdapter` | 将外部格式转换为内部合约 |
| 7 | **装饰器** | `AuditLogDecorator`, `ApprovalGateDecorator`, `RollbackDecorator`, `MetricsDecorator` | 动态添加响应动作的行为 |
| 8 | **代理** | `CachingThreatIntelProxy`, `RateLimitThreatIntelProxy`, `AccessControlThreatIntelProxy`, `AuthorizedResponseActionProxy` | 缓存查找、速率限制和授权 |
| 9 | **状态** | `NewState`, `UnderTriageState`, `ContainmentState`, `EradicationState`, `RecoveryState`, `PostIncidentReviewState`, `ClosedState` | 控制事件的生命周期行为 |
| 10 | **责任链** | `EnrichmentHandler` + 5 handlers | 通过增强阶段处理警报 |
| 11 | **观察者** | `EventBusPublisher`, `DashboardUpdater`, `AuditLogger`, `NotificationDispatcher`, `MetricsCollector` | 通知模块关于领域事件 |
| 12 | **策略** | `AggressiveContainmentStrategy`, `BalancedStrategy`, `ConservativeStrategy`, `WatchAndWaitStrategy` | 根据严重性/上下文选择响应算法 |
## 架构风格(全部4种)
| 风格 | 证据 |
|---|---|
| **SOA** | 分离的服务包:`ingestion`, `enrichment`, `incident`, `response`, `threatintel`, `notification`, `audit` |
| **MVC** | `dashboard/controllers/`, `dashboard/models/`, `dashboard/views/` |
| **分层** | 适配器 → 标准化器 → 服务 → 每个模块内的领域分离 |
| **事件驱动** | `EventBusPublisher` 与类型化的 `DomainEvent`,通过 `EventType` 进行 pub/sub,4 个观察者订阅者 |
## 文档
- `docs/adr/` — 架构决策记录(ADR-001 至 ADR-005)
- `docs/api/` — API 合约和事件模式
- `docs/uml/` — PlantUML 源文件(类、组件、序列图)
- `demo-output.txt` — 完整运行示例的样本控制台输出
- `screenshots/` — 最终截图证据
- `tests/` — 烟雾测试和记录的测试用例
- `docs/evidence/` — 截图清单和提交证据指南
## 项目备注
此原型使用模拟适配器和内存存储,以便与 plain `javac`、Makefile 或 Docker Compose 一起运行。架构已完全记录,并设计为可扩展到真实的 API、PostgreSQL、Redis、RabbitMQ/Kafka 以及 WebSocket/SSE 仪表板更新。
标签:Docker, Git, Java平台, Java编译, Java运行, JS文件枚举, Makefile, MVC架构, SOA, 事件总线, 事件驱动架构, 代理模式, 代码示例, 仪表盘, 分层架构, 响应策略, 域名枚举, 威胁情报, 威胁缓解, 安全事件响应, 安全运营中心, 安全防御评估, 安全防护, 实时分析, 审计, 工厂模式, 开发者工具, 报警处理, 授权控制, 提示词模板, 数据分析, 状态模式, 策略模式, 组合模式, 缓存, 网络映射, 自动化响应, 装饰者模式, 观察者模式, 设计模式, 责任链模式, 资产分类