atlas-crew/horizon-security-platform
GitHub: atlas-crew/horizon-security-platform
基于 Rust/Pingora 的高性能边缘 WAF 引擎,搭配 Node.js/React 控制平面,实现分布式边缘防护与集群智能管理的一体化平台。
Stars: 0 | Forks: 0
边缘防护与集群智能平台
一个多语言单体仓库,包含基于 Rust 的 WAF/边缘引擎、Node.js 集群智能 API、React 仪表板以及相关的 TypeScript 库。
## 架构
```
apps/
signal-horizon/
api/ → Fleet intelligence API (Node.js, Express, Prisma)
ui/ → Dashboard (React 19, Vite, Tailwind)
shared/ → Shared types and defaults
synapse-pingora/ → Edge WAF engine (Rust, Cloudflare Pingora)
synapse-client/ → CLI and client for Synapse APIs (TypeScript)
packages/
synapse-api/ → Reusable Synapse API client library (TypeScript)
```
**Signal Horizon** 是集群智能控制平面 —— 它汇聚来自边缘传感器的遥测数据,关联攻击活动,并驱动整个 Synapse 节点集群的协同防御决策。
**Synapse Pingora** 是构建于 Cloudflare Pingora 框架之上的高性能 WAF 和边缘代理。它负责在边缘处理请求检查、实体追踪、风险评分、DLP 扫描、行为阻断和活动关联。
## 环境准备
| 工具 | 版本 | 用途 |
|------|---------|---------|
| [Node.js](https://nodejs.org) | >= 20 | TypeScript 项目 |
| [pnpm](https://pnpm.io) | >= 10 | 包管理 |
| [Rust](https://rustup.rs) | nightly | Synapse Pingora |
| [just](https://github.com/casey/just) | >= 1.0 | 任务运行器 |
| [Redis](https://redis.io) | any | 会话状态,任务队列 |
| [PostgreSQL](https://www.postgresql.org) | >= 15 | Signal Horizon 数据库 |
| [ClickHouse](https://clickhouse.com) | >= 24 | 时序遥测数据 (开发环境可选) |
## 快速开始
### 首次设置
```
# 启动基础设施服务
brew services start redis # Redis on :6379
open -a Postgres # PostgreSQL on :5432 (or brew services start postgresql)
just ch-start # ClickHouse on :8123
# 验证服务运行状态
just services
# 安装依赖
just install
pnpm rebuild esbuild prisma @prisma/client @prisma/engines
# 设置数据库
cp apps/signal-horizon/api/.env.example apps/signal-horizon/api/.env
# 编辑 .env — 设置 DATABASE_URL 以匹配您的本地 PostgreSQL 凭据
just db-generate # Generate Prisma client
just db-migrate # Apply schema to PostgreSQL
just ch-init # Apply schema to ClickHouse
just db-seed # Seed tenants, sensors, and API keys
```
### 日常操作
```
just dev # Start everything in parallel
```
启动后:
| 服务 | URL |
|---------|-----|
| Signal Horizon UI |
|
| Signal Horizon API | |
| Synapse Proxy | |
| Synapse Admin API | |
种子数据会创建一个带有 API key `dev-dashboard-key` 的默认租户 —— UI 会自动使用它,因此无需手动配置认证。
### 基础设施服务
```
just services # Check status of Redis, PostgreSQL, ClickHouse
just ch-start # Start ClickHouse (launchd)
just ch-stop # Stop ClickHouse
just ch-init # Initialize ClickHouse schema
```
## 开发
所有常用任务均可通过根目录的 `justfile` 执行。运行 `just` 查看完整列表。
### 开发服务器
```
just dev # All services in parallel
just dev-horizon # Signal Horizon API + UI only
just dev-synapse # Synapse Pingora only
```
### 构建
```
just build # All projects (Nx dependency graph)
just build-horizon # Signal Horizon API + UI
just build-synapse # Synapse Pingora (release)
just build-synapse-dev # Synapse Pingora (debug, faster compile)
just build-synapse-api # synapse-api library
just build-synapse-client # synapse-client CLI
```
### 测试
```
just test # Everything
just test-horizon # Signal Horizon API + UI
just test-synapse # Synapse Pingora (cargo test)
just test-synapse-heavy # Synapse Pingora integration tests
just test-synapse-api # synapse-api library
just test-synapse-client # synapse-client CLI
```
### Lint 与类型检查
```
just lint # ESLint + Clippy across all projects
just type-check # TypeScript type-checking
just check-synapse # Clippy + rustfmt check
just fmt-synapse # Auto-format Rust code
```
### CI
```
just ci # Full pipeline: lint → type-check → build → test
just ci-ts # TypeScript projects only
just ci-rust # Rust only (clippy, build, test)
```
### 数据库 (Signal Horizon)
```
just db-migrate # Run Prisma migrations (dev)
just db-seed # Seed the database
just db-reseed # Reset + reseed
just db-studio # Open Prisma Studio
```
## 可发布产物
| 产物 | 路径 | 类型 |
|----------|------|------|
| Signal Horizon | `apps/signal-horizon/` | API + UI (容器) |
| Synapse Pingora | `apps/synapse-pingora/` | Rust 二进制文件 |
| synapse-api | `packages/synapse-api/` | npm 包 |
| synapse-client | `apps/synapse-client/` | npm 包 / CLI |
## 工作区工具链
- **[pnpm](https://pnpm.io)** — 基于 workspaces 的包管理
- **[Nx](https://nx.dev)** — 构建编排与依赖图 (`just graph` 可视化)
- **[just](https://github.com/casey/just)** — 任务运行器 (根目录 `justfile`)
- **[Cargo](https://doc.rust-lang.org/cargo/)** — Rust 构建系统 (在 `synapse-pingora` 内部自包含)
Synapse Pingora 在 `apps/synapse-pingora/justfile` 也有自己的 `justfile`,包含演示和服务管理配方。
## 许可证
AGPL-3.0-only — 详见 [LICENSE](LICENSE)。
Synapse Pingora 采用 Apache-2.0 许可证。标签:AGPL, AppImage, CISA项目, CLI, Cloudflare, DLP, Express, fleet intelligence, fleets management, GNU通用公共许可证, HTTP/HTTPS抓包, MITM代理, MITRE ATT&CK, monorepo, Node.js, Pingora, Prisma, React, Rust, Syscalls, Tailwind, TypeScript, Vite, WAF, Web应用防火墙, WiFi技术, 代理, 仪表盘, 全栈, 单体仓库, 反向代理, 可视化界面, 威胁情报, 安全插件, 开发者工具, 态势感知, 搜索引擎查询, 攻击关联, 无文件攻击, 测试用例, 渗透测试框架, 网络安全, 网络流量审计, 自动化攻击, 边缘安全, 遥测, 防御, 隐私保护, 风险评分