GACWR/OpenUBA

GitHub: GACWR/OpenUBA

一个开源的用户与实体行为分析(UEBA)框架,专注于提供透明、可审计的「白盒」安全模型管理与可视化规则编排能力。

Stars: 470 | Forks: 271

# 开放式用户行为分析 (v0.0.2) 一个健壮、灵活且轻量级的开源用户与实体行为分析 (UEBA) 框架,用于安全分析。由网络安全行业的科学家和安全分析师用 luv 开发。 | 状态 | 徽章 | 状态 | 徽章 | | --- | --- | --- | --- | | `Build` | [![Build](https://img.shields.io/github/actions/workflow/status/GACWR/OpenUBA/docker-publish.yml?branch=master&label=build)](https://github.com/GACWR/OpenUBA/actions) | `License` | [![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://github.com/GACWR/OpenUBA/blob/master/LICENSE) | | `Issues` | [![Issues](https://img.shields.io/github/issues/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA/issues) | `Closed Issues` | [![Closed Issues](https://img.shields.io/github/issues-closed/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA/issues?q=is%3Aissue+is%3Aclosed) | | `Pull Requests` | [![PRs](https://img.shields.io/github/issues-pr/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA/pulls) | `Last Commit` | [![Last commit](https://img.shields.io/github/last-commit/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA/commits/master) | | `Top Language` | [![Top language](https://img.shields.io/github/languages/top/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA) | `Code Size` | [![Code size](https://img.shields.io/github/languages/code-size/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA) | | `Repo Size` | [![Repo size](https://img.shields.io/github/repo-size/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA) | `Contributors` | [![Contributors](https://img.shields.io/github/contributors/GACWR/OpenUBA.svg)](https://github.com/GACWR/OpenUBA/graphs/contributors) | | `Stars` | [![Stars](https://img.shields.io/github/stars/GACWR/OpenUBA.svg?style=social)](https://github.com/GACWR/OpenUBA/stargazers) | `Forks` | [![Forks](https://img.shields.io/github/forks/GACWR/OpenUBA.svg?style=social)](https://github.com/GACWR/OpenUBA/network/members) | | `Releases` | [![Releases](https://img.shields.io/github/v/release/GACWR/OpenUBA?include_prereleases)](https://github.com/GACWR/OpenUBA/releases) | `Platform` | ![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey.svg) | | `Python` | ![Python](https://img.shields.io/badge/python-3.11+-blue.svg?logo=python&logoColor=white) | `TypeScript` | ![TypeScript](https://img.shields.io/badge/typescript-5.x-blue.svg?logo=typescript&logoColor=white) | | `FastAPI` | ![FastAPI](https://img.shields.io/badge/fastapi-0.100+-009688.svg?logo=fastapi&logoColor=white) | `Next.js` | ![Next.js](https://img.shields.io/badge/next.js-14+-black.svg?logo=next.js&logoColor=white) | | `PostgreSQL` | ![PostgreSQL](https://img.shields.io/badge/postgresql-15+-336791.svg?logo=postgresql&logoColor=white) | `Kubernetes` | ![Kubernetes](https://img.shields.io/badge/kubernetes-native-326CE5.svg?logo=kubernetes&logoColor=white) | | `Docker` | [![Docker](https://img.shields.io/badge/docker-images-2496ED.svg?logo=docker&logoColor=white)](https://hub.docker.com/u/openuba) | `Spark` | ![Spark](https://img.shields.io/badge/apache_spark-3.x-E25A1C.svg?logo=apachespark&logoColor=white) | | `Elasticsearch` | ![Elasticsearch](https://img.shields.io/badge/elasticsearch-8.x-005571.svg?logo=elasticsearch&logoColor=white) | `PRs Welcome` | [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/GACWR/OpenUBA/pulls) | | `Chat` | ![Discord](https://img.shields.io/discord/683561405928177737) | | | ## 目录 - [问题](#problem) - [解决方案](#solution) - [架构](#architecture) - [技术栈](#tech-stack) - [功能特性](#features) - [规则画布](#rule-canvas) - [模型库](#model-library) - [模型执行沙箱](#model-execution-sandbox) - [工作区与 SDK](#workspaces--sdk) - [身份验证与访问控制](#authentication-and-access-control) - [LLM 助手](#llm-assistant) - [快速入门](#getting-started) - [开发](#development) - [Makefile 参考](#makefile-reference) - [测试](#testing) - [白皮书](#white-paper) - [社区](#community) - [许可证](#license) ## 问题 许多 UBA 平台通常在数据科学实践中采用“黑盒”方法,这对于那些对生成异常、基线和案例的底层模型细节不感兴趣的安全分析师来说可能最合适。这些平台将其模型视为 IP。 ## 解决方案 OpenUBA 采用“开放模型”的方法,专为那一小部分对模型行为及其底层原理抱有真正好奇心的安全分析师而设计。我们坚信科学计算社区及其多年来的贡献(库、工具包等)。在安全领域,规则/模型的透明度对于合规性、响应/调查和决策至关重要。 OpenUBA 还利用了社区驱动的模型市场,类似于插件商店,其中插件即安全模型。该市场是 OpenUBA 用户为其特定用例安装安全模型的地方。模型开发者也可以上传他们的模型,使其他用户能够复用它们,无论是免费还是付费——这完全由模型开发者决定。
OpenUBA Dashboard

