jp255ft-debug/AI-SecOps-Framework
GitHub: jp255ft-debug/AI-SecOps-Framework
面向 LLM 与 AI 基础设施的企业级 DevSecOps 自动化审计框架,整合多种安全工具实现从代码到模型层面的全流程安全评估。
Stars: 0 | Forks: 0
# 🤖 AI-SecOps-Framework
**面向 AI 和 ML 基础设施的 B2B DevSecOps 审计框架**
[](LICENSE)
[](https://github.com/jp255ft-debug/AI-SecOps-Framework/actions/workflows/test.yml)
[](https://codecov.io/gh/jp255ft-debug/AI-SecOps-Framework)
[](https://genai.owasp.org/)
[](https://semgrep.dev/)
[](https://trivy.dev/)
[](https://python.org)
[](https://github.com/astral-sh/ruff)
[](https://pypi.org/project/ai-secops-framework/)
[](https://securityscorecards.dev/viewer/?uri=github.com/jp255ft-debug/AI-SecOps-Framework)
[](.github/workflows/sbom-release.yml)
[](.github/workflows/sbom-release.yml)
[](.github/workflows/fuzz.yml)
[](guardrails/telemetry.py)
[](docs/adr/)
[](docs/architecture/threat-model.md)
## 🎯 概述
**AI-SecOps-Framework** 是一款专为人工智能和机器学习基础设施打造的全流程安全审计解决方案。它将众多顶尖的开源工具有机整合为一个自动化 pipeline,能够在 **60 分钟** 内输出审计结果。
### 适用人群?
- 需要对 LLM 智能体和 AI API 进行审计的 **B2B 企业**
- 提供 DevSecOps 服务的 **安全咨询公司**
- 希望在 ML 流水线中落地 Shift-Left Security 的 **基础设施团队**
## 🚀 快速开始
### 前置条件
- Python 3.10+
- Docker(可选,用于 Trivy)
- Git
### 安装
```
# Clone 仓库
git clone https://github.com/seu-usuario/AI-SecOps-Framework.git
cd AI-SecOps-Framework
# 安装依赖
make install
# 配置环境
make setup-env
```
### 运行审计
```
# 完整审计 (60 分钟)
make audit
# 查看最新报告
make report
```
## 📊 评分卡
| 类别 | 得分 | 状态 |
|-----------|-------|--------|
| **🔒 安全性** | 9/10 | ✅ 优秀 |
| **🏗️ 架构** | 9/10 | ✅ 优秀 |
| **📦 DevOps** | 8/10 | ✅ 很好 |
| **🧪 测试** | 9/10 | ✅ 优秀 |
| **📝 文档** | 9/10 | ✅ 优秀 |
| **🔗 供应链** | 8/10 | ✅ 很好 |
| **⚖️ 合规性** | 10/10 | ✅ 完美 |
| **📊 可观测性** | 8/10 | ✅ 很好 |
| ****总体** | **8.8/10** | **Tier 1 - 行业领导者** |
## 📋 功能特性
### 🔍 SAST - 静态代码分析
- 使用 **Semgrep** 并搭配专为 LLM 定制的规则进行扫描
- 检测 prompt injection、data leakage 以及 insecure output handling
- 覆盖 OWASP Top 10 for LLM
### 📦 SCA - 依赖分析
- 使用 **Trivy** 扫描漏洞、密钥(secrets)及配置不当(misconfigurations)
- 支持 SBOM 和 VEX 生成
- 追踪供应链攻击(supply chain attacks)
### 🧠 LLM 安全测试
- 使用 **Giskard** 进行漏洞测试
- 使用 **Promptfoo** 进行 prompt injection 测试
- 使用 **NeMo Guardrails** 评估 guardrails
### 🛡️ Runtime Guardrails
- 拦截 LLM 的 input/output
- 通过 NeMo Guardrails 配置策略
- 实时拦截攻击
## 🏗️ 项目结构
```
AI-SecOps-Framework/
├── audits/
│ ├── outputs/ # Relatórios de auditoria gerados
│ └── templates/ # Templates de relatórios
├── config/
│ ├── semgrep/ # Regras customizadas Semgrep
│ └── trivy/ # Configuração Trivy
├── guardrails/
│ ├── interceptor.py # Módulo de interceptação
│ └── nemo_config/ # Configuração NeMo Guardrails
├── scripts/
│ ├── run_audit_60min.sh # Script principal de auditoria
│ ├── setup_env.sh # Setup do ambiente
│ └── generate_vex_sbom.sh # Geração de SBOM/VEX
├── tests/
│ ├── models/ # Testes Giskard
│ └── prompt_injection/ # Testes Promptfoo
├── Makefile # Automação de tarefas
├── Dockerfile # Containerização
└── requirements.txt # Dependências Python
```
## 📊 报告示例
```
# 执行摘要
| Domain | Score | Risk Level |
|--------|-------|------------|
| Code Security | 7.5/10 | MEDIUM |
| Dependencies | 8.2/10 | LOW |
| LLM Security | 6.0/10 | HIGH |
| **Overall** | **7.2/10** | **MEDIUM** |
```
## 🔒 合规与标准
- ✅ **OWASP Top 10 for LLM** (2025)
- ✅ **OWASP Top 10 Web** (2021)
- ✅ **NIST AI RMF** (AI Risk Management Framework)
- ✅ **CWE** (Common Weakness Enumeration)
- ✅ **CVSS** (Common Vulnerability Scoring System)
## 🐳 Docker
```
# 构建
make docker-build
# 在容器中运行审计
docker run --rm -v $(pwd):/workspace ai-secops-framework:latest
```
## 📊 可观测性
```
# 启动 OpenTelemetry stack (Jaeger + Prometheus + Grafana)
make otel-up
# 带 telemetry 运行审计
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 make audit
# 查看 traces: http://localhost:16686
# 查看 metrics: http://localhost:9090
# 查看 dashboards: http://localhost:3000 (admin/admin)
```
## 🔗 供应链安全
```
# 生成 SBOM (CycloneDX + SPDX)
make sbom
# 生成威胁模型 (STRIDE)
make threat-model
# 运行 fuzz 测试
make fuzz
```
## 🤝 贡献指南
欢迎参与贡献!请先阅读我们的贡献指南。
1. Fork 本项目
2. 创建你的分支 (`git checkout -b feature/AmazingFeature`)
3. 提交你的修改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 发起一个 Pull Request
## 📄 许可证
基于 MIT 许可证分发。详情请参阅 `LICENSE`。
## 📞 联系方式
**作者:** João Paulo Lima
**邮箱:** jp255ft@gmail.com
**LinkedIn:** [João Paulo Lima](https://www.linkedin.com/in/joão-paulo-lima-620a74237)
标签:AI安全, Chat Copilot, CISA项目, DevSecOps, Python, SBOM, 上游代理, 大语言模型安全, 威胁建模, 无后门, 机密管理, 用户代理, 硬件无关, 请求拦截, 逆向工具