Community程式設計與開發github.com

openclaw-secret-scanning-maintainer

分類、隱藏、清理並解決 OpenClaw GitHub Secret Scanning 在 Issues 或 PR 中的警報。

openclaw-secret-scanning-maintainer 是什麼?

OpenClaw Secret Scanning Maintainer 技能專為擁有儲存庫管理員或維護者權限的用戶設計,用於處理來自 OpenClaw 專案 secret scanning 頁面的警報。此技能支援對單一或多個警報進行自動化處理,包括識別警報內容、決定是否需要編輯、執行內容隱藏(針對 issue/PR 主體)或刪除並重建(針對評論)、發送通知,以及最終解決警報。其核心運作透過一個獨立指令碼進行所有 API 呼叫與檔案管理,嚴格避免在 stdout 中洩漏明文機密。對於無法清除編輯歷史的 issue/PR 主體,技能會提示聯絡 GitHub 支援,並確保所有公開通知皆以英文撰寫,且絕不提及機密內容或編輯歷史。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/.agents/skills/openclaw-secret-scanning-maintainer

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

OpenClaw Secret Scanning Maintainer

僅限維護者。 此技能需要儲存庫管理員/維護者權限才能編輯或刪除其他使用者的留言,並解決 Secret Scanning 警報。

請在處理來自 https://github.com/openclaw/openclaw/security/secret-scanning 的警報時使用此技能。

語言規則: 所有通知留言與替換留言都必須以英文撰寫。

指令碼

所有機械化作業(API 呼叫、暫存檔案管理、安全性強制)均由以下指令碼處理:

$REPO_ROOT/.agents/skills/openclaw-secret-scanning-maintainer/scripts/secret-scanning.mjs

指令碼強制執行:

  • 所有警報擷取皆設定 hide_secret=true(stdout 中不包含明文機密)
  • 所有暫存檔案使用隨機 UUID 搭配 mktemp
  • 所有主體上傳使用 -F body=@file(避免行內 shell 引號問題)
  • 根據位置類型分支的通知模板
  • 永不將 .secret 或 .body 輸出到 stdout

整體流程

支援單一或多個警報。對於多個警報,請依升序處理。

針對每個警報:

  1. 識別 — 使用 fetch-alert + fetch-content 取得中繼資料與主體
  2. 決定 — 代理程式讀取主體檔案,識別是否仍有明文機密,並在必要時產生隱藏版本
  3. 隱藏 — 對 issue/PR 主體使用 redact-body-if-needed;對留言則跳過(直接刪除)
  4. 清除 — 對留言使用 delete-comment + recreate-comment;無法清除主體編輯歷史
  5. 通知 — 除非目前的 issue/PR 主體已被隱藏,否則 notify 會根據位置類型張貼對應模板
  6. 解決 — resolve 關閉警報
  7. 摘要 — summary 列印格式化結果

步驟 1:識別

# 列出所有開啟的警報
node secret-scanning.mjs list-open

# 擷取特定警報的中繼資料與位置資訊
node secret-scanning.mjs fetch-alert <NUMBER>

# 擷取每個位置的內容(將主體儲存至暫存檔案)
node secret-scanning.mjs fetch-content '<location-json>'

fetch-content 的輸出包含:

  • body_file:包含完整主體內容的暫存檔案路徑
  • author:張貼者
  • issue_number / pr_number:所在位置
  • edit_history_count:現有編輯次數
  • type:用於路由的位置類型
  • 對於 discussion_comment,還包含 comment_node_id、discussion_node_id,以及當原始留言為回覆時的 reply_to_node_id

位置類型路由

type流程
issue_comment留言:刪除+重建
pull_request_comment留言:刪除+重建
pull_request_review_comment留言:刪除+重建
discussion_comment討論留言:刪除+重建(GraphQL)
issue_body主體:就地隱藏
pull_request_body主體:就地隱藏
commit僅通知
other跳過並回報

步驟 2:決定(代理程式)

代理程式讀取來自 fetch-content 輸出的主體檔案,並:

  1. 識別內容中的所有機密(可能多於警報標記的數量)
  2. 判斷目前主體中是否仍有明文憑證
  3. 將每個剩餘的機密替換為 [REDACTED <secret_type>] — 不保留部分值,無前綴/後綴
  4. 將隱藏後的內容儲存到新的暫存檔案

這是唯一需要語義理解的步驟。其餘皆為機械化作業。

對於 issue_body 和 pull_request_body:若目前主體已由作者自行隱藏且無明文憑證殘留,則不要張貼公開通知留言。這可避免建立新的公開指標指向歷史敏感內容。請單獨記錄該隱藏動作,並使用步驟 6 判斷證據是否足以解決警報。

步驟 3:隱藏

對於留言(issue_comment / PR comments)

不要隱藏。 直接跳到步驟 4(刪除+重建)。在 DELETE 之前進行 PATCH 會建立不必要的編輯歷史修訂。

對於 issue_body / pull_request_body

node secret-scanning.mjs redact-body-if-needed <issue|pr> <NUMBER> <current-body-file> <redacted-body-file> <result-file>

使用來自 fetch-content 的 body_file 作為 <current-body-file>。指令會將 notify_required 寫入 <result-file>,並且僅在隱藏後的檔案與目前主體不同時才 PATCH 主體。

步驟 4:清除編輯歷史

留言 — 刪除並重建

對於 issue/PR 留言:

