Geek-skills-security-audit
This Claude Code skill performs comprehensive security auditing across code, dependencies, and server configurations, detecting vulnerabilities including OWASP Top 10 flaws, hardcoded credentials, and outdated libraries with known CVEs like React2Shell and Log4Shell. Use it when scanning projects for security issues, auditing third-party dependencies, analyzing code for injection attacks and cryptographic failures, checking container configurations, or validating CI/CD pipeline security.
git clone --depth 1 https://github.com/staruhub/ClaudeSkills /tmp/geek-skills-security-audit && cp -r /tmp/geek-skills-security-audit/skills/Geek-skills-security-audit ~/.claude/skills/geek-skills-security-auditSKILL.md
# Security Audit Skill 全面的安全审计工具,覆盖代码静态分析(SAST)、动态测试(DAST)、依赖检查(SCA)和服务器配置审计。 ## 工作流程 安全审计遵循以下步骤: 1. **环境检测** → 识别项目类型和技术栈 2. **依赖检查** → 扫描第三方库漏洞(优先级最高) 3. **静态代码分析** → SAST扫描源代码漏洞 4. **敏感信息检测** → 扫描硬编码的密钥和凭证 5. **配置审计** → 检查安全相关配置 6. **生成报告** → 汇总发现并提供修复建议 ## 快速开始 ### 依赖安装 ```bash # 安装核心Python扫描工具 pip install safety bandit semgrep pip-audit --break-system-packages # 安装Node.js安全工具(如需要) npm install -g npm-audit-html retire ``` ### 一键全面扫描 运行综合扫描脚本: ```bash python3 /path/to/skill/scripts/full_scan.py /path/to/project ``` ## 检测能力 ### 1. 高危漏洞(Critical) | 漏洞类型 | CVE示例 | 检测方式 | |---------|--------|---------| | React2Shell RCE | CVE-2025-55182 | 依赖版本检查 | | Next.js RCE | CVE-2025-66478 | 依赖版本检查 | | Log4Shell | CVE-2021-44228 | 依赖版本检查 | | SQL注入 | CWE-89 | SAST + 模式匹配 | | 命令注入 | CWE-78 | SAST + 模式匹配 | ### 2. OWASP Top 10 2024 - **A01**: Broken Access Control - 访问控制缺陷 - **A02**: Cryptographic Failures - 加密失败 - **A03**: Injection - 注入攻击(SQL/XSS/Command) - **A04**: Insecure Design - 不安全设计 - **A05**: Security Misconfiguration - 安全配置错误 - **A06**: Vulnerable Components - 易受攻击的组件 - **A07**: Authentication Failures - 身份认证失败 - **A08**: Software Integrity Failures - 软件完整性失败 - **A09**: Logging Failures - 日志记录失败 - **A10**: SSRF - 服务端请求伪造 ## 扫描工具使用 ### Python项目 ```bash # Bandit - Python SAST bandit -r ./src -f json -o bandit_report.json # Safety - 依赖漏洞检查 safety check --json > safety_report.json # pip-audit - 依赖审计 pip-audit --format json > pip_audit.json ``` ### JavaScript/Node.js项目 ```bash # npm audit - 依赖漏洞 npm audit --json > npm_audit.json # Retire.js - 检测过时库 retire --js --outputformat json > retire_report.json # React/Next.js 特别检查(CVE-2025-55182) npx fix-react2shell-next --check-only ``` ### 通用检测 ```bash # Semgrep - 多语言SAST semgrep scan --config=auto --json > semgrep_report.json # Gitleaks - 密钥泄露检测 gitleaks detect --source . --report-format json --report-path gitleaks.json # Trivy - 容器/依赖扫描 trivy fs --format json --output trivy.json . ``` ## 服务器安全检查 ### SSH配置审计 ```bash # 检查SSH配置 grep -E "^(PermitRootLogin|PasswordAuthentication|PubkeyAuthentication)" /etc/ssh/sshd_config ``` ### 防火墙状态 ```bash # UFW状态 sudo ufw status verbose # iptables规则 sudo iptables -L -n -v ``` ### 权限检查 ```bash # 查找SUID文件 find / -perm -4000 -type f 2>/dev/null # 检查world-writable文件 find / -perm -002 -type f 2>/dev/null ``` ## 修复建议 ### React2Shell漏洞修复(CVE-2025-55182) **受影响版本**: - React 19.0, 19.1.0, 19.1.1, 19.2.0 - Next.js ≥14.3.0-canary.77, ≥15, ≥16 **修复步骤**: ```bash # 使用官方修复工具 npx fix-react2shell-next # 或手动升级 # Next.js 15.x -> 升级到 15.1.4+ # Next.js 14.x -> 降级到稳定14.x版本 ``` **修复后必做**: - 轮换所有应用密钥(特别是2024年12月4日后暴露的) - 检查是否有异常进程或网络连接 ### 常见漏洞修复参考 详见 `references/remediation_guide.md` ## 报告格式 扫描完成后生成的报告包含: ``` security_report/ ├── summary.md # 执行摘要 ├── critical.json # 高危漏洞 ├── dependencies.json # 依赖漏洞 ├── code_issues.json # 代码问题 ├── secrets.json # 泄露的密钥 └── recommendations.md # 修复建议 ``` ## 最佳实践 1. **每次提交前**运行快速扫描 2. **每日**运行依赖漏洞检查 3. **每周**运行完整安全审计 4. 将扫描集成到 **CI/CD** 流水线 5. 订阅安全公告(如CVE、NVD) 6. 定期更新扫描工具和规则库 ## 参考资料 - 详细漏洞检测规则: `references/detection_rules.md` - 修复指南: `references/remediation_guide.md` - 服务器加固: `references/server_hardening.md`
Build and maintain a structured LLM-generated wiki for any codebase. Use when the user asks to analyze/understand/document a codebase, build a code wiki, create project documentation from source, or update an existing .llm-wiki. Triggers on phrases like "build wiki", "analyze this codebase", "document this project", "update wiki", "llm-wiki", or when entering an unfamiliar project that has no .llm-wiki yet.
A股专业分析师助手,提供每日股价分析、选股策略和投资建议。适用于:(1) 获取A股实时行情和历史数据,(2) 技术面分析(K线形态、MACD、KDJ、RSI、布林带等),(3) 基本面分析(财务指标、估值分析),(4) 板块热点追踪,(5) 选股策略筛选,(6) 量化因子分析,(7) 生成每日股市分析报告。当用户询问"帮我分析股票"、"今日选股"、"A股行情分析"、"技术分析"、"基本面分析"、"量化选股"等相关问题时触发。
AI咨询/销售的对话策略助手。当用户需要准备AI方案沟通、跟业务部门聊AI落地、写AI提案、应对客户异议、做AI培训破冰时使用。触发场景:"怎么跟老板聊AI"、"客户说AI不靠谱"、"准备一个AI方案汇报"、"帮我想想怎么推AI"、"业务部门不配合"、"AI项目怎么卖"、"demo之后怎么跟进"。也适用于AI咨询师、技术合伙人、CTO做内部AI推广。
Windows C盘清理和磁盘空间管理工具。当用户需要清理C盘、释放磁盘空间、查找大文件、分析磁盘占用、删除临时文件、清理缓存、管理Windows系统垃圾文件时使用此skill。适用于以下场景:(1)C盘空间不足需要清理;(2)查找和删除大文件;(3)分析磁盘空间占用;(4)清理系统临时文件和缓存;(5)清理浏览器缓存;(6)清理回收站;(7)清理系统日志;(8)优化Windows磁盘空间。
>
资深高考命题专家助手,提供专业的命题指导和评审服务。适用于创作高考试题、评审试题质量、分析试卷结构、了解命题趋势等场景。结合文档工具提取解压文件,使用网络搜索了解最新命题趋势,使用分析工具评估题目质量和试卷结构。涵盖"一核四层四翼"评价体系、2025年命题趋势、题型规范、评分标准、命题流程等多个维度,符合高考命题最佳实践。
胥克谦式AI-Native产品开发方法论。适用于:(1) 使用AI Agent(Claude Code、Codex、Cursor等)进行产品级软件开发,(2) 设计和优化Harness/Skill体系,(3) 文档驱动开发(SDD)流程,(4) 构建自动化质量门禁和eval机制,(5) Token成本优化与缓存策略,(6) 产品人转型开发者的AI编程实践。触发场景包括"帮我设计开发流程"、"怎么降低token成本"、"怎么提高AI编码质量"、"文档驱动"、"质量门禁"、"harness设计"、"单agent vs multi-agent"、"自动化迭代"、"AI产品开发"、"SDD"、"eval机制"等。即使用户只是说"帮我用AI写代码"或"怎么让agent干活更靠谱"也应触发。
PDF解析工具,将复杂PDF文档转换为LLM友好的Markdown/JSON格式。适用于:(1) 将PDF转换为Markdown或JSON格式,(2) 提取PDF中的文本、表格、公式、图像,(3) 处理学术论文、技术文档、商业报告的PDF解析,(4) 为RAG应用准备高质量文档数据,(5) 批量处理PDF文件。触发关键词包括:"PDF解析"、"PDF转Markdown"、"PDF转JSON"、"提取PDF表格"、"提取PDF公式"、"MinerU"、"文档解析"、"PDF extraction"、"convert PDF"、"parse PDF"等。