AuditLuma是一个AI+智能体代码审计系统,它利用多个AI代理和先进的技术,包括多代理合作协议(MCP)和Self-RAG(检索增强生成),为代码库提供全面的安全分析,目前已经支持ollama部署的本地大模型
AuditLuma是一个智能代码审计系统,它利用多个AI代理和先进的技术,包括多代理合作协议(MCP)和Self-RAG(检索增强生成),为代码库提供全面的安全分析。
克隆仓库并安装依赖:
git clone https://github.com/Vistaminc/AuditLuma.git
cd AuditLuma
pip install -r requirements.txt
FAISS向量检索库
默认情况下,AuditLuma会使用一个简单的内置向量存储实现。如果需要处理大型代码库,建议安装FAISS以提高性能:
# CPU版本
pip install faiss-cpu
# GPU版本(支持CUDA)
pip install faiss-gpu
安装FAISS后,系统将自动检测并使用它进行向量存储和检索,显著提高分析大型项目时的性能。
基本用法:
python main.py -d ./goalfile -o ./reports
| 参数 | 说明 | 默认值 |
|---|---|---|
-d, --directory | 目标项目目录 | ./goalfile |
-o, --output | 报告输出目录 | ./reports |
-w, --workers | 并行工作线程数 | 配置中的max_batch_size |
-f, --format | 报告格式(html/pdf/json) | 配置中的report_format |
--no-mcp | 禁用多智能体协作协议 | 默认启用 |
--no-self-rag | 禁用Self-RAG检索 | 默认启用 |
--no-deps | 跳过依赖分析 | 默认不跳过 |
--no-remediation | 跳过生成修复建议 | 默认不跳过 |
--verbose | 启用详细日志记录 | 默认禁用 |
通过编辑config/config.yaml文件配置系统。主要配置项包括:
AuditLuma支持使用统一的模型规范格式 model@provider 来指定模型和提供商:
deepseek-chat@deepseek # 指定使用DeepSeek提供商的deepseek-chat模型
gpt-4-turbo@openai # 指定使用OpenAI提供商的gpt-4-turbo模型
qwen-turbo@qwen # 指定使用通义千问提供商的qwen-turbo模型
如果不指定提供商(不使用@符号),系统将自动根据模型名称推断提供商。
# 默认模型配置
default_models:
code_analysis: "deepseek-chat@deepseek" # 代码分析模型
security_audit: "gpt-4-turbo@openai" # 安全审计模型
remediation: "deepseek-chat@deepseek" # 修复建议模型
summarization: "qwen-turbo@qwen" # 报告总结模型
# Self-RAG配置
self_rag:
enabled: true
embedding_model: "text-embedding-3-small@openai" # 嵌入模型
# 多智能体配置
mcp:
enabled: true
agents:
- name: "orchestrator"
type: "coordinator"
model: "deepseek-chat@deepseek" # 编排智能体使用的模型
- name: "security_analyst"
type: "analyst"
model: "gpt-4-turbo@openai" # 安全分析智能体使用的模型
AuditLuma支持多家LLM厂商,并能根据模型名称自动检测厂商:
| 模型前缀 | 厂商 |
|---|---|
gpt- | OpenAI |
deepseek- | DeepSeek |
qwen- | 通义千问 |
glm-或chatglm | 智谱AI |
baichuan | 百川 |
ollama- | ollama |
-注意:openai厂商可以对接所有openai格式的中转平台
AuditLuma支持分析以下编程语言:
AuditLuma使用多代理架构,包含以下组件:
AuditLuma支持以下报告格式:
欢迎贡献代码和建议!请遵循以下步骤:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)-QQ:1047736593
如果您觉得AuditLuma对您有帮助,欢迎通过以下方式支持我们:
MIT
No configuration available
Related projects feature coming soon
Will recommend related projects based on sub-categories