adurrr/ai-devsecops-workflows
GitHub: adurrr/ai-devsecops-workflows
一份面向 DevSecOps 工程师的 AI 辅助安全实践指南,涵盖多 Agent 编排、结对编程和 CLI 命令生成三大范式,提供安全优先的集成模式、框架比较与可复用的配置模板。
Stars: 0 | Forks: 0
# AI 辅助的 DevSecOps 工作流
[](https://gohugo.io/)
[](https://www.docsy.dev/)
[](https://adurrr.github.io/ai-devsecops-workflows/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/adurrr/ai-devsecops-workflows/pulls)
[文档](https://adurrr.github.io/ai-devsecops-workflows/) · [贡献](./CONTRIBUTING.md) · [许可证](./LICENSE)
## 概述
该仓库记录了 DevSecOps 工程师在日常工作中利用 AI 助手的方法、范式和最佳实践。它涵盖了安全优先的集成模式、框架比较和实用的实施策略。
## 文档
在 **[adurrr.github.io/ai-devsecops-workflows](https://adurrr.github.io/ai-devsecops-workflows/)** 探索完整文档。
| 章节 | 描述 |
|---------|-------------|
| [架构](https://adurrr.github.io/ai-devsecops-workflows/docs/architecture/) | 核心工作流模式和系统设计 |
| [框架](https://adurrr.github.io/ai-devsecops-workflows/docs/frameworks/) | LLM 助手框架比较 |
| [安全](https://adurrr.github.io/ai-devsecops-workflows/docs/security/) | 安全隐患、风险及缓解策略 |
| [范式](https://adurrr.github.io/ai-devsecops-workflows/docs/paradigms/) | AI 辅助 DevSecOps 的不同方法 |
| [用例](https://adurrr.github.io/ai-devsecops-workflows/docs/use-cases/) | 实际示例与模式 |
| [安全 PR 审查](https://adurrr.github.io/ai-devsecops-workflows/docs/secure-pr-review/) | PR 提交前的 AI 辅助安全审查 |
| [研究](https://adurrr.github.io/ai-devsecops-workflows/docs/research/) | 综合研究发现 |
## 核心理念
### 安全优先的 AI 集成
DevSecOps 中的 AI 助手必须遵循**零信任原则**:
1. **执行前验证**:所有 AI 生成的命令都需要人工审查
2. **最小权限**:为每个 agent 和任务分配精确的作用域权限
3. **审计追踪**:完整记录所有 AI 交互
4. **数据主权**:控制哪些代码/上下文离开您的环境
### 三大范式
| 范式 | 工具 | 最适用于 |
|----------|-------|----------|
| **编排式多 Agent** | oh-my-opencode-slim | 复杂、多步骤的安全工作流 |
| **单 Agent 结对编程** | Aider, Claude Code | 专注的开发会话,事件响应 |
| **CLI 命令生成** | ShellGPT, AIChat | 日常操作、故障排除、快速原型设计 |
## 关键决策矩阵
| 场景 | 推荐方法 | 理由 |
|----------|---------------------|-----------|
| 整个代码库的安全审计 | 多 Agent(Oracle + Explorer) | 具有战略监督的全面分析 |
| 响应安全事件 | 单 Agent 结对 | 带有上下文的专注、快速响应 |
| 日常基础设施任务 | CLI 生成 | 快速、轻量级的命令辅助 |
| 合规性文档编写 | 多 Agent(Librarian + Council) | 研究 + 共识验证 |
| IaC 安全审查 | 多 Agent(Oracle + Fixer) | 深度分析 + 自动修复 |
## 入门指南
### 前置条件
- 具有现代 shell (zsh/bash/fish) 的终端
- LLM 提供商的 API 密钥(或通过 Ollama 的本地模型)
- Git 和基本的 DevSecOps 工具
### 安装选项
**选项 1:完整的多 Agent 设置(推荐团队使用)**
```
# 在 opencode-go/crush 上安装 oh-my-opencode-slim
bunx oh-my-opencode-slim@latest install
```
**选项 2:轻量级 CLI(个人贡献者)**
```
# 用于生成命令的 ShellGPT
pip install shell-gpt
# 或用于通用 LLM CLI 的 AIChat
curl -fsSL https://raw.githubusercontent.com/sigoden/aichat/main/install.sh | sh
```
**选项 3:结对编程**
```
# 用于专注编码会话的 Aider
pip install aider-chat
```
## 仓库结构
```
.
├── README.md # This file
├── docs/ # Source documentation (markdown)
├── docs-site/ # Hugo documentation site
│ ├── config/ # Hugo configuration
│ ├── content/ # Site content
│ └── ...
├── configs/ # Ready-to-use configuration templates
│ ├── oh-my-opencode-slim/ # Multi-agent configurations
│ ├── shellgpt/ # ShellGPT roles and configs
│ └── security-policies/ # Permission templates
└── examples/ # Practical examples
├── developer-security/ # Pre-PR security review workflow
├── incident-response/ # Security incident workflows
├── iac-scanning/ # Infrastructure as Code security
└── pipeline-security/ # CI/CD security patterns
```
## 贡献
这是一份不断更新的文档。欢迎贡献以下内容:
- 新的框架比较
- 额外的安全模式
- 真实案例研究
- 配置改进
有关指南,请参见 [CONTRIBUTING.md](./CONTRIBUTING.md)。
## 许可证
MIT - 详情请参见 [LICENSE](./LICENSE)。
## 延伸阅读
- [OpenCode/Crush 文档](https://github.com/charmbracelet/crush)
- [oh-my-opencode-slim 仓库](https://github.com/alvinunreal/oh-my-opencode-slim)
- [OWASP LLM Top 10](https://owasp.org/www-project-top-10-for-large-language-model-applications/)
- [NIST AI 风险管理框架](https://www.nist.gov/itl/ai-risk-management-framework)标签:AI助手, AI安全, Chat Copilot, CI/CD安全, CISA项目, DevSecOps, DLL 劫持, Docsy, GitHub Advanced Security, GitHub Pages, Hugo, IaC安全, Llama, LLM集成, XML 请求, 上游代理, 人工智能, 代码审查, 合规自动化, 大语言模型, 安全加固, 安全开发, 安全架构, 安全模式, 开发安全, 技术文档, 指南, 最佳实践, 用户模式Hook绕过, 静态网站