Watch Full Demo
## 架构 OpenUBA v0.0.2 是一个 Kubernetes 原生平台,采用模块化、云原生架构。所有组件均已容器化,可部署到 Kind 集群进行开发,或部署到生产环境的 Kubernetes 集群。该系统设计保持轻量级——没有始终运行的单模型服务,没有沉重的流水线编排器,只有大规模运行安全分析所需的最小基础设施。 | 层级 | 描述 | | --- | --- | | **Frontend** | Next.js 14 React 应用,包含 TailwindCSS、shadcn/ui 组件和实时 GraphQL 订阅 | | **Backend API** | FastAPI 应用,提供 REST 端点、JWT 认证、模型编排、规则引擎和调度 | | **GraphQL** | PostGraphile 从 PostgreSQL schema 自动生成完整的 GraphQL API,支持订阅和高效查询 | | **Operator** | 自定义 Kubernetes operator (Kopf) 监视 UBATraining 和 UBAInference CRD 并创建临时 Job | | **Data Layer** | PostgreSQL (记录系统), Elasticsearch (搜索/分析), Apache Spark (分布式计算), 由 Persistent Volumes 支持 | | **Execution Plane** | 临时 K8s Job,使用特定框架的 Docker 镜像 (sklearn, pytorch, tensorflow, networkx) 进行 JIT 模型训练和推理 | ## 技术栈 ### Frontend | 组件 | 技术 | | --- | --- | | Framework | Next.js 14.0.4 (App Router) | | Language | TypeScript 5.3 | | UI System | TailwindCSS 3.4, Radix UI primitives, class-variance-authority | | Data Layer | Apollo Client 3.8 (GraphQL), Axios 1.6 (REST) | | Real-time | GraphQL subscriptions via graphql-ws 5.14 | | Charts | Recharts 3.5 | | Rule Canvas | @xyflow/react 12.10 (flow-based node editor) | | State | Zustand 4.5 (UI state), Apollo cache (server state) | | Markdown | react-markdown 10.1, react-syntax-highlighter 16.1 | | Command Palette | cmdk 0.2 | | Icons | lucide-react 0.309 | ### Backend | 组件 | 技术 | | --- | --- | | Framework | FastAPI 0.104 (Uvicorn 0.24 ASGI) | | Language | Python 3.9 (typed, Pydantic 2.5) | | ORM | SQLAlchemy 2.0.23 | | Auth | JWT (python-jose 3.3), bcrypt via passlib 1.7 | | Scheduling | APScheduler 3.10 | | GraphQL | PostGraphile (auto-schema from PostgreSQL) | | Data Engines | PySpark 3.5, Elasticsearch client 8.11 | | Container Clients | docker-py 6.1, kubernetes-client 28.1 | ### Infrastructure | 组件 | 技术 | | --- | --- | | Database | PostgreSQL 15 (Alpine) | | Search | Elasticsearch 8.11.0 | | Compute | Apache Spark 3.5.0 (Master + Worker) | | Orchestration | Kubernetes (Kind for dev, any cluster for prod) | | Operator | Custom OpenUBA Operator (Kopf, Python) | | Containers | Docker (framework-specific model runner images) | | Node.js Runtime | Node 18 (Alpine, multi-stage frontend build) | ### Modeling Frameworks | Framework | Runner Image | Serialization | | --- | --- | --- | | scikit-learn | `model-runner:sklearn` | joblib | | PyTorch | `model-runner:pytorch` | torch.save | | TensorFlow / Keras | `model-runner:tensorflow` | SavedModel | | NetworkX | `model-runner:networkx` | pickle | ## 功能特性 ### 建模 - 具备完整生命周期的模型管理(安装、训练、推理) - 包含社区驱动和内部驱动模型的模型库 - 多 Registry 支持 (GitHub, OpenUBA Hub, HuggingFace, Kubeflow, 本地文件系统) - 模型版本控制和 Artifact 跟踪 - 用于持续模型训练的反馈循环 - 用于模型和风险评分实验的“影子模式” - 安装时和每次执行前的加密哈希验证 - 框架无关:支持 sklearn, PyTorch, TensorFlow, Keras, NetworkX, Spark MLlib 等 - “白盒”模型标准 —— 每个模型都是可检查和可审计的 ### 规则引擎与告警 - 基于阈值和基于偏差的检测规则 - 流图规则逻辑,带有用于构建复杂规则电路的可视化画布 - 规则通过逻辑运算符组合模型输出,并确定性地序列化到数据库 - 规则触发的告警与异常和案例相关联 - 告警可以按规则启用或禁用 ### 工作区与 SDK - 从 UI 启动具有可配置硬件层级的托管 JupyterLab 环境 - Python SDK (`pip install openuba`),用于程序化模型注册、作业提交和可视化 - 直接从 notebook 注册 sklearn, PyTorch, TensorFlow 和 NetworkX 模型 - 通过实时 SSE 进度流提交训练和推理作业 - 多后端可视化渲染 (matplotlib, seaborn, plotly, bokeh, altair, plotnine, datashader, networkx, geopandas) - K8s operator 通过 UBAWorkspace CRD 管理工作区生命周期 ### 仪表板 - 现代 Next.js + shadcn/ui 界面,默认深色模式 - 通过 GraphQL 订阅进行实时更新 - 全局时间范围选择器、命令面板和键盘导航 - 具有响应式布局的模块化组件 - 页面:Home, Data, Models, Rules, Alerts, Entities, Anomalies, Cases, Workspaces, Visualizations, Dashboards, Experiments, Features, Pipelines, Jobs, Datasets ### 安全与访问控制 - JWT 认证与基于角色的访问控制 (admin, manager, triage, analyst) - 管理员可配置的按页面细粒度权限 (读/写) - 持久化通知系统 - 用于合规的审计日志 ### 核心能力 - 案例管理,包含异常关联和时间线 - 异常检测结果浏览、过滤和确认 - 实体管理和风险跟踪 - 数据源管理与摄入状态监控 - SIEM 无关架构,支持灵活的数据集 - 集成 LLM 助手以进行上下文分析 - 告警和通知系统 - 基于 Cron 的调度,用于自动化模型执行 ## 规则画布 OpenUBA 包含一个可视化的基于流的规则构建器,用于创建检测逻辑。规则在交互式画布上通过逻辑运算符组合模型输出,类似于 n8n 或 Node-RED 等工具,但专为安全分析而构建。分析师可以连接已注册的模型,定义阈值条件,并链接逻辑门来表达复杂的检测标准 —— 无需编写代码。 每个规则的流图作为结构化 JSON 对象确定性地序列化到数据库中,使规则完全可重现、可版本跟踪和可审计。当满足规则条件时,它会触发告警,告警可以链接到异常和案例。
OpenUBA Rule Canvas
## 模型库 OpenUBA 实现了一个模型库和市场,用于托管“即用型”安全模型,包括核心团队和社区开发的模型。官方模型目录从 [openuba.org/registry/models.json](https://openuba.org/registry/models.json) 提供,由 [openuba-model-hub](https://github.com/GACWR/openuba-model-hub) 仓库支持。开发者也可以托管自己的模型 Registry,或从任何 GitHub 仓库或本地文件系统安装模型。 仪表板中的库选项卡允许分析师通过单击浏览、搜索、检查和安装模型。点击模型会打开一个详情模态框,显示其元数据、参数、标签、依赖项和完整源代码 —— 直接从 GitHub 获取。安装过程会下载模型文件,验证其完整性,将其写入磁盘上的模型库,并在 PostgreSQL 中注册。 ### 可用模型 | Model | Framework | Description | | --- | --- | --- | | `basic_model` | Python | Baseline example model for getting started | | `model_sklearn` | scikit-learn | Isolation Forest anomaly detection | | `model_pytorch` | PyTorch | Neural network-based behavior analysis | | `model_tensorflow` | TensorFlow | Deep learning behavior model | | `model_keras` | Keras | High-level API behavior model | | `model_networkx` | NetworkX | Graph-based entity relationship analysis | | `model_1` | Python | General-purpose analytics model | ### 模型接口 模型遵循简单的 Python 接口。不需要繁重的 SDK 或复杂的流水线定义 —— 模型作者使用熟悉的库编写简单的 Python 逻辑: ``` class Model: def train(self, ctx): # Train model, return summary ... def infer(self, ctx): # Run inference, return risk scores as DataFrame ... ``` 每个模型包是一个目录,包含一个 `MODEL.py`,一个可选的 `model.yaml` 清单,以及一个可选的 `requirements.txt`。Runner 处理所有 I/O、数据库访问和特定框架的序列化(sklearn 用 joblib,PyTorch 用 torch.save,TensorFlow 用 SavedModel)。 ### Registry 适配器 模型 Registry 使用可插拔的适配器模式。每个适配器为其后端实现模型发现、列表和下载: | Adapter | Source | Description | | --- | --- | --- | | OpenUBA Hub | `openuba.org` | Official model catalog with cached JSON registry (5-min TTL) | | GitHub | Any repo | Clone and install models from GitHub repositories | | Local Filesystem | `model_library/` | Scan locally installed models | | HuggingFace | HF Hub | Model hub API integration (planned) | ### 数据加载器 模型可以通过内置数据加载器模块从多个源消费数据: | Loader | Module | Description | | --- | --- | --- | | Local CSV | `local_pandas` | Reads CSV files via pandas | | Elasticsearch | `es` | Queries Elasticsearch indices | | Spark | `spark` | Distributed data via PySpark | | Source Groups | `source_group` | Aggregated multi-source loading | ## 模型执行沙箱 每次模型执行都在独立的 Docker 容器或 Kubernetes Job 内运行,与主 API 分离。这提供了: - **安全性** —— 不受信任的模型代码无法破坏核心系统 - **隔离性** —— 每个模型都有自己的环境,拥有正确的依赖项 - **可靠性** —— 行为异常的模型被包含在内;资源限制防止其耗尽系统资源 - **可扩展性** —— 多个模型可以作为独立的 K8s Job 并行运行 没有长期运行的单模型服务。每次训练和推理运行都是一个临时 Job,启动、执行、写入结果并退出。唯一长期存在的部分是 operator、backend 和数据库。 自定义 OpenUBA operator 监视 `UBATraining` 和 `UBAInference` 自定义资源,并使用适当的特定框架 Runner 镜像创建 Kubernetes Job。输入和输出数据通过共享的 Persistent Volumes 流动。 ## 工作区与 SDK OpenUBA 包含作为 Kubernetes Pod 运行的托管 JupyterLab 工作区,为分析师和数据科学家提供一个直接连接到平台的完整 notebook 环境。在工作区中,您可以注册模型、提交训练和推理作业、查询结果并渲染可视化 —— 全部通过 Python SDK 完成。 ``` pip install openuba ``` ``` import openuba # 从 notebook 注册训练好的 sklearn 模型 openuba.register_model("ssh-anomaly-detector", model, runtime="sklearn") # 提交训练作业并轮询直到完成 openuba.start_training(model_id, dataset_id=dataset_id) # 运行 inference -- 返回异常分数 openuba.start_inference(model_id, dataset_id=dataset_id) # 渲染 plotly 可视化并推送到平台 openuba.render(fig, viz_id=viz_id) ``` SDK 开箱即支持 9 种可视化后端。任何 matplotlib, seaborn, plotly, bokeh, altair, plotnine, datashader, networkx, 或 geopandas 图形都可以被渲染并推送到平台,在 Visualizations 页面显示。 工作区由 K8s operator 通过 `UBAWorkspace` 自定义资源管理。硬件层级(`cpu-small`, `cpu-large`, `gpu-small`, `gpu-large`)控制资源分配。每个工作区都有自己的持久卷、预安装的 SDK 和用于认证访问平台的 API Token。
OpenUBA Workspace and Visualization
## 身份验证与访问控制 OpenUBA v0.0.2 包含完整的身份验证和基于角色的访问控制系统: | Role | Access | | --- | --- | | **Admin** | Full read/write access to all pages, user management, permission configuration | | **Manager** | Read access to all pages | | **Triage** | Home, rules, alerts, entities, cases only | | **Analyst** | Home, data, models (read/write), rules (read/write), alerts, entities (read/write), anomalies (read/write) | 默认凭据:`openuba` / `password` (admin)。首次登录后请立即更改。 ## LLM 助手 界面中内置了一个始终可用的 LLM 聊天覆盖层。它支持多种提供商: | Provider | Type | | --- | --- | | Ollama | Local (default) | | OpenAI | Cloud API | | Claude | Cloud API | | Gemini | Cloud API | 助手具有上下文感知能力 —— 它能看到当前路由、选定的实体和活动的过滤器。它可以被切换、拖动和调整大小。对话历史在页面导航期间持久保存。在 Settings > Integrations 下配置提供商。 ## 快速入门 ### 前置条件 | Requirement | Version | | --- | --- | | Docker | 20.10+ | | kubectl | 1.25+ | | Kind | 0.20+ | | Node.js | 18+ | | Python | 3.10+ | | Make | any | ### 完全重置 (推荐) 从零开始构建所有内容的单条命令 —— 创建 Kind 集群、构建所有 Docker 镜像、部署所有 Kubernetes 资源、初始化数据库、摄入测试数据,并在单独的终端标签页中启动端口转发: ``` make reset-dev ``` 这是开发的首选命令。它会拆除任何现有集群并端到端地搭建一个干净的环境。完成后,三个终端标签页将自动打开: | Tab | Purpose | URL | | --- | --- | --- | | Hybrid Networking | Port-forwards all K8s services to localhost | -- | | Local Backend | Runs the FastAPI backend with hot-reload | http://localhost:8000 | | Local Frontend | Runs the Next.js dev server with hot-reload | http://localhost:3000 | 使用 `openuba` / `password` 登录。 ### `make reset-dev` 做什么 1. 删除任何现有的 Kind 集群 2. 清理旧的 Docker 镜像 3. 从 `configs/local.yaml` 创建新的 Kind 集群 4. 构建所有容器镜像 (backend, frontend, operator, base runner, sklearn, pytorch, tensorflow, networkx) 5. 将镜像加载到 Kind 集群中 6. 部署所有 Kubernetes manifests (namespace, secrets, persistent volumes, Postgres, PostGraphile, Spark, Elasticsearch, backend, frontend, operator, CRDs, ingress) 7. 等待 Pod 准备就绪 8. 触发初始数据摄入(`toy_1` 数据集到 Spark 和 Elasticsearch) 9. 打开三个终端标签页用于端口转发、backend 和 frontend ### 替代方案:完全 Kubernetes 模式 如果您更喜欢在集群内运行所有内容(无本地 backend/frontend): ``` make create-local-cluster make k8s-deploy make k8s-forward ``` 访问应用程序 http://localhost:3000。 ### 替代方案:本地开发模式 针对本地 Postgres 运行 backend 和 frontend(无 Kubernetes): ``` make dev-postgres make setup-backend make dev-install-frontend make dev ``` ### 端口参考 | Service | Local Port | | --- | --- | | Frontend | 3000 | | Backend API | 8000 | | PostgreSQL | 5432 | | PostGraphile (GraphQL) | 5001 | | Spark Master | 7077 (UI: 8080) | | Elasticsearch | 9200 | ## 开发 ### 重启服务 在开发过程中,代码更改后您经常需要重建和重启单个服务。这些命令重建 Docker 镜像,将其加载到 Kind 集群中,并触发滚动重启: ``` # 重新构建并重启 backend pod make dev-restart-backend # 重新构建并重启 frontend pod make dev-restart-frontend # 重新应用 CRDs, RBAC, 并重启 operator make dev-restart-operator ``` 对于本地(非 K8s)开发: ``` make dev-restart-backend-local make dev-restart-frontend-local ``` ### 构建单个镜像 ``` make build-backend # backend api server make build-frontend # next.js frontend make build-operator # kubernetes operator make build-runner-base # model runner base image make build-runner-sklearn # sklearn runner make build-runner-torch # pytorch runner make build-runner-tf # tensorflow runner make build-runner-networkx # networkx runner make build-containers # all of the above ``` ### 查看日志 ``` make k8s-logs-backend make k8s-logs-frontend make k8s-logs-spark make k8s-logs-elasticsearch make k8s-logs-postgraphile make k8s-logs-all # all services simultaneously make watch-pods # live pod status ``` ### 数据库 ``` make init-db-k8s # initialize schema in the K8s Postgres pod make init-db-local # initialize schema against local Postgres make redeploy-db # full Postgres redeploy with fresh schema ``` ### 数据摄入 ``` make k8s-init-data # ingest toy_1 dataset into Spark and Elasticsearch ``` `test_datasets/toy_1/` 目录包含 SSH、DNS、DHCP 和代理日志的真实世界子集。该数据集被视为不可变的 —— 不应修改。在生产中,用户将 OpenUBA 连接到其现有的 Spark 或 Elasticsearch 集群,这些集群已包含其数据集。 ### 端口转发 ``` make dev-hybrid # infrastructure only (Postgres, Spark, ES, PostGraphile) make k8s-forward # everything including backend and frontend ``` ### 清理 ``` make delete-local-cluster # delete the Kind cluster make clean-docker # prune unused Docker resources make clean-all # delete cluster + prune Docker make clean-logs # remove local log files make dev-stop # stop local Postgres container ``` ## Makefile 参考 OpenUBA 中的每个命令都通过 Makefile 运行。以下是完整参考: ### 核心工作流 | Target | Description | | --- | --- | | `reset-dev` | Full reset -- deletes cluster, rebuilds everything, deploys, and launches dev tabs | | `create-infra` | Runs `scripts/start-dev.sh` (cluster + build + deploy + tabs) | | `create-local-cluster` | Creates the Kind cluster from `configs/local.yaml` | | `delete-local-cluster` | Deletes the Kind cluster | ### 构建 | Target | Description | | --- | --- | | `build-containers` | Builds all Docker images (backend, frontend, operator, all runners) | | `build-backend` | Builds the backend image | | `build-frontend` | Builds the frontend image | | `build-operator` | Builds the operator image | | `build-model-runner` | Builds base + all framework runner images | | `build-runner-base` | Builds the model runner base image | | `build-runner-sklearn` | Builds the sklearn runner image | | `build-runner-torch` | Builds the PyTorch runner image | | `build-runner-tf` | Builds the TensorFlow runner image | | `build-runner-networkx` | Builds the NetworkX runner image | ### 部署 | Target | Description | | --- | --- | | `k8s-deploy` | Builds, loads, and deploys all resources to K8s | | `deploy-k8s` | Deploys K8s manifests (without building) | | `deploy-operator` | Deploys CRDs, RBAC, and operator | | `load-images` | Loads local Docker images into the Kind cluster | | `k8s-delete` | Deletes all K8s resources | | `k8s-init-data` | Triggers data ingestion via the backend API | | `redeploy-db` | Redeploys Postgres with fresh schema | ### 开发 | Target | Description | | --- | --- | | `dev` | Starts local backend + frontend against local Postgres | | `dev-backend` | Starts the FastAPI backend locally with hot-reload | | `dev-frontend` | Starts the Next.js frontend locally with hot-reload | | `dev-hybrid` | Port-forwards infrastructure services for local dev | | `dev-restart-backend` | Rebuilds and restarts the backend pod in K8s | | `dev-restart-frontend` | Rebuilds and restarts the frontend pod in K8s | | `dev-restart-operator` | Re-applies CRDs/RBAC and restarts the operator | | `dev-restart-backend-local` | Restarts the local backend process | | `dev-restart-frontend-local` | Restarts the local frontend process | | `setup-backend` | Creates Python venv and installs dependencies | | `dev-install-frontend` | Installs frontend npm dependencies | | `dev-postgres` | Starts a local Postgres container | | `dev-stop` | Stops the local Postgres container | | `k8s-forward` | Port-forwards all services for demo/full K8s mode | ### 日志与监控 | Target | Description | | --- | --- | | `k8s-logs-backend` | Tail backend logs | | `k8s-logs-frontend` | Tail frontend logs | | `k8s-logs-spark` | Tail Spark logs | | `k8s-logs-elasticsearch` | Tail Elasticsearch logs | | `k8s-logs-postgraphile` | Tail PostGraphile logs | | `k8s-logs-all` | Tail all service logs simultaneously | | `watch-pods` | Live pod status watch | ### 测试 | Target | Description | | --- | --- | | `test` | Runs unit and integration tests | | `test-unit` | Runs unit tests only | | `test-integration` | Runs integration tests only | | `test-api` | Runs API router tests | | `test-re` | Runs repository tests | | `test-registry` | Runs registry adapter tests | | `test-services` | Runs service tests | | `e2e-full` | Full E2E suite (setup, deploy, test, cleanup) | | `e2e-test` | Runs E2E tests (requires prior deploy) | | `e2e-test-models` | E2E model management tests | | `e2e-test-anomalies` | E2E anomaly tests | | `e2e-test-cases` | E2E case management tests | | `e2e-test-rules` | E2E rules tests | | `e2e-test-display` | E2E dashboard tests | | `test-all` | Runs all tests (unit + integration + E2E) | ### 清理 | Target | Description | | --- | --- | | `clean-docker` | Prunes unused Docker resources | | `clean-all` | Deletes cluster and prunes Docker | | `clean-logs` | Removes local log and pid files | ### 实用工具 | Target | Description | | --- | --- | | `get_pods` | Lists pods in the openuba namespace | | `get_trainings` | Lists UBATraining custom resources | | `init-db` | Initializes the database schema | | `init-db-local` | Initializes schema against local Postgres | | `init-db-k8s` | Initializes schema in the K8s Postgres pod | | `deploy-dashboard` | Deploys the Kubernetes Dashboard | | `k8s-proxy` | Starts kubectl proxy for the K8s Dashboard | ## 测试 ``` # 运行所有 unit 和 integration tests make test # 仅 unit tests make test-unit # 仅 integration tests make test-integration # API router tests make test-api # repository tests make test-repositories # registry adapter tests make test-registry # service tests make test-services # 完整 end-to-end test suite (构建, 部署, 测试, 清理) make e2e-full # 运行所有内容 make test-all ``` ## 白皮书 - [PDF](https://openuba.org/openuba.pdf) - [Source Code](https://github.com/GACWR/ouba-paper) ## 社区 - Twitter: http://twitter.com/OpenUBA - Discord: https://discord.gg/Ps9p9Wy - Telegram: https://t.me/GACWR ## 许可证 [GPL License](https://github.com/GACWR/OpenUBA/blob/master/LICENSE)
标签:AMSI绕过, Apex, Docker, Python, UEBA, 内部威胁, 凭据扫描, 威胁检测, 子域名突变, 安全分析框架, 安全防御评估, 开源, 异常检测, 数据科学, 无后门, 机器学习, 测试用例, 用户与实体行为分析, 网络安全, 请求拦截, 资源验证, 逆向工具, 隐私保护