← 返回
未分类 中文

OpenClaw Security Audit

Security audit and credential hardening tool for OpenClaw instances. Scan for sensitive files, detect credential exposure, check gateway configuration, and m...
**OpenClaw 实例安全审计与凭证加固工具。** 扫描敏感文件、检测凭证泄露、检查网关配置等。
vincent-big-fish
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 506
下载
💾 2
安装
1
版本
#audit#credentials#hardening#latest#privacy#safety#security

概述

OpenClaw Security Audit

A comprehensive security toolkit for OpenClaw instances. Protect your credentials, audit your configuration, and maintain best security practices.

Features

  • Sensitive File Scanning - Detect .env, .key, .pem files and other sensitive artifacts
  • Credential Exposure Detection - Find API keys, secrets, tokens, and passwords in config files
  • Gateway Security Check - Verify gateway bind mode and authentication settings
  • Credential Hardening - Automatically migrate credentials from config files to environment variables
  • JSON Reports - Generate detailed audit reports for review

Installation

# Clone to your OpenClaw skills directory
cd ~/.openclaw/skills
git clone <repository> openclaw-security-audit

# Or manually copy the skill files

Usage

Security Audit

Run a comprehensive security audit:

python ~/.openclaw/skills/openclaw-security-audit/audit.py

This will:

  1. Scan for sensitive files
  2. Check for credential exposure in openclaw.json
  3. Verify gateway security configuration
  4. Generate a JSON report with findings

Credential Hardening

Migrate credentials to environment variables:

python ~/.openclaw/skills/openclaw-security-audit/harden.py

This will:

  1. Backup your current configuration
  2. Extract credentials from openclaw.json
  3. Create .env file with credentials
  4. Sanitize openclaw.json (replace with placeholders)
  5. Generate setup scripts for Windows/macOS/Linux

IMPORTANT: After running harden.py, you must set environment variables before OpenClaw can access credentials.

Custom Configuration

Edit config.json to customize scanning behavior:

{
  "exclude_dirs": ["node_modules", ".git", "__pycache__"],
  "whitelist": ["secret-input.ts"],
  "sensitive_extensions": [".env", ".key", ".pem"],
  "sensitive_keywords": ["password", "secret", "credentials"]
}

Security Checks

What We Check

CheckDescriptionRisk Level
--------------------------------
Sensitive files.env, .key, .pem filesMEDIUM
Credential exposureAPI keys, secrets in configHIGH/CRITICAL
Gateway bind mode0.0.0.0 exposureCRITICAL
Gateway authMissing authenticationHIGH
File permissionsConfig file permissionsINFO

Risk Levels

  • CRITICAL: Immediate action required
  • HIGH: Fix within 24 hours
  • MEDIUM: Fix within a week
  • LOW: Monitor and review
  • INFO: For awareness

Best Practices

  1. Run audit weekly - Schedule regular security checks
  2. Harden immediately - Migrate credentials to env vars on first run
  3. Backup before hardening - Always backup configs before changes
  4. Secure .env files - Never commit .env to version control
  5. Rotate credentials - Regularly update API keys and tokens

Report Location

Audit reports are saved to:

  • ~/.openclaw/security-tools/security_report_YYYYMMDD_HHMMSS.json

Supported Platforms

  • Windows (PowerShell scripts)
  • macOS (Bash scripts)
  • Linux (Bash scripts)

Privacy & Safety

This tool:

  • ✅ Only reads your OpenClaw configuration
  • ✅ Does not transmit data externally
  • ✅ Masks credential values in reports
  • ✅ Creates backups before modifications
  • ✅ Respects file permissions

This tool does NOT:

  • ❌ Send data to external servers
  • ❌ Modify system files outside ~/.openclaw
  • ❌ Store or log actual credential values
  • ❌ Require elevated permissions

Requirements

  • Python 3.7+
  • OpenClaw installed
  • Read access to ~/.openclaw directory

License

MIT License - Feel free to use, modify, and distribute.

Contributing

Contributions welcome! Please ensure:

  • Code follows Python PEP 8
  • No hardcoded credentials or paths
  • Privacy-respecting practices
  • Clear documentation

Disclaimer

This tool is for security auditing your own OpenClaw instance. Always review changes before applying them. The authors are not responsible for misconfiguration or data loss.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 00:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,062 📥 801,091
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,157
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,219 📥 266,945