关于 V3 Security Overhaul
面向 claude-flow v3 安全改造的技能,可协调专用 Agent 修复漏洞并建立安全开发实践。内容包括依赖更新、密码哈希、凭据生成、输入验证、路径处理和命令执行建议。
主要功能
- 01协调安全领域的专用 Agent
- 02提供依赖更新和 CVE 修复指导
- 03安全密码哈希与凭据生成
- 04输入验证和路径清理模式
- 05安全执行命令的指导
适用场景
- 01规划 claude-flow v3 安全审查
- 02修复易受攻击的依赖和凭据问题
- 03添加输入验证与路径遍历防护
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ ruvnet/ ruflo --skill v3-security-overhaul安装后在 Claude Code 中输入/v3-security-overhaul确认已加载。
详细介绍
V3 安全改造
此技能的作用
协调 claude-flow v3 的全面安全改造,解决关键漏洞,并通过专用的 v3 安全 Agent 建立安全优先的开发实践。
快速开始
# Initialize V3 security domain (parallel)
Task("Security architecture", "Design v3 threat model and security boundaries", "v3-security-architect")
Task("CVE remediation", "Fix CVE-1, CVE-2, CVE-3 critical vulnerabilities", "security-auditor")
Task("Security testing", "Implement TDD London School security framework", "test-architect")
关键安全修复
CVE-1:存在漏洞的依赖项
npm update @anthropic-ai$claude-code@^2.0.31
npm audit --audit-level high
CVE-2:弱密码哈希
// ❌ Old: SHA-256 with hardcoded salt
const hash = crypto.createHash('sha256').update(password + salt).digest('hex');
// ✅ New: bcrypt with 12 rounds
import bcrypt from 'bcrypt';
const hash = await bcrypt.hash(password, 12);
CVE-3:硬编码凭据
// ✅ Generate secure random credentials
const apiKey = crypto.randomBytes(32).toString('hex');
安全模式
输入验证(Zod)
import { z } from 'zod';
const TaskSchema = z.object({
taskId: z.string().uuid(),
content: z.string().max(10000),
agentType: z.enum(['security', 'core', 'integration'])
});
路径清理
function securePath(userPath: string, allowedPrefix: string): string {
const resolved = path.resolve(allowedPrefix, userPath);
if (!resolved.startsWith(path.resolve(allowedPrefix))) {
throw new SecurityError('Path traversal detected');
}
return resolved;
}
安全的命令执行
import { execFile } from 'child_process';
// ✅ Safe: No shell interpretation
const { stdout } = await execFile('git', [userInput], { shell: false });
成功指标
- 安全评分:90/100(npm audit + 自定义扫描)
- CVE 解决率:100% 的严重漏洞均已修复
- 测试覆盖率:安全关键代码 >95%
- 实现情况:所有安全模式均已记录并测试
评论
支持 Markdown