用途
V3 Security Overhaul 用于为 claude-flow v3 编排一次全面的安全改造,解决关键漏洞,并借助专门的 v3 安全代理建立安全优先的开发实践。
主要能力
技能覆盖三个方向的任务编排:安全架构、CVE 修复和安全测试。资料中提供的快速入门示例为并行发起三个任务:
- 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 涉及弱密码哈希。原做法是使用带硬编码盐的 SHA-256:
const hash = crypto.createHash('sha256').update(password + salt).digest('hex');
新做法改为使用 12 轮 bcrypt:
import bcrypt from 'bcrypt'; const hash = await bcrypt.hash(password, 12);
CVE-3 涉及硬编码凭证,改为生成安全的随机凭证:
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';
const { stdout } = await execFile('git', [userInput], { shell: false });
成功度量
- 安全评分:90/100(npm audit + 自定义扫描)
- CVE 解决:关键漏洞 100% 修复
- 测试覆盖率:安全关键代码超过 95%
- 实施情况:所有安全模式均已文档化并通过测试
使用方式
资料通过 Task(...) 形式给出并行编排示例,并列出对应的 npm 命令与代码片段。
适用场景与限制
该技能面向 claude-flow v3 的安全改造场景。资料未提供除上述内容之外的功能、收费、价格、平台或效果信息,相关细节暂未提供。