# 刪除原始留言(所有編輯歷史消失)
node secret-scanning.mjs delete-comment <COMMENT_ID>

# 使用隱藏內容重建留言
node secret-scanning.mjs recreate-comment <ISSUE_NUMBER> <body-file>

對於討論留言(使用 GraphQL):

# 刪除原始留言
node secret-scanning.mjs delete-discussion-comment <COMMENT_NODE_ID>

# 使用隱藏內容重建留言
node secret-scanning.mjs recreate-discussion-comment <DISCUSSION_NODE_ID> <body-file> [REPLY_TO_NODE_ID]

fetch-content 針對 discussion_comment 的輸出包含上述指令所需的 comment_node_id 和 discussion_node_id。若原始討論留言為回覆,則還包含 reply_to_node_id;請傳遞該可選的第三個參數,使隱藏後的替換留言保留在原始討論串中。

重建的留言應遵循以下格式:

> **注意:** @<AUTHOR> 的原始留言因機密外洩已被移除。以下為原始內容的隱藏版本。

---

<隱藏後的原始內容>

issue_body / pull_request_body — 無法清除編輯歷史

編輯操作會建立包含編輯前明文內容的修訂版本。此修訂無法透過 API 清除。

請勿公開建議作者刪除/重建 issue 或關閉/重新開啟 PR。這可能會引起對歷史內容的注意。請將清除指引僅限於維護者。

僅輸出到維護者終端機(絕不在公開留言中):

⚠️ Issue/PR 主體編輯歷史仍包含明文機密。
請聯絡 GitHub 支援以清除:https://support.github.com/contact
要求清除 issue/PR #{NUMBER} 的 userContentEdits。

重要: 請勿在任何公開留言或解決警報的留言中提及編輯歷史或「已編輯」按鈕。

提交

無法清理。請通知作者刪除分支或強制推送(適用於尚未合併的 PR)。

步驟 5:通知

node secret-scanning.mjs notify <TARGET> <AUTHOR> <LOCATION_TYPE> <SECRET_TYPES> [REPLY_TO_NODE_ID|BODY_REDACTION_RESULT_FILE]
  • 對於非討論類型,<TARGET> 為 issue/PR 編號。
  • 對於 discussion_comment,<TARGET> 為 fetch-content 回傳的 discussion_node_id。
  • 對於回覆類型的 discussion_comment 位置,請傳遞 fetch-content 中的可選參數 reply_to_node_id,使通知停留在相同的討論串中。
  • 對於 issue_body 和 pull_request_body,請傳遞 redact-body-if-needed 的 <result-file>。當 notify_required 為 false 時,指令會跳過通知;若缺少此檔案,則拒絕進行主體通知。

機密類型以逗號分隔:"Discord Bot Token,Feishu App Secret"

指令會選取正確的模板:

  • 留言類型:「您的留言……已被移除並替換」
  • 主體類型:「您的 issue/PR 描述……已被就地隱藏」
  • 提交:「您提交的代碼」

對於 issue_body 和 pull_request_body,僅在目前主體仍包含明文且由維護者隱藏時才進行通知。若使用者已自行隱藏目前主體,請跳過通知並繼續執行步驟 6。

步驟 6:解決

node secret-scanning.mjs resolve <ALERT_NUMBER> <RESOLUTION> [COMMENT]

根據證據與維護者權限選擇明確的解決方式:

  • revoked:憑證所有者或發行者已確認撤銷。
  • false_positive:已確認偵測為誤報。
  • used_in_tests:已確認該憑證用於測試。
  • wont_fix:授權的維護者已接受風險並決定不修復;請在留言中記錄該決定。

隱藏動作與要求輪換憑證並不代表撤銷。若無確鑿的解決方式,請保持警報開啟,並單獨回報隱藏與通知的結果。此指令沒有預設的解決方式,且僅在提供留言時才會新增解決方式的留言。

步驟 7:摘要

處理完成後,建立一個 JSON 結果檔案並傳遞給摘要指令:

node secret-scanning.mjs summary /tmp/results.json

指令會輸出以 ---BEGIN SUMMARY--- 與 ---END SUMMARY--- 分隔的區塊。您必須逐字輸出這兩個標記之間的內容給使用者。請勿重新措辭、重新格式化、縮寫或自行建立摘要。 指令已包含每個警報與位置的完整 URL。

JSON 格式:

[
  {
    "number": 72,
    "secret_type": "Discord Bot Token",
    "location_label": "Issue #63101 comment",
    "location_url": "https://github.com/openclaw/openclaw/issues/63101#issuecomment-xxx",
    "actions": "Deleted+Recreated+Notified",
    "history_cleared": true
  }
]

對於不支援的類型,請加入 "skipped": true, "unsupported_type": "<type>"。

安全規則

  • 代理程式讀取內容、識別機密、產生隱藏版本。 指令碼處理所有 API 呼叫。
  • 切勿將機密的任何部分包含在公開留言、隱藏標記或終端機輸出中。
  • 切勿將警報 URL 或編號包含在公開留言中。
  • 對於留言,跳過 PATCH — 直接進行 DELETE + 重建。
  • 切勿在任何公開內容中提及編輯歷史、「已編輯」按鈕或提交 SHA。
  • 在刪除任何留言前,要求確認。
  • 一次處理一個警報,除非使用者要求批次處理。
  • 所有公開留言使用英文。
  • 跳過不支援的位置類型並在摘要中回報。

Individual skills in this repo

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

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

相關技能