Summary
GitHub 開源專案安全掃描工具。當使用者貼上 GitHub URL、詢問某個套件或專案是否安全可信、想在安裝前評估風險,或提到「幫我看一下這個 repo」、「這個專案安不安全」、「我想用這個開源套件」、「這個工具可以信任嗎」時,務必使用此 skill。輸出專案概覽、靜態弱點分析、供應鏈風險、Issues…
ycs77/skills
GitHub 開源專案安?
npx skills add ycs77/skills --skill scan-repo
GitHub 開源專案安全掃描工具。當使用者貼上 GitHub URL、詢問某個套件或專案是否安全可信、想在安裝前評估風險,或提到「幫我看一下這個 repo」、「這個專案安不安全」、「我想用這個開源套件」、「這個工具可以信任嗎」時,務必使用此 skill。輸出專案概覽、靜態弱點分析、供應鏈風險、Issues…
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Guide for configuring and managing GitHub secret scanning, push protection, custom patterns, an…
4.4K installsScan agent skills for security issues. Use when asked to "scan a skill", "audit a skill", "revi…
2.9K installsGuides Holoscan SDK installation: inspects the host, assesses platform compatibility, recommend…
1.8K installsInstall Holoscan SDK via the NGC Docker container. Use for container-based installs; not for na…
1.8K installsInstall Holoscan SDK Python wheel via pip into a venv. Use for Python installs; not for native …
1.7K installsInstall Holoscan SDK v4.3+ via Conda in a CUDA 13 environment. Use for Conda installs; redirect…
1.7K installsOther skills from ycs77/skills · top by installs.
npx skills add ycs77/skills
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Parsed from SKILL.md frontmatter.
Bash(git log *) Bash(git ls-files *) Bash(gh repo view *) Bash(gh issue list *) Bash(gh issue view *) Bash(ls *)Files included with this skill beyond the listing page.
SKILL.md
10,103 B
SUMMARY.md
458 B
/scan-repo https://github.com/owner/repo
參數:
?fbclid= 等追蹤參數)?fbclid=、?ref= 等追蹤參數,保留 https://github.com/owner/repo 格式。掃描前依序確認:
# 1. git 是否可用
git --version
# 2. gh 是否可用且已登入
gh auth status
git 不可用 → 停止,提示安裝gh 不可用或未登入 → 警告,跳過 Phase 5(Issues 掃描),其餘照跑依作業系統決定 clone 路徑:
/tmp/scan-repo-{repo_name}$env:TEMP\scan-repo-{reponame}(PowerShell)或 %TEMP%\scan-repo-{reponame}(CMD)# Linux/macOS
git clone --depth 50 {repo_url} /tmp/scan-repo-{repo_name}
# Windows (PowerShell)
git clone --depth 50 {repo_url} "$env:TEMP\scan-repo-{repo_name}"
注意:
--depth 50適合大多數情況。若 Phase 6 需要評估更長期的 commit 活動,可改為--depth 200。若 repo 歷史特別短,shallow clone 不影響結果。
分析並整理:
| 項目 | 內容 |
|---|---|
| 專案名稱 | |
| 用途說明 | 一句話描述這個專案做什麼 |
| 主要語言 | |
| 關鍵檔案 | 列出核心檔案及其功能 |
| 執行方式 | 如何安裝/使用(從 README 或程式碼判斷) |
| Stars / Forks | |
| License | |
| 最後 commit | 日期 + 內容摘要 |
重點:用最少的字讓人搞懂這個 repo 在幹嘛。
掃描以下檔案(存在才掃):
package.json / package-lock.json(Node.js)requirements.txt / setup.py / pyproject.toml(Python)go.mod(Go)Cargo.toml(Rust)Gemfile(Ruby)pom.xml / build.gradle(Java)composer.json(PHP)檢查項目:
event-stream、ua-parser-js 等曾被投毒的套件)postinstall、preinstall hook(package.json scripts)sharp、node-gyp 等,增加攻擊面)優先掃描以下目錄(按風險高低排序):src/、lib/、bin/、scripts/、根目錄的 .js/.py/.sh/.ts 檔案。
排除以下目錄與檔案(不掃描):node_modules/、.git/、dist/、build/、vendor/、pycache/,以及大於 1MB 的單一檔案。
對每個符合條件的原始碼檔案,檢查以下類別:
exec()、execSync()、spawn() 使用未過濾的外部輸入os.system()、subprocess.call() 拼接字串 backtick 或 $()` 內含變數eval() 動態執行path.resolve 或 sanitize)../ 未被過濾.env 檔案被追蹤到 gitpickle.load()、yaml.load()(無 Loader=SafeLoader)JSON.parse() 後直接信任內容ObjectInputStreaminnerHTML、dangerouslySetInnerHTMLMath.random() 用於安全用途rejectUnauthorized: false、verify=False)*/tmp/ 使用可預測的固定路徑(symlink attack)0777、0666)重點審查以下檔案(如果存在):
install.sh / setup.sh / bootstrap.shMakefile 的 install targetDockerfile / docker-compose.yml.github/workflows/)package.json 的 scripts 欄位(postinstall、preinstall、prepare)檢查項目:
curl | bash 或 wget | sh 模式/etc/、crontab、PATH).github/workflows/)uses: actions/checkout@main 而非固定版本如 @v4)—— 可被供應鏈攻擊替換pullrequesttarget 搭配 checkout 或執行任意程式碼(高風險:外部 PR 可觸發)echo $SECRET、run: env)uses: org/action@{full-sha})需要
ghCLI。無法使用時跳過此階段並註明。
# 用關鍵字篩選安全相關 issues(含 open + closed)
gh issue list -R {owner}/{repo} --state all --limit 200 --search "vulnerability OR security OR CVE OR injection OR XSS OR RCE OR exploit OR malicious OR unsafe OR leak OR bypass OR SSRF OR traversal"
對每個命中的 issue:
gh issue view {issue_number} -R {owner}/{repo}
分析:
整理成表格:
| Issue # | 標題 | 狀態 | 嚴重程度 | 回應時間 |
|---|
# Repo 基本資訊
gh repo view {owner}/{repo} --json stargazerCount,forkCount,createdAt,updatedAt,licenseInfo,description
# 最近 commit 活動
git log --oneline -20
# Contributors
gh api repos/{owner}/{repo}/contributors --jq '.[].login' | head -10
評估項目:
.github/workflows/)test/、tests/、tests/、*_test.go)掃描完成後,輸出以下格式的報告:
## 🔍 Repo Scan 報告:{repo_name}
### 📦 專案概覽
(Phase 1 的表格)
### 📋 依賴分析
(Phase 2 的發現,列出可疑依賴)
### 🛡️ 靜態弱點
(Phase 3 的發現,依嚴重程度排序)
每個弱點格式:
#### 弱點 N:{類別} — `{file}:{line}`
- **嚴重程度**:🔴 High / 🟡 Medium / 🟢 Low
- **說明**:具體描述問題
- **利用場景**:攻擊者如何利用
- **建議**:如何修復
### ⛓️ 供應鏈風險
(Phase 4 的發現)
### 🐛 Issues 安全回報
(Phase 5 的表格 + 分析)
(如跳過,註明「gh CLI 不可用,已跳過」)
### 🏥 專案健康度
(Phase 6 的評估)
---
### 📊 風險總結
| 維度 | 風險等級 | 說明 |
|------|---------|------|
| 程式碼安全 | 🔴 High / 🟡 Medium / 🟢 Low / ✅ None | |
| 依賴風險 | 🔴 High / 🟡 Medium / 🟢 Low / ✅ None | |
| 供應鏈風險 | 🔴 High / 🟡 Medium / 🟢 Low / ✅ None | |
| 已知漏洞 | 🔴 High / 🟡 Medium / 🟢 Low / ✅ None | |
| 維護狀態 | 🔴 High / 🟡 Medium / 🟢 Low / ✅ None | |
| **整體風險** | **綜合以上五個維度的最高風險等級** | |
### 🏁 結論
是否建議安裝/使用?(明確回答)
- 已知風險摘要(最多 3 點)
- 使用時的注意事項(如果建議使用)
/tmp/scan-repo-{reponame},Windows: %TEMP%\scan-repo-{reponame}),無論掃描是否成功都要清理