mcpField
V
V3 Security Overhaul

V3 Security Overhaul

github.com/ruvnet安全101.0k38 次安装2 天前更新
代码仓库

关于 V3 Security Overhaul

V3 Security Overhaul 是面向 claude-flow v3 的技能,通过专用 Agent 协调安全修复和安全开发实践,涵盖漏洞处理、输入校验、路径清理与安全命令执行。

主要功能

  1. 01协调安全 Agent
  2. 02处理依赖漏洞
  3. 03使用 bcrypt 哈希密码
  4. 04校验输入并清理路径
  5. 05避免通过 Shell 解释执行命令

适用场景

  1. 01规划 v3 威胁模型
  2. 02修复严重 CVE
  3. 03编写安全测试

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/ruvnet/ruview --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