ibu-cyx0/Zero-Trust-Network-Simulation-Lab

GitHub: ibu-cyx0/Zero-Trust-Network-Simulation-Lab

基于 NIST 800-207 标准构建的零信任网络模拟实验室,提供微隔离、身份感知策略引擎和 SIEM 监控的全栈安全实验环境。

Stars: 1 | Forks: 0

# 🔐 零信任网络模拟实验室 ![Python](https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white) ![pfSense](https://img.shields.io/badge/pfSense-Firewall-darkblue?logo=pfsense&logoColor=white) ![Wazuh](https://img.shields.io/badge/Wazuh-SIEM-00d4aa) ![NIST](https://img.shields.io/badge/NIST-800--207-green) ![License](https://img.shields.io/badge/License-MIT-yellow) ## 📌 概述 一个基于 VirtualBox 虚拟机、pfSense 防火墙和 Wazuh SIEM 构建的全功能 **零信任网络架构 (ZTNA)** 模拟。实现了 **NIST SP 800-207** 零信任标准,包含: ## 🏗️ 网络架构 ``` ┌─────────────────────┐ │ INTERNET │ │ Trust Level: 0 │ └──────────┬──────────┘ │ ┌────────▼────────┐ │ pfSense FW │ 10.0.0.1 │ Default: DENY │ ← All traffic └────────┬────────┘ ┌──────────┬────────────┴───────────┬──────────┐ │ │ │ │ ┌──────▼──┐ ┌────▼────┐ ┌───────────────▼──┐ ┌───▼──────┐ │ SOC_NET │ │ DEV_NET │ │ MGMT_NET │ │ GUEST │ │10.0.1/24│ │10.0.2/24│ │ 10.0.3/24 │ │192.168/24│ │Trust:80 │ │Trust:70 │ │ Trust:90 │ │Trust:5 │ └─────────┘ └─────────┘ └───────────────────┘ └──────────┘ Splunk Dev Server Admin/SSH Bastion Internet Wazuh Dev WS Management Only Only SOC WS ``` ## 🖥️ 虚拟机设置 (VirtualBox) | 虚拟机 | 操作系统 | IP | 角色 | |---|---|---|---| | **pfsense-fw** | pfSense 2.7 | 10.0.0.1 | 防火墙 / 路由器 | | **wazuh-siem** | Ubuntu 22.04 | 10.0.1.5 | Wazuh SIEM 服务器 | | **splunk-server** | Ubuntu 22.04 | 10.0.1.10 | Splunk Enterprise | | **soc-workstation** | Ubuntu 22.04 | 10.0.1.15 | SOC 分析师工作站 | | **dev-server** | Ubuntu 22.04 | 10.0.2.10 | 开发服务器 | | **mgmt-server** | Ubuntu 22.04 | 10.0.3.5 | 管理堡垒机 | ## 📁 项目结构 ``` zero-trust-lab/ ├── policies/ │ └── policy_engine.py # Zero Trust access evaluator ├── monitor/ │ ├── zt_monitor.py # Wazuh-style alert correlation │ ├── access_log.json # All access events (auto-generated) │ └── alerts.json # Fired alerts (auto-generated) ├── scripts/ │ └── segmentation.py # Network zone + pfSense rule generator ├── docs/ │ ├── pfsense_rules.xml # pfSense firewall export │ ├── firewall_rules.json # All 13 micro-segmentation rules │ └── network_zones.json # Zone definitions + host inventory ├── dashboard/ │ └── index.html # Live ZT monitoring dashboard ├── main.py # Full pipeline runner └── README.md ``` ## ⚙️ 设置与运行 ``` git clone https://github.com/ibu-cyx0/zero-trust-lab cd zero-trust-lab pip install -r requirements.txt # Run full simulation python main.py # Open dashboard open dashboard/index.html ``` ## 🔐 零信任策略引擎 每个访问请求都会根据 **5 个条件** 进行评估 — 所有条件都必须通过: ``` # Evaluation order (deny-first) 1. Device Trust → Is this a managed/corporate device? 2. MFA Status → Has the user authenticated with MFA? 3. User Role → Does this role have access to this resource? 4. Source IP → Is the IP in the allowed subnet for this resource? 5. Time Window → Is access within allowed hours? # Result → ALL PASS : ALLOW (log event, low risk score) → ANY FAIL : DENY (log event, high risk score, alert if suspicious) ``` ## 🛡️ pfSense 防火墙规则 (13 条规则) | 规则 ID | 动作 | 源地址 | 目标地址 | 描述 | |---|---|---|---|---| | FW-000 | 阻止 | 任意 | 任意 | 默认全部拒绝 | | FW-001 | 允许 | 互联网 | DMZ:443 | 仅允许入站 HTTPS | | FW-010 | 允许 | SOC_NET | Splunk:8000 | SOC → Splunk Web | | FW-012 | 阻止 | SOC_NET | DEV_NET | 阻止横向移动 | | FW-020 | 允许 | MGMT:3.5 | any:22 | 管理员 SSH (时间限制) | | FW-031 | 阻止 | DEV_NET | SOC_NET | Dev → SOC 微隔离 | | FW-041 | 阻止 | GUEST | 10.0.0.0/8 | 访客 → 内部阻止 | ## 🚨 MITRE ATT&CK 检测 | 告警 | MITRE 技术 | 严重性 | |---|---|---| | SSH 暴力破解 | T1110 — 暴力破解 | 🔴 严重 | | 横向移动 | T1021 — 远程服务 | 🔴 严重 | | 外部 IP 访问 | T1133 — 外部远程服务 | 🟠 高危 | | 非托管设备 | T1200 — 硬件添加 | 🟠 高危 | | 非工作时间访问 | T1078 — 有效账户 | 🟠 高危 | | 权限滥用 | T1078 — 有效账户 | 🟡 中危 | ## 📊 结果 ``` Access Requests Evaluated : 10 Requests Allowed : 4 (40%) Requests Denied : 6 (60%) Critical Alerts Fired : 2 Total Alerts : 7 Firewall Rules Applied : 13 Network Zones Isolated : 4 ``` ## 🗺️ 路线图 - [ ] OpenVPN + 基于证书的身份认证 - [ ] 通过 Wazuh → pfSense 自动化 IP 黑名单 - [ ] LDAP/Active Directory 集成 - [ ] 仪表盘实时 Wazuh API 集成 - [ ] 自动化事件剧本 (Python) ## 👤 作者 **Mohamed Ibrahim H** EC-Council 认证 SOC 分析师 (CSA) | Splunk Core 认证用户 | Cisco Cyber Ops Associate - GitHub: [@ibu-cyx0](https://github.com/ibu-cyx0) - TryHackMe: [@IbrahimCyb3r4](https://tryhackme.com/p/IbrahimCyb3r4) - 电子邮件: ibrahim.cybrx@gmail.com ## 📄 许可证 MIT 许可证
标签:NIST 800-207, pfSense, 网络安全, 网络微隔离, 网络架构模拟, 逆向工具, 隐私保护, 零信任网络