ijaz-aj/detection-as-code

GitHub: ijaz-aj/detection-as-code

一个基于 Sigma 规则与 CI/CD 流水线的 Detection-as-Code 检测工程项目,通过家庭实验室和 Atomic Red Team 攻击模拟实现端到端的威胁检测工程实践。

Stars: 0 | Forks: 0

# Detection-as-Code 一个公开、可复现的 **Detection-as-Code** 作品集项目:受版本控制的 [Sigma](https://github.com/SigmaHQ/sigma) 检测规则映射到 [MITRE ATT&CK](https://attack.mitre.org/),并在真实的家庭实验室中使用 [Atomic Red Team](https://github.com/redcanaryco/atomic-red-team) 进行验证,通过 CI/CD pipeline 交付 —— 正如现代检测工程团队在生产环境中管理检测的方式。 ## 本项目展示的内容 - **检测工程** — 包含完整 metadata 的 Sigma 规则,映射到 ATT&CK techniques, 自动编译为 Splunk SPL、Microsoft Sentinel (KQL) 和 Elastic。 - **可复现的家庭实验室** — 一个运行 Sysmon 的 Windows VM,通过 Elastic Agent 将遥测数据发送到 Elastic Security。 - **紫队验证** — 由 Atomic Red Team 驱动的 *攻击 → 检测 → 调优* 循环。 - **检测的 CI/CD** — 一个 GitHub Actions pipeline,在每次 push 时对每条规则进行 lint、验证和测试编译。 - **ATT&CK 覆盖率可视化** — 自动生成的 MITRE ATT&CK Navigator 层。 - **安全自动化** — 一个具备 API enrichment 和免密钥演示模式的 Python 钓鱼 / IOC 分诊工具。 ## 仓库布局 ``` detection-as-code/ ├── detections/ # Sigma rules, organized by ATT&CK tactic ├── tests/ # pytest suite that validates every rule against the standard ├── automation/ # Python phishing / IOC triage tool ├── lab/ # Home-lab setup (Docker Compose, agent configs, lab README) ├── docs/ # Detection standard, case studies, coverage map, screenshots │ ├── case-studies/ # One attack→detect→tune writeup per technique │ ├── reports/ # Generated triage reports (gitignored) │ └── screenshots/ # Evidence screenshots └── .github/workflows/ # CI/CD pipeline ``` ## 技术栈 | 领域 | 工具 | |------|------| | 检测语言 | Sigma (通过 `sigma-cli` / pySigma 转换) | | 实验室 SIEM | Elastic Security (单节点,Docker) | | Endpoint 遥测 | Windows VM + Sysmon (SwiftOnSecurity config) + Elastic Agent | | 攻击模拟 | Atomic Red Team | | CI/CD | GitHub Actions | | 自动化 | Python 3.11+ (标准库 + `requests`) | ## 快速开始 ## 许可证 [MIT](LICENSE) © ijaz-aj
标签:AMSI绕过, Elastic Security, Python, 代码化检测, 威胁检测, 安全规则引擎, 安全运营, 扫描框架, 无后门, 请求拦截, 逆向工具