Code Review AI Bot
Go to file
vinland100 a98e3e531b
Build and Push CodeReview / build (push) Waiting to run Details
Fixed the issue of infinite loop outputting the same content in the Agent audit mode, and resolved the problem of incomplete display of the frontend Activity log in Agent audit mode.
2026-01-12 13:39:48 +08:00
.gitea/workflows chore: Update Docker image repository in production compose and build workflows, and remove the China-specific production compose file. 2026-01-07 17:31:00 +08:00
backend Fixed the issue of infinite loop outputting the same content in the Agent audit mode, and resolved the problem of incomplete display of the frontend Activity log in Agent audit mode. 2026-01-12 13:39:48 +08:00
docker/sandbox chore: Use direct Python base image in sandbox Dockerfile. 2026-01-05 15:34:22 +08:00
docs 更新 LLM_PROVIDERS.md 2025-12-22 21:39:58 +08:00
frontend Change the log time to China 2026-01-09 13:23:49 +08:00
rules Initial commit: Add XCodeReviewer project files 2025-09-20 00:09:00 +08:00
scripts feat: Add CI/CD integration with Gitea webhooks and pull request review functionality. 2025-12-31 16:40:33 +08:00
supabase/migrations feat(projects): add ZIP file upload support and source type tracking 2025-11-28 17:38:12 +08:00
tests feat: Centralize Git tokens to system environment variables and add Gitea branch verification. 2026-01-05 17:12:47 +08:00
.dockerignore feat(docker): Enhance Docker configuration for multi-provider LLM support 2025-10-24 16:41:29 +08:00
.gitignore chore: 忽略后端向量数据库数据目录 2025-12-16 15:13:40 +08:00
CHANGELOG.md chore: release v3.0.1 2025-12-16 22:55:19 +08:00
CONTRIBUTING.md docs: 更新 Python 和 Node.js 版本要求 2025-12-21 06:40:33 +08:00
DISCLAIMER.md chore: rebrand XCodeReviewer to DeepAudit across all files 2025-12-08 21:35:09 +08:00
LICENSE Add LICENSE file 2025-12-18 02:22:41 +08:00
README.md docs: Consolidate English README content into `README.md` and remove `README_EN.md`. 2026-01-07 16:52:00 +08:00
SECURITY.md chore: rebrand XCodeReviewer to DeepAudit across all files 2025-12-08 21:35:09 +08:00
docker-compose.prod.yml chore: Update Docker image repository in production compose and build workflows, and remove the China-specific production compose file. 2026-01-07 17:31:00 +08:00
docker-compose.yml feat: Introduce Gitea CI for Docker image builds/pushes and update docker-compose to use new registry images and persistent volumes. 2026-01-07 17:14:03 +08:00
sgconfig.yml Initial commit: Add XCodeReviewer project files 2025-09-20 00:09:00 +08:00
tools.txt feat: Introduce Kunlun agent tool, add Docker and sandbox environment checks, and update agent services and frontend dialogs. 2025-12-15 02:00:34 +08:00

README.md

项目概述

DeepAudit 是一个基于 Multi-Agent 协作架构的下一代代码安全审计平台。它不仅仅是一个静态扫描工具,而是模拟安全专家的思维模式,通过多个智能体(Orchestrator, Recon, Analysis, Verification)的自主协作,实现对代码的深度理解、漏洞挖掘和 自动化沙箱 PoC 验证

我们致力于解决传统 SAST 工具的三大痛点:

  • 误报率高 — 缺乏语义理解,大量误报消耗人力
  • 业务逻辑盲点 — 无法理解跨文件调用和复杂逻辑
  • 缺乏验证手段 — 不知道漏洞是否真实可利用

用户只需导入项目DeepAudit 便全自动开始工作:识别技术栈 → 分析潜在风险 → 生成脚本 → 沙箱验证 → 生成报告,最终输出一份专业审计报告。

💡 为什么选择 DeepAudit

😫 传统审计的痛点 💡 DeepAudit 解决方案
人工审计效率低
跨不上 CI/CD 代码迭代速度,拖慢发布流程
🤖 Multi-Agent 自主审计
AI 自动编排审计策略,全天候自动化执行
传统工具误报多
缺乏语义理解,每天花费大量时间清洗噪音
🧠 RAG 知识库增强
结合代码语义与上下文,大幅降低误报率
数据隐私担忧
担心核心源码泄露给云端 AI无法满足合规要求
🔒 支持 Ollama 本地部署
数据不出内网,支持 Llama3/DeepSeek 等本地模型
无法确认真实性
外包项目漏洞多,不知道哪些漏洞真实可被利用
💥 沙箱 PoC 验证
自动生成并执行攻击脚本,确认漏洞真实危害

🏗️ 系统架构

整体架构图

DeepAudit 采用微服务架构,核心由 Multi-Agent 引擎驱动。

DeepAudit 架构图

🔄 审计工作流

