Skip to main content

Security audit tool for OpenClaw deployments

Project description

ClawShield

PyPI version Python versions CI PyPI downloads

ClawShield detects high-risk misconfigurations in OpenClaw agents before they become exposed attack surfaces.

It is the first release under the PolicyGate umbrella — a runtime policy enforcement framework for AI agents.

Why This Exists

AI agents are often deployed:

  • Publicly bound to 0.0.0.0
  • With authentication disabled
  • Inside privileged or root containers
  • With API keys sitting in .env files
  • Without file permission hardening

These are not theoretical risks — they are common misconfigurations.

ClawShield surfaces them deterministically and exits non-zero in CI when thresholds are exceeded.

What ClawShield Checks

Network Exposure

  • Public bind address (0.0.0.0, ::)
  • Authentication disabled while publicly exposed

Container Posture

  • Containers running as root
  • Containers running in privileged mode

Secrets Handling

  • API keys present in .env files
  • API key references inside config files

File Permissions

  • World-writable config files
  • World-readable or world-writable .env files

What ClawShield Does NOT Check

  • Runtime exploitability
  • Kernel vulnerabilities
  • Docker daemon hardening
  • Firewall configuration
  • Intrusion detection
  • Secrets entropy analysis
  • Cloud IAM posture

ClawShield is a static audit tool, not a runtime protection system.

Quick Start (Users)

pip install clawshield

Run audit:

clawshield path/to/openclaw.yaml

JSON mode:

clawshield --json path/to/openclaw.yaml

Fail CI on severity threshold:

clawshield --fail-on high path/to/openclaw.yaml

Severity ranking:

low < medium < high < critical

Exit Codes

Code Meaning
0 No findings at or above threshold
1 Findings at or above threshold

Example JSON Output

{
  "meta": {
    "schema_version": "0.1",
    "tool_version": "0.3.0",
    "policy_path": "clawshield/policies/vps_public.yaml"
  },
  "facts": [
    {
      "key": "network.bind_address",
      "value": "0.0.0.0",
      "source": "openclaw_config:openclaw.yaml"
    },
    {
      "key": "runtime.auth_enabled",
      "value": false,
      "source": "openclaw_config:openclaw.yaml"
    }
  ],
  "findings": [
    {
      "rule_id": "NET-001",
      "title": "Public bind address with authentication disabled",
      "severity": "critical",
      "confidence": "high",
      "evidence": [],
      "recommended_actions": ["ACT-ENABLE-AUTH"],
      "autofix_available": true
    }
  ]
}

JSON output is deterministic and schema-versioned. Golden tests lock the schema to prevent drift.

Architecture

ClawShield consists of:

  • Scanners — Collect facts from runtime and configuration
  • Policy Engine — Evaluates YAML rules against collected facts
  • Structured Output — Designed for automation and CI pipelines

Scanners are modular and isolated from the engine core.

Roadmap

  • Continuous monitoring mode
  • Additional runtime adapters
  • Expanded Docker hardening checks
  • Policy bundles
  • Advanced secrets detection
  • Signed policy packs

Status

Early release. Actively evolving.

Feedback and contributions welcome.

License

Apache 2.0

Security Disclaimer

ClawShield surfaces rule-based misconfigurations according to the active policy set. It does not guarantee system security.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clawshield-0.4.0.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clawshield-0.4.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file clawshield-0.4.0.tar.gz.

File metadata

  • Download URL: clawshield-0.4.0.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for clawshield-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fb7444ffa3088571aef7a740228dea38e88a0ff662196e287ed66fa904e088cd
MD5 413968dbbe11a2f7cabf8c092a1b656e
BLAKE2b-256 b1282623f8508a07488043ea4db98ca0db315fa09db0d84c308b66caddcc6926

See more details on using hashes here.

File details

Details for the file clawshield-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: clawshield-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for clawshield-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fcc2a7223340ba7c6536a651bcee9c624ff305a7cbe0ff86f2a01340662bf5e
MD5 89b96386d8742ede8e07d95a28a2a712
BLAKE2b-256 1f1297fec14e5960f91382205f05b2d37b5de4a343e0ce30dbcce4f47110ed70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page