stoptalkingishh/cei-labs-engine

GitHub: stoptalkingishh/cei-labs-engine

CEI Labs Engine 是一个基于 K3s 的网络安全靶场和培训平台。

Stars: 0 | Forks: 0

# cei-labs-engine CEI Labs 是一个模块化、多租户的网络安全靶场,基于轻量级的 K3s mini-PC 集群构建。旨在将核心基础设施与各个模块解耦,CEI Labs 作为不断发展的平台,能够编排各种夺旗环境、威胁狩猎沙盒和深度网络分析管道。 # CEI Labs // CTF 基础设施引擎 一个自托管的、渐进式网络安全培训平台,为总统杯网络安全竞赛(PCCC)流程构建。支持跨平台、操作系统独立的 K3s 拓扑结构,支持独立单主机、双主机或高可用三节点配置运行 CTFd、MultiJuicer(OWASP Juice Shop)、SSH 分析容器、Kali noVNC 工作站和自托管的靶场包装器。 ## 核心系统操作系统基准 ### 1. 单节点部署基准 * **本地环境:** 运行标准 Linux 发行版的单个物理机器(内核 5.15+)。 * **非 Linux 降级:** 如果您的首选工作站运行 Windows 或 macOS,您**必须**使用本地虚拟机管理程序(例如,Proxmox VE、VirtualBox、VMware Workstation、Hyper-V 或 Parallels)配置 Linux 虚拟机,并分配以下概述的最低硬件规格。 ### 2. 多节点部署基准(双节点/集群) * **本地分布式环境:** 运行独立 Linux 操作系统发行版实例的单独物理或虚拟目标机器。所有目标节点必须与具有静态 IP 分配的统一局域网(LAN)共享。 * **虚拟机管理程序/云环境:** 可以通过启动所需的独立 Linux 最小服务器实例,在虚拟化基础设施环境中完全编排(例如,Proxmox VE、VMware ESXi、AWS VPC 或 Google Cloud Compute Engine)。 * **支持的发行版:** 自动化脚本在 **Ubuntu/Debian (`apt`)**、**RHEL/Fedora/Rocky Linux (`dnf`)** 和 **Arch Linux (`pacman`)** 之间透明地处理多 OS 配置。 ## 确认的依赖版本 | 组件 | 版本 | 来源 / 备注 | |---|---|---| | **K3s** | v1.32.5+k3s1 | 稳定版 — 单服务器 SQLite 控制平面 | | **Helm** | v4.2.0 | 功能发布版 — 使用服务器端应用 (SSA) | | **CTFd** | v3.8.2 | 最新稳定版 — 安全修复 | | **MultiJuicer** | v10.0.0 | 最新稳定版 — 根级参数模式布局 | | **OWASP Juice Shop** | v17+ | 通过 MultiJuicer 动态部署 | | **MetalLB** | 最新版 | 原生金属层 2 负载均衡器池 | | **Traefik** | v3.x | 管理 Helm Ingress 处理专用外部 TLS 路由 | | **MariaDB** | 10.11 | ctfd-db 后端存储的固定 PVC | | **Redis** | 7-alpine | CTFd 缓存层 | | **Linux 通用** | 内核 5.15+ | 支持 Debian/Ubuntu、RHEL/Fedora 和 Arch 发行版 | ## 目标环境分配配置文件 在启动部署之前,更新 `ansible/group_vars/all.yml` 以反映您的目标环境资源分配。配置文件根据预期的并发培训小组规模进行扩展: | 部署模式 | 管理主机节点 | 目标 vCPU | 基准 RAM | 目标存储大小 | 推荐组最小值 | |---|---|---|---|---|---| | **single** | 1 节点(组合) | 4 核心 | 16 GB | 100 GB SSD | 评估/最多 10 个用户 | | **dual** | 2 节点(隔离) | 4 + 4 核心 | 16 + 16 GB | 100 + 100 GB SSD | 中型规模/最多 20 个用户 | | **cluster** | 3 节点(高可用专用) | 4 + 4 + 4 核心 | 32 + 16 + 16 GB | 256 + 100 + 100 GB SSD | 企业级/最多 30 个用户 | ## 基础设施布局 & 集群架构拓扑 ┌─────────────────────────────┐ ┌─────────────────────────────┐ │ NODE 1 — 控制平面 │ │ NODE 2 — Juice Shop 工作负载│ │ 最小:4 vCPU / 32GB RAM │ │ 最小:4 vCPU / 16GB RAM │ │ 基准:任何 Linux OS │ │ 基准:任何 Linux OS │ │ │ │ │ │ - K3s 服务器(领导者) │ │ - K3s 代理节点 │ │ - CTFd + MariaDB(PVC) │ │ - 节点标签:role=juiceshop│ │ - 本地仓库(PVC) │ │ - MultiJuicer 实例 │ │ - Traefik / MetalLB │ │ (动态扩展 pod) │ └─────────────────────────────┘ └─────────────────────────────┘ ┌─────────────────────────────┐ │ NODE 3 — 分析师 + 靶机 │ │ 最小:4 vCPU / 16GB RAM │ │ 基准:任何 Linux OS │ │ │ │ - K3s 代理节点 │ │ - 节点标签:role=analyst │ │ - SSH 分析容器 │ │ - Kali noVNC 工作站 │ │ - 自托管的 PCCC 靶机 │ └─────────────────────────────┘ ## 培训冲刺结构(CTFd 闸门) ### 冲刺 1 — 基础流畅度(已解锁) * **实验室:** OverTheWire Bandit(0–15)、CmdChallenge(1–20) * **机制:** 带有静态标志验证的外部目标。 * **闸门:** Bandit 15 和最终 CmdChallenge 的密码解锁冲刺 2。 ### 冲刺 2 — 系统、Web 和取证(已锁定) * **实验室:** OverTheWire Bandit(16–34)、Natas(0–15)、Krypton、Leviathan * **自托管:** OWASP Juice Shop(通过 MultiJuicer 提供 100+ 挑战),PCAP/日志取证 * **闸门:** 需要冲刺 1 完成 + 25 个 Juice Shop 标志 + 5 个 PCAP 挑战。 ### 冲刺 3 — 高级操作(已锁定) * **实验室:** OverTheWire Narnia & Behemoth(二进制利用)、Natas(16–34) * **自托管:** OWASP crAPI(共享实例)、PCCC 技能实验室、历史 PCCC 场景。 * **目的地:** 开放矩阵沙盒;无下游限制。 ## 快速入门(操作系统独立交互式安装器) 范围引擎具有一个便携式部署向导(`scripts/install.sh`),它会动态检查您的 Linux 环境,检测本地软件包管理架构,处理主机依赖注入,并在飞行中配置集群变量。 ### 1. 获取存储库工作区 ``` git clone [https://github.com/stoptalkingishh/cei-labs-engine](https://github.com/stoptalkingishh/cei-labs-engine) cd cei-labs-engine 2. Execute the Provisioning Pipeline Grant execution privileges across the script utilities tree, prepare your localized case volume storage mounts, and trigger the installer: Bash chmod +x scripts/*.sh # 建立法医存储层和用户共享路径 ./scripts/setup-cases.sh # 运行中央交互式配置向导 ./scripts/install.sh 3. Native Package Mapping & Fallback Architecture The initialization pipeline intelligently maps dependency footprints depending on what ecosystem your host machine operates under: Debian / Ubuntu Systems (apt): Configures stable base repositories and patches tooling via advanced packaging utilities. Red Hat / Fedora / Rocky Linux (dnf): Pulls required enterprise utilities, scales repository mirrors, and resolves specific sysstat/moby tracking binary names. Arch Linux (pacman): Synchs database indices and provisions rolling infrastructure dependencies natively via standard pacman targets. Universal Fallback Model: If a standard package manager is absent, the execution layer abstracts dependency compilation to localized Python Pip runtime variables (PIP_BREAK_SYSTEM_PACKAGES=1) to anchor Ansible and jq without interrupting OS integrity. 4. Interactive Configuration Options When running the wizard, you will step through the following dynamic prompts: Dependency Management: Choose Automated Install to let the engine provision your OS-specific packages, or select Manual Validation to run a binary audit against a custom pre-built environment. Orchestration Complexity Profiles: Simple Mode: Tailored for local virtual machines or rapid environment evaluations. Bypasses distributed networking blocks, locks host targets to a localized localhost array, and applies resource-light parameters. Advanced Mode: Unlocks full distributed multi-host topologies (single/dual/cluster), handles layer-2 load balancing configuration flags (MetalLB), and safely spawns an available shell editor text terminal environment (vi or nano) to let you map nodes onto your inventory space directly. Security Token Customization Matrix: Prompts you live to inject unique administrative values (CTFd application secret strings, MariaDB storage backend user passwords, and MultiJuicer control panel master keys) instead of relying on unsafe static defaults. 5. Curriculum Ingestion & Range Performance Metrics Once the cluster state is active, run the following sync utilities to seed training targets and monitor host health parameters: Bash # 填充 OWASP Juice Shop 挑战方案 ./scripts/juice-shop-ctf-import.sh # 摄取底层静态和容器化挑战模块 ./scripts/challenges-load.sh # 启动统一网络范围监控仪表板 ./scripts/status.sh ```
标签:CTF平台, Debian, Fedora, Hyper-V, K3s, NIDS, noVNC, OS独立, Parallels, PCCC, Proxmox VE, RHEL, Rocky Linux, SSH, VirtualBox, VMware, 单节点部署, 多云部署, 多节点部署, 安全培训, 安全竞赛, 容器化, 总统杯网络安全竞赛, 搜索引擎查询, 数字取证, 模块化架构, 沙箱环境, 特权提升, 目标封装, 系统分析, 网络分析, 网络安全, 自动化脚本, 自动化部署, 虚拟化, 请求拦截, 轻量级集群, 隐私保护, 高可用性