步骤 阶段 负责 Agent 主要动作
1 策略规划 Orchestrator 接收审计任务,分析项目类型,制定审计计划,下发任务给子 Agent
2 信息收集 Recon Agent 扫描项目结构,识别框架/库/API提取攻击面Entry Points
3 漏洞挖掘 Analysis Agent 结合 RAG 知识库与 AST 分析,深度审查代码,发现潜在漏洞
4 PoC 验证 Verification Agent (关键) 编写 PoC 脚本,在 Docker 沙箱中执行。如失败则自我修正重试
5 报告生成 Orchestrator 汇总所有发现,剔除被验证为误报的漏洞,生成最终报告

📂 项目代码结构

DeepAudit/
├── backend/                        # Python FastAPI 后端
│   ├── app/
│   │   ├── agents/                 # Multi-Agent 核心逻辑
│   │   │   ├── orchestrator.py     # 总指挥:任务编排
│   │   │   ├── recon.py            # 侦察兵:资产识别
│   │   │   ├── analysis.py         # 分析师:漏洞挖掘
│   │   │   └── verification.py     # 验证者:沙箱 PoC
│   │   ├── core/                   # 核心配置与沙箱接口
│   │   ├── models/                 # 数据库模型
│   │   └── services/               # RAG, LLM 服务封装
│   └── tests/                      # 单元测试
├── frontend/                       # React + TypeScript 前端
│   ├── src/
│   │   ├── components/             # UI 组件库
│   │   ├── pages/                  # 页面路由
│   │   └── stores/                 # Zustand 状态管理
├── docker/                         # Docker 部署配置
│   ├── sandbox/                    # 安全沙箱镜像构建
│   └── postgres/                   # 数据库初始化
└── docs/                           # 详细文档

🚀 快速开始

方式一:克隆代码部署

适合需要自定义配置或二次开发的用户:

# 1. 克隆项目
git clone https://github.com/lintsinghua/DeepAudit.git && cd DeepAudit

# 2. 配置环境变量
cp backend/env.example backend/.env
# 编辑 backend/.env 填入你的 LLM API Key

# 3. 一键启动
docker compose up -d

首次启动会自动构建沙箱镜像,可能需要几分钟。


🔧 源码开发指南

适合开发者进行二次开发调试。

环境要求

  • Python 3.11+
  • Node.js 20+
  • PostgreSQL 15+
  • Docker (用于沙箱)

1. 手动启动数据库

docker compose up -d redis db

2. 后端启动

cd backend
# 配置环境
cp env.example .env

# 使用 uv 管理环境(推荐)
uv sync
source .venv/bin/activate

# 启动 API 服务
uvicorn app.main:app --reload

3. 前端启动

cd frontend
# 配置环境
cp .env.example .env

pnpm install
pnpm dev

3. 沙箱环境

开发模式下需要本地 Docker 拉取沙箱镜像:

# 标准拉取
docker pull ghcr.io/lintsinghua/deepaudit-sandbox:latest

# 国内加速(南京大学镜像站)
docker pull ghcr.nju.edu.cn/lintsinghua/deepaudit-sandbox:latest

🤖 Multi-Agent 智能审计

支持的漏洞类型

漏洞类型 描述
sql_injection SQL 注入
xss 跨站脚本攻击
command_injection 命令注入
path_traversal 路径遍历
ssrf 服务端请求伪造
xxe XML 外部实体注入
漏洞类型 描述
insecure_deserialization 不安全反序列化
hardcoded_secret 硬编码密钥
weak_crypto 弱加密算法
authentication_bypass 认证绕过
authorization_bypass 授权绕过
idor 不安全直接对象引用

📖 详细文档请查看 Agent 审计指南


🔌 支持的 LLM 平台

🌍 国际平台

OpenAI GPT-4o / GPT-4
Claude 3.5 Sonnet / Opus
Google Gemini Pro
DeepSeek V3

🇨🇳 国内平台

通义千问 Qwen
智谱 GLM-4
Moonshot Kimi
文心一言 · MiniMax · 豆包

🏠 本地部署

Ollama
Llama3 · Qwen2.5 · CodeLlama
DeepSeek-Coder · Codestral
代码不出内网


🎯 功能矩阵

功能 说明 模式
🤖 Agent 深度审计 Multi-Agent 协作,自主编排审计策略 Agent
🧠 RAG 知识增强 代码语义理解CWE/CVE 知识库检索 Agent
🔒 沙箱 PoC 验证 Docker 隔离执行,验证漏洞有效性 Agent
🗂️ 项目管理 GitHub/GitLab/Gitea 导入ZIP 上传10+ 语言支持 通用
即时分析 代码片段秒级分析,粘贴即用 通用
🔍 五维检测 Bug · 安全 · 性能 · 风格 · 可维护性 通用
💡 What-Why-How 精准定位 + 原因解释 + 修复建议 通用
📋 审计规则 内置 OWASP Top 10支持自定义规则集 通用
📝 提示词模板 可视化管理,支持中英文双语 通用
📊 报告导出 PDF / Markdown / JSON 一键导出 通用