Communitygithub.com

仓库安全扫描

扫描代码仓库以发现高信号安全漏洞并生成报告。适用于审计代码库中的泄露密钥或易受攻击的依赖项,在发布前或接手不熟悉的仓库时使用。运行 gitleaks 密钥扫描和 osv-scanner 依赖项检查。

仓库安全扫描 是什么?

此技能专注于对目标仓库进行高信号安全扫描,涵盖密钥泄露(通过 gitleaks)和依赖项漏洞(通过 osv-scanner)两大主要风险。它专为开发者设计,可在本地快速运行,输出人类可读的报告(report.md)和机器可读的摘要(summary.json),同时保留原始工具输出便于深度分析。该技能强调低误报率:gitleaks 具有强默认配置并支持通过 .gitleaks.toml 忽略误报;osv-scanner 通过 OSV 数据库进行准确的依赖项匹配,通常比各生态系统的原生审计命令噪音更低。它仅执行只读扫描,不上传源代码,密钥输出默认经过脱敏处理。适用于 CI 前检查、代码审计或接手新仓库时的快速安全评估。支持 macOS 和 Linux,需预先安装 gitleaks、osv-scanner 和 jq。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/unisone/openclaw-skill-suite/tree/main/skills/repo-security-scan

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

仓库安全扫描 是做什么的?

扫描目标仓库的高信号安全漏洞并生成报告。

功能(MVP)

  • 密钥扫描:使用 gitleaks(本地扫描;日志中密钥已脱敏)
  • 依赖项漏洞扫描:使用 osv-scanner(将依赖项与 OSV 数据库匹配)

输出:

  • report.md —— 人类可读摘要
  • summary.json —— 机器可读摘要
  • 原始工具输出(gitleaks.json、osv.json)及日志

为何选择此技术栈(信号/噪音)

  • gitleaks:默认配置强大,速度快,通过 .gitleaks.toml / .gitleaksignore 可轻松抑制误报。
  • osv-scanner:通过 OSV 进行准确的依赖项漏洞匹配(生态系统支持广泛,通常比各生态系统的“审计”命令噪音更低)。

(其他扫描器如 Semgrep/SAST 和特定语言审计工具可在后续通过显式 --deep 模式添加,避免 CI 失败时产生过多噪音。)

安全性

  • 对文件执行只读扫描。
  • 不上传源代码。
  • gitleaks 输出已脱敏(--redact),报告不会打印密钥。
  • osv-scanner 默认使用网络访问查询 OSV(并可能访问 deps.dev 获取包元数据)。它发送的是 依赖元数据,而非源代码。

使用方法

本地使用

在当前仓库中:

# 扫描当前仓库并将输出写入 .repo-security-scan/out
bash scripts/repo-security-scan/scan.sh --repo .

# 扫描其他仓库
bash scripts/repo-security-scan/scan.sh --repo /path/to/target --out /tmp/repo-security-scan-out

# 查看报告
cat .repo-security-scan/out/report.md

演示

bash scripts/demo.sh            # 扫描当前仓库
bash scripts/demo.sh /path/repo # 扫描目标仓库

输出

在输出目录中(默认:<技能套件>/.repo-security-scan/out):

  • report.md
  • summary.json
  • gitleaks.json、gitleaks.log
  • osv.json、osv.log

退出码:

  • 0 无发现
  • 1 发现漏洞
  • 2 扫描器错误(缺少工具、执行失败)

配置 / 允许列表

扫描具体项目时,优先使用仓库本地配置:

  • gitleaks:
    • <仓库>/.gitleaks.toml
    • <仓库>/.gitleaksignore
  • osv-scanner:
    • <仓库>/osv-scanner.toml(仅适用于该目录)

本技能套件也包含保守的默认配置,位于:

  • .repo-security-scan/gitleaks.toml
  • .repo-security-scan/.gitleaksignore
  • .repo-security-scan/osv-scanner.toml

强制指定特定的 osv-scanner 配置文件:

bash scripts/repo-security-scan/scan.sh --repo /path/repo --osv-config /path/to/osv-scanner.toml

安装前提

  • macOS:
    • brew install gitleaks osv-scanner jq
  • Ubuntu:
    • sudo apt-get update && sudo apt-get install -y jq
    • 从发布版安装 gitleaks 和 osv-scanner,或通过 go install 编译。

Individual skills in this repo

This repo contains 10 individual skills — each has its own dedicated page.

astra-operator

Delegate computer-use and browser tasks to OpenAI

design-inspo

Find design inspiration from curated gallery sites. Use when a user needs UI/UX references, design examples, or inspiration for specific components (navbars, CTAs, hero sections, landing pages, etc.), full websites, SaaS products, mobile apps, animations, icons, branding, or design systems. Helps select the right inspiration source and browse examples.

graphrag

Build a GraphRAG pipeline over documents. Use when plain vector search returns chunks without connections, when questions need multi-hop reasoning (

mundane-demos

Demo strategy that leads with mundane real-life utility instead of benchmarks. Use when presenting an AI agent or product to non-technical audiences. Covers picking tasks the viewer did this morning, showing end-to-end completion, and letting speed be the wow factor.

release-notes

Generate polished release notes from git history. Use when cutting a release, before publishing a GitHub release, or when you need a changelog from commits between two tags. Groups changes by type, surfaces breaking changes, and drafts highlights.

remotion-product-demos

Create Apple-keynote-quality product demo videos with Remotion. Covers glass phone mockups, floating 3D spheres, typing animations, card UIs, ripple effects, and smooth scene transitions. Use when asked to create product demos, app showcase videos, UI walkthrough animations, or

secure-agent-design

Security architecture patterns for personal AI agents that touch real accounts. Use when designing an agent with access to inbox, calendar, finances, or shopping. Covers per-user isolated VMs, pre-action sentinel checks, least-privilege connectors, human approval gates, and single-use payment credentials.

testimonial-launch

Turn user testimonials into launch distribution. Use when launching a product or feature and you want real user proof to carry the announcement instead of marketing copy. Covers soliciting specific testimonials, curating them, and amplifying via quote-posts.

unisone/openclaw-skill-suite

Create Apple-keynote-quality product demo videos with Remotion. Covers glass phone mockups, floating 3D spheres, typing animations, card UIs, ripple effects, and smooth scene transitions. Use when asked to create product demos, app showcase videos, UI walkthrough animations, or

validator-quotes

Earn and deploy third-party validator quotes for a launch. Use when you need credibility beyond your own claims. Covers who to approach, how to get honest reactions, and how to amplify them via quote-posts, based on the founder/CEO validators behind the Muse launch.

相关技能