闲社服务运行正常AI智能体自动化平台
a

API密钥审计

技能标识:api-key-auditor

扫描 ~/.openclaw/workspace/skills 目录下所有文件中的硬编码 API Key、Token、Secret,检查是否已集成到 openclaw.json env.vars,并可自动将未集成的凭证迁移进去。Use when user asks to audit/check/scan for hardcoded API keys or tokens in skills, or wants to migrate credentials to openclaw.json. Triggers on phrases like "检查API Key暴露", "审计凭证", "扫描硬编码密钥", "api key 集成", "check for hardcoded keys".

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

API密钥审计

API Key 审计器

扫描 skills 目录下的硬编码凭证,并输出集成情况报告。

运行方式

bash

仅审计(只读,不修改任何文件)


python3 ~/.openclaw/workspace/skills/api-key-auditor/scripts/audit.py

自动迁移:将未集成的 key 写入 openclaw.json

python3 ~/.openclaw/workspace/skills/api-key-auditor/scripts/audit.py --fix

参数说明

参数默认值说明
--skills-dir~/.openclaw/workspace/skills扫描目录
--openclaw-json
~/.openclaw/openclaw.json | 目标配置文件 | | --fix | 否 | 自动写入未集成的 key 到 env.vars |

报告输出含义

状态标记含义
✅ 已集成到 openclaw.json凭证已注册为环境变量,安全
🔧 mcporter 管理(无需迁移)
该 key 在 ~/.mcporter/mcporter.json 中,由 mcporter 统一管理 MCP server 连接,不需要抽取 | | ⚠️ 未集成 | 凭证硬编码在文件中,建议迁移 |

迁移工作流

  1. 1. 运行审计,查看 ⚠️ 未集成项
  2. 运行 --fix,脚本自动将 key 写入 openclaw.json env.vars,并给出需要手动替换的文件位置
  3. 在对应文件中将硬编码值替换为环境变量引用:
- Python:os.environ.get(VAR_NAME) - Shell:$VARNAME 或 ${VARNAME}
  1. 4. 重启 OpenClaw 使环境变量生效(openclaw gateway restart)
  2. 再次运行审计确认 ✅

设计说明

  • - mcporter key 不抽取:~/.mcporter/mcporter.json 里的 MCP server URL 中的 ?key= 参数,已由 mcporter 统一管理,不属于需要抽取的硬编码凭证
  • 占位符自动过滤:your-api-key-here、REPLACE_ME 等示例值不会误报
  • 只读模式安全:不加 --fix 时,脚本不修改任何文件

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 api-key-auditor-1776112861 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 api-key-auditor-1776112861 技能

通过命令行安装

skillhub install api-key-auditor-1776112861

下载

⬇ 下载 api-key-auditor v1.0.0(免费)

文件大小: 5.86 KB | 发布时间: 2026-4-17 14:05

v1.0.0 最新 2026-4-17 14:05
Initial release — scans and audits hardcoded API keys and credentials in the skills directory, with optional migration to central config.

- Scans all files in ~/.openclaw/workspace/skills for hardcoded API keys, tokens, and secrets.
- Reports integration status: integrated in openclaw.json, managed by mcporter, or not yet integrated.
- Supports read-only audit and --fix mode for automatic migration of unregistered credentials to openclaw.json env.vars.
- Skips sample values and mcporter-managed keys to avoid false positives.
- Clear instructions provided for manual replacement and integration workflow.
返回顶部