OpenClaw Vault
Protects your credential lifecycle — not just finding secrets in source code (that's what Sentry does), but tracking how credentials are exposed through services, permissions, history, configs, containers, and time.
Why This Matters
Credentials don't just leak through source code. They leak through:
- - Permissions — .env files readable by every user on the system
- Shell history — passwords and tokens visible in INLINECODE0
- Git config — credentials embedded in remote URLs
- Config files — hardcoded secrets in JSON/YAML/TOML/INI configs
- Log files — tokens accidentally logged during debugging
- Docker configs — secrets baked into container images
- Staleness — credentials that haven't been rotated in months
This skill watches the full credential lifecycle. Sentry finds secrets in files. Vault finds secrets that are exposed.
Commands
Full Credential Audit
Comprehensive credential exposure audit: permission checks, shell history, git config, config file scanning, log file scanning, gitignore coverage, and staleness detection.
CODEBLOCK0
Exposure Check
Detect credential exposure vectors: misconfigured permissions, public directory exposure, git history risks, Docker credential embedding, shell alias leaks, and URL query parameter credentials in code.
CODEBLOCK1
Credential Inventory
Build a structured inventory of all credential files in the workspace. Categorizes by type (API key, database URI, token, certificate, SSH key, password), tracks age, and flags stale or exposed credentials.
CODEBLOCK2
Quick Status
One-line summary: credential count, exposure count, staleness warnings.
CODEBLOCK3
Workspace Auto-Detection
If --workspace is omitted, the script tries:
- 1.
OPENCLAW_WORKSPACE environment variable - Current directory (if AGENTS.md exists)
- INLINECODE3 (default)
What It Checks
| Category | Details |
|---|
| Permissions | .env files with world-readable or group-readable permissions |
| Shell History |
Credentials in .bash
history, .zshhistory, .python_history, etc. |
|
Git Config | Credentials embedded in git remote URLs, plaintext credential helpers |
|
Config Files | Hardcoded secrets in JSON, YAML, TOML, INI config files |
|
Log Files | Credentials accidentally logged in .log files |
|
Gitignore | Missing patterns for .env,
.pem, .key, credentials.json, etc. |
|
Staleness | Credential files older than 90 days that may need rotation |
|
Public Dirs | Credential files in public/, static/, www/, dist/, build/ |
|
Git History | Credential files in git repos that may be committed |
|
Docker | Secrets hardcoded in Dockerfile and docker-compose configs |
|
Shell RC | Credentials in .bashrc, .zshrc, .profile aliases |
|
URL Params | API keys/tokens passed in URL query strings in code |
Exit Codes
- -
0 — Clean, no issues - INLINECODE5 — Warnings detected (review needed)
- INLINECODE6 — Critical exposure detected (action needed)
No External Dependencies
Python standard library only. No pip install. No network calls. Everything runs locally.
Cross-Platform
Works with OpenClaw, Claude Code, Cursor, and any tool using the Agent Skills specification.
OpenClaw Vault
保护您的凭证生命周期——不仅仅是发现源代码中的秘密(那是Sentry的工作),而是追踪凭证如何通过服务、权限、历史记录、配置、容器和时间被暴露。
为何重要
凭证不仅仅通过源代码泄露。它们还会通过以下途径泄露:
- - 权限 — 系统上每个用户都可读的.env文件
- Shell历史 — 在.bash_history中可见的密码和令牌
- Git配置 — 嵌入在远程URL中的凭证
- 配置文件 — JSON/YAML/TOML/INI配置中硬编码的秘密
- 日志文件 — 调试期间意外记录的令牌
- Docker配置 — 烘焙到容器镜像中的秘密
- 过时凭证 — 数月未轮换的凭证
此技能监控完整的凭证生命周期。Sentry在文件中发现秘密。Vault发现被暴露的秘密。
命令
完整凭证审计
全面的凭证暴露审计:权限检查、shell历史、git配置、配置文件扫描、日志文件扫描、gitignore覆盖和过时检测。
bash
python3 {baseDir}/scripts/vault.py audit --workspace /path/to/workspace
暴露检查
检测凭证暴露向量:配置错误的权限、公共目录暴露、git历史风险、Docker凭证嵌入、shell别名泄露以及代码中URL查询参数的凭证。
bash
python3 {baseDir}/scripts/vault.py exposure --workspace /path/to/workspace
凭证清单
构建工作区中所有凭证文件的结构化清单。按类型分类(API密钥、数据库URI、令牌、证书、SSH密钥、密码),追踪时效,并标记过时或暴露的凭证。
bash
python3 {baseDir}/scripts/vault.py inventory --workspace /path/to/workspace
快速状态
单行摘要:凭证数量、暴露数量、过时警告。
bash
python3 {baseDir}/scripts/vault.py status --workspace /path/to/workspace
工作区自动检测
如果省略--workspace,脚本会尝试:
- 1. OPENCLAW_WORKSPACE环境变量
- 当前目录(如果存在AGENTS.md)
- ~/.openclaw/workspace(默认)
检查内容
| 类别 | 详情 |
|---|
| 权限 | 具有全局可读或组可读权限的.env文件 |
| Shell历史 |
.bash
history、.zshhistory、.python_history等中的凭证 |
|
Git配置 | 嵌入在git远程URL中的凭证、明文凭证助手 |
|
配置文件 | JSON、YAML、TOML、INI配置文件中硬编码的秘密 |
|
日志文件 | 意外记录在.log文件中的凭证 |
|
Gitignore | 缺少.env、
.pem、.key、credentials.json等的模式 |
|
过时凭证 | 超过90天可能需要轮换的凭证文件 |
|
公共目录 | public/、static/、www/、dist/、build/中的凭证文件 |
|
Git历史 | git仓库中可能已提交的凭证文件 |
|
Docker | Dockerfile和docker-compose配置中硬编码的秘密 |
|
Shell RC | .bashrc、.zshrc、.profile别名中的凭证 |
|
URL参数 | 代码中URL查询字符串中传递的API密钥/令牌 |
退出代码
- - 0 — 干净,无问题
- 1 — 检测到警告(需要审查)
- 2 — 检测到严重暴露(需要处理)
无外部依赖
仅使用Python标准库。无需pip安装。无需网络调用。一切在本地运行。
跨平台
与OpenClaw、Claude Code、Cursor以及任何使用Agent Skills规范的工具兼容。