返回顶部
🇺🇸 English
🇨🇳 简体中文
🇨🇳 繁體中文
🇺🇸 English
🇯🇵 日本語
🇰🇷 한국어
🇫🇷 Français
🇩🇪 Deutsch
🇪🇸 Español
🇷🇺 Русский
a

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
安全检测
已通过
117
下载量
0
收藏
概述
安装方式
版本历史

api-key-auditor

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

下载 Zip 包

⬇ 下载 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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部