关于 ark-vulnerability-fixer
面向 Ark 的安全技能,用于调查 CVE 并指导漏洞修复。它为 ark-security-patcher 工作流提供影响评估、需经用户批准的缓解方案、测试建议及安全 PR 模板。
主要功能
- 01CVE 数据查询与研究清单
- 02Ark 依赖项与影响分析
- 03需审批的缓解方案规划
- 04修复验证与集成测试建议
- 05安全提交和 PR 模板
适用场景
- 01调查 Ark 中报告的 CVE
- 02评估项目组件中的易受攻击依赖项
- 03准备经批准的安全补丁和 PR
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ mckinsey/ agents-at-scale-ark --skill ark-vulnerability-fixer安装后在 Claude Code 中输入/ark-vulnerability-fixer确认已加载。
详细介绍
Ark 漏洞修复工具
提供针对特定 CVE 的研究工具和安全补丁工作流,用于修复 Ark 中的漏洞。
何时使用此技能
在以下情况下使用此技能:
- 用户提到特定的 CVE 编号(例如,“修复 Ark 中的 CVE-2025-55183”)
- 用户报告了需要打补丁的安全漏洞
- 你需要 CVE 数据库信息
- 你需要以安全为重点的 PR 模板
注意:此技能通常由 ark-security-patcher Agent 使用,作为完整工作流的一部分:
- CVE 研究(此技能 + research 技能)
- 代码库分析(此技能 + analysis 技能)
- 缓解方案规划(此技能)
- 克隆代码库并实施修复
- 测试(可选使用 setup 技能)
- 创建 PR(此技能)
此技能与 research、analysis 和 setup 技能配合使用,可构成完整的端到端漏洞修复工作流。
CVE 研究
CVE API 集成
从 CIRCL CVE 数据库获取官方 CVE 数据:
# Fetch CVE details
curl -s "https://cve.circl.lu/api/cve/CVE-2025-55183" | python3 -m json.tool
该 API 提供:
- 官方 CVE 描述
- CVSS 评分和严重性评级
- 安全公告的参考链接
- 受影响的产品和版本范围
- CWE 分类
- 可用的补丁和修复方案
CVE 研究清单
针对每个 CVE,收集:
- 官方 CVE 描述和 CVSS 评分
- 供应商安全公告
- GitHub 安全公告(如适用)
- 补丁或修复文档
- 受影响的版本范围
- 建议版本或临时解决方法
提示:使用 research 技能进行网络搜索,以查找供应商公告和 GitHub 安全警报。
依赖项分析
识别存在漏洞的依赖项
获取 CVE 详情后,搜索 Ark 的依赖项:
cd /tmp/ark-analysis # Use analysis skill to clone first
# Go dependencies
grep "package-name" go.mod go.sum
go list -m all | grep "package-name"
# Node.js dependencies
find . -name "package.json" -exec grep -l "package-name" {} \;
npm list package-name # If in a node project
# Python dependencies
find . -name "requirements.txt" -o -name "pyproject.toml" | xargs grep "package-name"
# Docker base images
find . -name "Dockerfile" | xargs grep "FROM"
评估影响
结合 Ark 的具体情况进行评估:
- 部署模式:集群中的 Kubernetes 运算符
- 网络暴露情况:服务通常仅在集群内部可访问
- 信任边界:通常处于受信任的环境中
- 攻击途径:结合 Ark 的架构,哪些攻击方式切实可行?
提示:使用 analysis 技能了解 Ark 的架构和服务边界。
缓解策略
向用户提供选项
重要:始终先向用户提供缓解选项,并等待用户批准后再进行更改。
使用此模板呈现调查结果:
## Security Vulnerability Analysis
### Vulnerability Details
- **CVE**: CVE-YYYY-NNNNN (or "Generic: [description]")
- **Severity**: [Critical/High/Medium/Low] (CVSS: [score])
- **Component**: [Library/package/framework]
- **Description**: [Clear explanation]
### Impact on Ark
- **Affected Services**: [List services/components]
- **Current Version**: [Version in use]
- **Vulnerable Versions**: [Range]
- **Attack Vector**: [How exploitable]
- **Risk Assessment**: [Realistic risk for Ark deployments]
### Mitigation Options
#### Option 1: [Recommended approach] (RECOMMENDED)
- **Action**: Update [component] from v[X] to v[Y]
- **Changes Required**: [Files to modify]
- **Testing Strategy**: [How to verify]
- **Impact**: [Breaking changes, if any]
- **Pros**: [Benefits]
- **Cons**: [Downsides]
#### Option 2: [Alternative approach]
- **Action**: [Alternative fix]
- **Changes Required**: [What changes]
- **Testing Strategy**: [How to verify]
- **Impact**: [Breaking changes, if any]
- **Pros**: [Benefits]
- **Cons**: [Downsides]
### Recommendation
Based on [evidence sources], I recommend **Option 1** because:
1. [Primary reason]
2. [Secondary reason]
### Next Steps
Would you like to proceed with this mitigation?
### Sources
- [CVE Database](https://cve.circl.lu/cve/CVE-YYYY-NNNNN)
- [Vendor Advisory](URL)
停止并等待用户批准,然后再实施。
为修复设置代码库
克隆代码库以进行开发
用户批准缓解方案后,克隆 Ark 以进行更改:
# Clone the repository
git clone [email protected]:mckinsey/agents-at-scale-ark.git
cd agents-at-scale-ark
# Create a security fix branch
git checkout -b security/fix-cve-YYYY-NNNNN
# Verify branch
git branch --show-current
对于分叉:
git clone [email protected]:<username>/agents-at-scale-ark.git
cd agents-at-scale-ark
git remote add upstream [email protected]:mckinsey/agents-at-scale-ark.git
git fetch upstream
git checkout -b security/fix-cve-YYYY-NNNNN upstream/main
实施
应用修复
用户批准且代码库克隆完成后,应用更改:
cd agents-at-scale-ark
# For Go dependencies
go get [email protected]
go mod tidy
# For Node.js dependencies
npm install [email protected]
npm audit fix
# For Python dependencies
# Edit requirements.txt or pyproject.toml
pip install -r requirements.txt
# For Docker base images
# Edit Dockerfile FROM statements
验证
基本测试
cd agents-at-scale-ark
# Run tests
make test
# Build to check for breaking changes
make build
# Search for remaining vulnerable patterns
grep -r "vulnerable-pattern" .
使用 Setup 技能进行集成测试(可选)
对于会影响 Ark 运行时行为的更改,使用 setup 技能在运行中的集群内进行测试:
以下情况适合使用 setup 技能进行测试:
- Go 运算符更改(控制器、Webhook、CRD)
- 服务更新(ark-api、executor 服务)
- 会影响 Kubernetes 交互的更改
- 需要验证的重大变更
Setup 技能工作流:
- 创建 Kind 集群
- 从你的安全修复分支构建 ark-cli
- 安装包含你所做更改的 Ark
- 验证所有 Pod 是否正在运行
- 让你能够实际测试修复效果
以下情况可跳过集成测试:
- 仅更新文档或 CLI
- 更改仅涉及独立的实用函数
- 依赖项不会影响运行时行为
安全相关 PR 模板
提交消息模板
确保当前位于克隆的代码库中:
cd agents-at-scale-ark
git add .
git commit -m "$(cat <<'EOF'
fix: CVE-YYYY-NNNNN in [component]
## Vulnerability Details
- CVE: CVE-YYYY-NNNNN
- Severity: [Critical/High/Medium/Low]
- CVSS Score: [X.X]
- Component: [package/library]
## Impact on Ark
[How this affects Ark services and realistic risk level]
## Changes
- Updated [component] from v[X] to v[Y]
- [Any code changes]
## Testing
- [Tests run and results]
## References
- CVE: https://cve.circl.lu/cve/CVE-YYYY-NNNNN
- Advisory: [URL]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
EOF
)"
推送到远程仓库
# Push the security fix branch
git push origin security/fix-cve-YYYY-NNNNN
Pull Request 模板
创建 PR,并提供详细的安全信息:
gh pr create --title "fix: CVE-YYYY-NNNNN in [component]" --body "$(cat <<'EOF'
## Summary
Addresses security vulnerability CVE-YYYY-NNNNN in [component].
## Vulnerability Details
| Field | Value |
|-------|-------|
| **CVE** | CVE-YYYY-NNNNN |
| **Severity** | [Critical/High/Medium/Low] |
| **CVSS Score** | [X.X] |
| **Component** | [package] |
| **Current Version** | [old] |
| **Patched Version** | [new] |
### Description
[What the vulnerability is and how it could be exploited]
## Impact on Ark
### Affected Components
- [Service 1]: [Impact]
- [Service 2]: [Impact]
### Risk Assessment
**Risk Level**: [Level]
[Realistic assessment of actual risk to Ark deployments]
## Changes Made
- Updated `[component]` from `v[X]` to `v[Y]`
- [Other changes]
## Testing
- ✅ Unit tests pass
- ✅ Integration tests pass
- ✅ Manual verification completed
## References
- **CVE**: https://cve.circl.lu/cve/CVE-YYYY-NNNNN
- **Advisory**: [URL]
- **Patch Notes**: [URL]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
重要说明
CVE API 用法
CIRCL CVE API:
- 端点:
https://cve.circl.lu/api/cve/{CVE-ID} - 返回包含 CVSS 评分、参考链接和受影响版本的 JSON
- 无需身份验证
- 后备方案:如果 API 无法访问,则使用网络搜索
Ark 安全上下文
评估风险时:
- 架构:用于管理 AI 工作负载的 Kubernetes operator
- 组件:Go operator、Python 服务、Node.js CLI
- 部署:通常部署在集群内部的可信环境中
- 重点领域:CRD 控制器、API 服务、执行器服务
技能组合
此技能提供针对特定 CVE 的工具。与以下技能结合使用效果最佳:
- research 技能 - 用于网页搜索、厂商公告和证据收集
- analysis 技能 - 用于克隆 Ark 仓库(只读)并检查代码库结构
- setup 技能 - 用于在运行中的 Ark 集群中进行集成测试
- architecture 技能 - 用于了解服务边界和影响
完整工作流示例:
- 研究 CVE(此技能 + research 技能)
- 分析影响(此技能 + analysis 技能)
- 克隆代码以供开发(此技能)
- 实施修复(此技能)
- 集成测试(此技能 + setup 技能,如有需要)
- 创建 PR(此技能)
必须获得用户批准
未经用户明确批准,绝不实施更改。 这样可以确保:
- 用户了解安全影响
- 方案符合安全策略
- 测试策略适当
- 用户知悉可能造成的破坏性更改
常见漏洞类型
Go 依赖项
- 检查:
go.mod、go.sum - 更新:
go get package@version && go mod tidy - 扫描:
go list -m all
Node.js 依赖项
- 检查:
package.json、package-lock.json - 更新:
npm install package@version - 扫描:
npm audit - 传递依赖:易受攻击的包可能以多个版本出现在嵌套的
node_modules/中。请检查所有锁文件:find . -name "package-lock.json" -exec grep -l "<package>" {} \; jq -r '.packages | to_entries[] | select(.key | contains("<package>")) | "\(.key)\t\(.value.version)"' <lockfile> - npm overrides:在
package.json中使用"overrides"强制指定已修补的版本。但 overrides 是全局的,会影响该包的所有使用方。如果两个使用方需要不兼容的主版本(例如,express 4.x 需要path-to-regexp ~0.1.x,而 router 需要^8.x),override 会导致其中一个无法正常工作。 - 版本冲突解决:当某个传递依赖的版本要求不兼容时,可考虑升级父级包。例如,将 express 4.x 升级到 5.x 后,
path-to-regexp统一为单个 8.x 版本,无需使用 overrides 即可解决冲突。
Python 依赖项
- 检查:
requirements.txt、pyproject.toml - 更新:编辑 requirements 文件
- 扫描:
pip-audit(如可用)
Docker 基础映像
- 检查:
Dockerfile中的 FROM 语句 - 更新:更改基础映像版本
- 扫描:
docker scan或漏洞数据库