Hainrixz/cyber-neo
GitHub: Hainrixz/cyber-neo
面向 Claude Code 的开源网络安全智能体,一次扫描覆盖多安全域并输出可操作修复报告。
Stars: 57 | Forks: 5
# CYBER NEO
### 面向Claude Code的开源网络安全智能体
**Protect your apps. Protect your users. Protect your community.**
[](https://opensource.org/licenses/MIT)
[](https://owasp.org/www-project-top-ten/)
[-00ff41.svg)](https://cwe.mitre.org/top25/)
[](https://claude.ai/code)
[](https://tododeia.com)
[](https://instagram.com/soyenriquerocha)
*Shipped by [@soyenriquerocha](https://instagram.com/soyenriquerocha) | Built by the [Tododeia](https://tododeia.com) community — empowering developers to ship secure software.*
## 什么是 Cyber Neo?
**Cyber Neo** 是一个全面的网络安全分析智能体,运行在 [Claude Code](https://claude.ai/code) 内部。将其指向你电脑上的任意项目,它会执行深度安全审计——扫描你的代码、依赖项、密钥、基础设施和供应链中的漏洞。它会生成一个专业的优先级报告,并提供可操作的修复指导,让你在问题变成事件之前就进行修复。
**无需安全专业知识。** 只需运行 `/cyber-neo`,让智能体完成其余工作。
Cyber Neo 的使命是:我们的社区 [tododeia.com](https://tododeia.com) 正在构建应用、工具和产品。我们希望帮助社区中的每一位开发者保护他们正在构建的内容。这个智能体是我们的贡献——开源、免费,并且被设计为作为 Claude Code 技能可用的最全面的安全扫描器。
## 为什么要使用 Cyber Neo?
大多数安全工具需要安装、配置以及解读结果的专业知识。Cyber Neo 有所不同:
| 传统安全工具 | Cyber Neo |
|---|---|
| 需要安装和设置 | 作为 Claude Code 技能即可立即使用 |
| 需要安全专业知识来解读 | 纯语言发现的代码级修复 |
| 仅扫描单一类别(SAST *或* SCA *或* 密钥) | 一次扫描 **11 个类别** |
| 输出原始发现且无上下文 | 带有 CWE/OWASP 分类和修复示例的发现 |
| 顺序运行 | **5 个并行子智能体**,速度更快 |
| 需要付费许可证才能获得完整覆盖 | **100% 免费且开源** |
## 它扫描什么?
Cyber Neo 覆盖 **11 个安全领域**,涵盖所有主要漏洞类别:
| # | 类别 | 发现内容 | 方法 |
|---|----------|--------------|-----|
| 1 | **代码安全(SAST)** | SQL 注入、XSS、命令注入、代码注入、路径遍历、SSRF、反序列化、原型污染 | Semgrep(可选)+ Claude 原生模式分析 |
| 2 | **认证与授权** | 缺少认证中间件、JWT 配置错误、访问控制破坏、IDOR、会话管理缺陷、缺少 RBAC | 使用 `auth-authz-patterns.md` 进行 Claude 原生分析 |
| 3 | **密码学安全** | 弱算法(MD5、SHA1、DES、RC4)、硬编码密钥/IV、TLS 绕过、不安全的随机数、弱密钥长度 | 使用 `crypto-patterns.md` 进行 Claude 原生分析 |
| 4 | **密钥检测** | 60+ 正则表达式模式:AWS、GCP、Azure、GitHub、Slack、Stripe、数据库凭证、私钥、API 密钥、JWT 令牌、.env 文件 | Python 批量扫描器 + Gitleaks(可选) |
| 5 | **依赖漏洞(SCA)** | npm、pip、cargo、bundler、composer、Go 依赖中的已知 CVE | Trivy / npm audit / pip-audit / cargo-audit(可选) |
| 6 | **Web 安全** | 缺少安全头(CSP、CORS、HSTS)、CSRF、Cookie 标志、文件上传漏洞、开放重定向 | 使用 `web-security-patterns.md` 进行 Claude 原生分析 |
| 7 | **供应链安全** | 锁定文件完整性、依赖混淆、域名抢注、未固定版本、恶意包 | Python 锁定文件检查器 + Claude 原生分析 |
| 8 | **CI/CD 安全** | GitHub Actions 脚本注入、权限过于宽松、未固定的操作、流程中的密钥泄露 | 使用 `cicd-security.md` 进行 Claude 原生分析 |
| 9 | **Docker 与容器安全** | 根用户、未固定的基础镜像、层中的密钥、特权容器、Docker 套接字暴露 | 使用 `iac-docker.md` 进行 Claude 原生分析 |
| 10 | **错误处理** | 生产环境中的调试模式、堆栈跟踪暴露、空 catch 块、缺少错误边界 | 使用 `error-handling-patterns.md` 进行 Claude 原生分析 |
| 11 | **日志安全** | 日志中的敏感数据、日志注入、缺少安全事件日志 | 使用 `logging-patterns.md` 进行 Claude 原生分析 |
### 标准覆盖范围
Cyber Neo 将每个发现映射到行业标准:
- **全部 10 个 OWASP 2025 Top 10 类别**——包括两个新条目:*A03 软件供应链故障* 和 *A10 异常条件处理不当*
- **15+ 个 CWE Top 25(2025)条目**——XSS、SQLi、CSRF、命令注入、SSRF、反序列化、路径遍历、缺少认证、加密错误、硬编码凭证等
- **CVSS 严重性分级**——关键(9.0-10.0)、高(7.0-8.9)、中(4.0-6.9)、低(1.0-3.9)、信息(0.0-0.9)
## 支持的语言与框架
| 语言 | 框架 | 参考文件 |
|----------|-----------|---------------|
| **JavaScript / TypeScript** | Express、Next.js、React、Vue、Angular、Fastify、NestJS、Koa、Electron | `lang-javascript.md`(924 行) |
| **Python** | Django、Flask、FastAPI、Tornado、Starlette | `lang-python.md`(935 行) |
| **任意语言** | 通用 SAST 模式(eval、exec、硬编码凭证、命令注入) | 内置在 SKILL.md 中 |
## 安装
### 选项 1:克隆到技能目录(推荐)
```
cd ~/.claude/skills
git clone https://github.com/Hainrixz/cyber-neo.git
```
仅此而已。Claude Code 会自动发现该技能。
### 选项 2:从任意位置创建符号链接
```
git clone https://github.com/Hainrixz/cyber-neo.git ~/projects/cyber-neo
ln -s ~/projects/cyber-neo ~/.claude/skills/cyber-neo
```
### 选项 3:Claude Code 插件市场
```
/plugin install cyber-neo
```
### 验证安装
在 Claude Code 中打开并输入:
```
/cyber-neo
```
如果安装正确,Cyber Neo 会要求你输入要扫描的项目路径。
## 使用方法
### 基础扫描
```
# 扫描特定项目
/cyber-neo /path/to/your/project
# 扫描当前工作目录
/cyber-neo .
```
### 运行时的操作
```
Phase 1: Reconnaissance
Detects your tech stack, frameworks, and infrastructure
Estimates project scope and applies scanning tier
Phase 2-6: Parallel Analysis (5 subagents)
Dependency vulnerabilities (SCA)
Code security patterns (SAST)
Secret detection (60+ regex patterns)
Configuration & infrastructure checks
Supply chain & CI/CD security
Phase 7: Report Generation
Deduplicates, scores, and classifies findings
Generates professional security report
```
### 输出
报告将保存到你的桌面:
```
~/Desktop/cyber-neo-report-{project-name}-{YYYY-MM-DD}.md
```
## 报告格式
每个 Cyber Neo 报告都包含:
### 执行摘要
```
Risk Score: 67/100 (High Risk)
| Severity | Count |
|----------|-------|
| Critical | 2 |
| High | 5 |
| Medium | 8 |
| Low | 3 |
| Info | 4 |
Top 3 Priority Actions:
1. Fix SQL injection in src/api/users.js:42 — use parameterized queries
2. Rotate leaked AWS key in .env — key is active and exposed
3. Add authentication to /api/admin routes — currently public
```
### 详细发现
每个发现包括:
```
[CN-001] SQL Injection in User Query
Severity: Critical (CVSS ~9.8)
CWE: CWE-89 (SQL Injection)
OWASP: A05:2025 (Injection)
Location: src/api/users.js:42
Description: User input is directly concatenated into SQL query
without parameterization, enabling SQL injection attacks.
Evidence:
const query = `SELECT * FROM users WHERE id = ${req.params.id}`;
Remediation:
const query = 'SELECT * FROM users WHERE id = $1';
const result = await db.query(query, [req.params.id]);
```
### 附加章节
- **依赖漏洞**——包含包名、版本和修复版本的 CVE 表格
- **供应链评估**——锁定文件状态、依赖项固定、CI/CD 流程安全
- **扫描元数据**——扫描的文件数量、覆盖率百分比、使用的工具、扫描持续时间
## 工作原理——架构深度解析
Cyber Neo 被构建为一个 Claude Code **技能**——一个基于 Markdown 的提示,用于协调 Claude 的分析能力。该架构包含三层:
### 第 1 层:SKILL.md——编排引擎
`SKILL.md` 文件(563 行)是 Cyber Neo 的大脑。它包含:
- ** 个阶段分析流水线**,每个阶段都有明确的指令
- **子智能体分发模板**,用于并行分析
- **严重性评分标准**,与 CVSS 对齐
- **报告生成指令**,包含去重和分类规则
- **安全约束**(只读铁律)在每个子智能体提示中强化
- **边缘情况处理**,针对空项目、不支持的语言和大代码库
### 第 2 层:参考文件——安全知识库
总计 **10,000+ 行** 的 14 个参考文件:
```
references/
├── owasp-top-10.md # OWASP 2025 classification + scoring guide
├── cwe-top-25.md # CWE mappings with detection patterns
├── secrets-patterns.md # 60+ regex patterns for secret detection
├── auth-authz-patterns.md # JWT, sessions, RBAC, IDOR patterns
├── crypto-patterns.md # Weak crypto, hardcoded keys, TLS bypass
├── web-security-patterns.md # Headers, CORS, CSRF, SSRF, uploads, redirects
├── error-handling-patterns.md # Debug mode, stack traces, empty catches
├── logging-patterns.md # Sensitive data in logs, log injection
├── cicd-security.md # GitHub Actions injection, permissions
├── supply-chain.md # Dependency confusion, typosquatting, lock files
├── lang-javascript.md # Node/Express/Next.js/React patterns (924 lines)
├── lang-python.md # Django/Flask/FastAPI patterns (935 lines)
├── iac-docker.md # Dockerfile/Compose security (1,005 lines)
└── report-template.md # Report format specification
```
每个参考文件包含:
- **可直接用于 grep 的正则表达式模式**,Claude 可用于分析
- **漏洞代码示例**,展示实际问题
- **安全代码示例**,展示修复方法
- **CWE 和 OWASP 2025 映射**,用于分类
- **严重性评级**,用于一致评分
### 第 3 层:Python 脚本——批处理
两个 Python 脚本处理批处理任务,其速度比顺序的 Claude 分析更快:
| 脚本 | 用途 | 行数 |
|--------|---------|-------|
| `scan_secrets.py` | 对所有文件进行基于正则表达式的密钥扫描。60+ 个模式覆盖 AWS、GCP、GitHub、Slack、Stripe、数据库凭证、私钥、API 密钥等。包含智能白名单以减少误报。 | 510 |
| `check_lockfiles.py` | 对 10 个包管理器(npm、yarn、pnpm、bun、pip、pipenv、poetry、cargo、bundler、composer、Go)进行锁定文件完整性验证。检测缺少锁定文件、未固定依赖项和风险生命周期脚本。 | 340 |
两者均具备以下特点:
- 仅使用 **Python 标准库**(零依赖)
- 输出 **结构化 JSON**,便于解析
- 优雅处理边缘情况(空目录、缺失文件、二进制文件)
- 严格 **只读**——从不修改目标项目
## 可选:外部工具集成
Cyber Neo 开箱即用,依赖 Claude 原生分析。对于更深入的扫描,可安装以下可选工具:
| 工具 | 类别 | 安装 | 补充功能 |
|------|----------|---------|-------------|
| [Semgrep](https://semgrep.dev) | SAST | `brew install semgrep` | 3,000+ 社区规则,覆盖 30+ 种语言 |
| [Trivy](https://trivy.dev) | SCA | `brew install trivy` | 全面的依赖漏洞数据库 |
| [Gitleaks](https://gitleaks.io) | 密钥 | `brew install gitleaks` | Git 历史扫描,检测已提交的密钥 |
| [pip-audit](https://pypi.org/project/pip-audit/) | Python SCA | `pip install pip-audit` | Python 包漏洞检查 |
| [cargo-audit](https://crates.io/crates/cargo-audit) | Rust SCA | `cargo install cargo-audit` | Rust crate 漏洞检查 |
安装这些工具后,Cyber Neo 会自动检测并使用它们,结合内置分析实现更深层次的覆盖。
## 范围分级——如何处理大型项目
Cyber Neo 根据项目大小调整其扫描策略:
| 级别 | 文件数量 | 策略 |
|------|-----------|----------|
| **小型** | < 1,000 | 完整扫描——分析每个源文件 |
| **中型** | 1,000 - 10,000 | 针对性扫描——优先处理 `src/`、`app/`、API 路由、认证中间件、配置文件 |
| **大型** | 10,000+ | 关键路径扫描——聚焦入口点、认证、配置、依赖项。报告会显示覆盖率百分比 |
最终报告始终会显示扫描的文件数量与跳过数量,让你清楚了解覆盖范围。
## 安全保障
Cyber Neo 遵循严格的 **只读铁律**:
| 规则 | 描述 |
|------|-------------|
| **永不修改文件** | 你的项目文件永远不会被更改、删除或创建 |
| **永不执行代码** | 不运行 `npm start`、`python app.py` 或任何项目执行 |
| **永不安装包** | 不执行 `npm install`、`pip install` 或任何依赖修改 |
| **永不运行修复命令** | 不执行 `npm audit --fix` 或任何自动修复 |
| **单次写入操作** | 仅将报告文件写入 `~/Desktop/` |
| **密钥被脱敏** | 检测到的密钥不会包含在报告中 |
这些约束在顶层和每个子智能体提示中都会强制执行。
## OWASP 2025 Top 10 覆盖映射
| ID | 类别 | 处理位置 |
|----|----------|----------------|
| A01:2025 | 访问控制破坏 | `auth-authz-patterns.md` —— 缺少中间件、IDOR、权限提升 |
| A02:2025 | 安全配置错误 | `web-security-patterns.md` + `error-handling-patterns.md` —— 头信息、调试模式、环境配置 |
| A03:2025 | 软件供应链故障 | `supply-chain.md` + `cicd-security.md` —— 依赖混淆、域名抢注、CI 注入 |
| A04:2025 | 密码学故障 | `crypto-patterns.md` + `secrets-patterns.md` —— 弱算法、硬编码密钥 |
| A05:2025 | 注入 | `lang-javascript.md` + `lang-python.md` + `web-security-patterns.md` —— SQLi、XSS、SSRF |
| A06:2025 | 不安全设计 | `auth-authz-patterns.md` + `web-security-patterns.md` —— 结构性设计缺陷 |
| A07:2025 | 认证失败 | `auth-authz-patterns.md` —— JWT、会话、密码哈希、OAuth |
| A08:2025 | 软件/数据完整性故障 | `lang-*.md` + `supply-chain.md` —— 反序列化、依赖项完整性 |
| A09:2025 | 日志/监控故障 | `logging-patterns.md` —— 日志中的敏感数据、缺少安全事件日志 |
| A10:2025 | 异常条件处理不当 | `error-handling-patterns.md` —— 空 catch 块、堆栈跟踪、调试模式 |
## 修复工作流程
运行 Cyber Neo 后,我们推荐采用 **测试驱动的安全修复** 方法:
```
1. Read the report — start with Critical findings
2. Pick the highest-severity finding
3. Write a test that proves the vulnerability exists
4. Apply the fix from the remediation guidance
5. Run the test — verify it passes
6. Re-run /cyber-neo to confirm the finding is resolved
7. Repeat for the next finding
```
如果你安装了 [Superpowers](https://github.com/obra/superpowers) 插件,请使用其 TDD 工作流程进行结构化修复。
## 技能集成
Cyber Neo 可与其他 Claude Code 技能协同工作,增强分析能力:
| 技能 | 集成方式 |
|-------|------------|
| [/last30days](https://github.com/mvanhorn/last30days-skill) | 调研与你的技术栈相关的新兴威胁和社区讨论 |
| /deep-research | 对扫描中发现的陌生 CVE 或新兴威胁进行上下文查找 |
| [Superpowers](https://github.com/obra/superpowers) | 以 TDD 方式驱动的修复流程,系统化修复发现的问题 |
## 项目结构
```
cyber-neo/
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── skills/
│ └── cyber-neo/
│ ├── SKILL.md # Orchestration engine (563 lines)
│ ├── scripts/
│ │ ├── scan_secrets.py # Batch secret scanner (510 lines)
│ │ └── check_lockfiles.py # Lock file checker (340 lines)
│ └── references/ # Security knowledge base (14 files, 10K+ lines)
│ ├── owasp-top-10.md
│ ├── cwe-top-25.md
│ ├── secrets-patterns.md
│ ├── auth-authz-patterns.md
│ ├── crypto-patterns.md
│ ├── web-security-patterns.md
│ ├── error-handling-patterns.md
│ ├── logging-patterns.md
│ ├── cicd-security.md
│ ├── supply-chain.md
│ ├── lang-javascript.md
│ ├── lang-python.md
│ ├── iac-docker.md
│ └── report-template.md
├── CLAUDE.md # Contributor guidelines
├── LICENSE # MIT
└── README.md # This file
```
## 路线图
### v0.1.0(当前)
- 7 个阶段分析流水线,带并行智能体
- JavaScript/TypeScript + Python 语言支持
- 14 个安全参考文件(10,000+ 行)
- 60+ 密钥检测模式
- 10 个包管理器支持,用于锁定文件检查
- 完整的 OWASP 2025 Top 10 和 CWE Top 25 覆盖
- 生成带 CWE/OWASP 映射的专业报告
### v0.2.0(规划中)
- Go、Ruby/Rails、Java/Spring、Rust 语言模式
- Kubernetes 和 Terraform/IaC 安全扫描
- OWASP Top 10 适用于 LLMs(提示注入、AI 应用中的敏感数据)
- 移动安全模式(React Native、Flutter)- 无服务器/Lambda 安全模式
- GraphQL 安全分析
- SARIF 输出格式,用于 CI/CD 集成
- 配置子技能(`/cyber-neo:config`)
### v0.3.0(未来)
- 会话启动钩子,自动建立安全上下文
- ASVS(应用程序安全验证标准)映射
- 趋势跟踪(重新扫描并对比发现)
- 跨平台支持(Cursor、Competitor CLI、Windsurf)
- CI/CD 集成模式(GitHub Action 包装器)
- 竞态条件检测模式
## 贡献
我们欢迎社区贡献。请参阅 [CLAUDE.md](CLAUDE.md) 获取详细的贡献指南。
### 关键原则
1. **SKILL.md 是产品**——其质量决定了智能体的好坏
2. **参考文件是纯粹的知识**——可直接用于 grep 的模式,并带有 CWE/OWASP 映射
3. **脚本仅使用标准库**——零 pip 依赖
4. **每个发现都需要分类**——CWE ID、OWASP 类别、严重性和修复方法
5. **对目标项目只读**——从不修改我们正在扫描的内容
### 如何添加新语言
1. 按照现有模式创建 `references/lang-{language}.md`
2. 添加框架检测模式、漏洞模式(带 grep 正则表达式)和安全/漏洞代码示例
3. 将每个模式映射到 CWE 和 OWASP 2025 类别
4. 更新 SKILL.md 的第 1.1 阶段以检测新语言
5. 更新 SKILL.md 的第 1.3 阶段以加载新参考文件
6. 针对该语言中故意设计有漏洞的项目进行测试
## 社区
Cyber Neo 由 **[@soyenriquerocha](https://instagram.com/soyenriquerocha)** 发布,并由 **[Tododeia](https://tododeia.com)** 社区构建——一个不断壮大的开发者网络,共同构建应用、工具和产品。我们相信每位开发者都应免费获得企业级安全工具。
- **创建者:** [@soyenriquerocha](https://instagram.com/soyenriquerocha) 在 Instagram 上
- **社区:** [tododeia.com](https://tododeia.com)
- **GitHub:** [github.com/Hainrixz/cyber-neo](https://github.com/Hainrixz/cyber-neo)
- **许可证:** MIT —— 可使用、修改、分享
## 感谢
Cyber Neo 建立在安全社区的肩膀之上:
- [OWASP Foundation](https://owasp.org) —— Top 10 和 ASVS 标准
- [MITRE](https://cwe.mitre.org) —— CWE 漏洞分类
- [Semgrep](https://semgrep.dev) —— 静态分析模式和规则
- [Trivy](https://trivy.dev) —— 漏洞数据库
- [Superpowers](https://github.com/obra/superpowers) —— 技能架构模式
- [last30days](https://github.com/mvanhorn/last30days-skill) —— 研究集成模式
**Shipped by [@soyenriquerocha](https://instagram.com/soyenriquerocha) | Built with purpose. Open source forever.**
*Protecting the apps our community builds — one scan at a time.*
[Get Started](#installation) | [Report an Issue](https://github.com/Hainrixz/cyber-neo/issues) | [Join the Community](https://tododeia.com) | [Follow @soyenriquerocha](https://instagram.com/soyenriquerocha)
标签:Claude Code, CWE Top 25, OWASP 2025 Top 10, Tododeia, 专业报告, 子代理, 并行分析, 开发者安全, 数据可视化, 漏洞分析, 社区安全, 秘密模式, 结构化查询, 网络安全代理, 自动化安全, 路径探测, 逆向工具, 防护