@denial-web/clawguard 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.clawguard.example.json +16 -0
- package/LICENSE +21 -0
- package/README.md +241 -0
- package/SECURITY.md +33 -0
- package/action.yml +72 -0
- package/docs/ARCHITECTURE.md +312 -0
- package/docs/ARCHITECTURE_ROADMAP.md +267 -0
- package/docs/CLAWHUB_METADATA.md +57 -0
- package/docs/DEMO_CAPTURE.md +25 -0
- package/docs/DEMO_SCRIPT.md +87 -0
- package/docs/DEPENDENCY_SCANNING.md +61 -0
- package/docs/GITHUB_ACTION.md +56 -0
- package/docs/GITHUB_REPO_SETUP.md +76 -0
- package/docs/HTML_REPORTS.md +27 -0
- package/docs/INTEGRATION_SPEC.md +253 -0
- package/docs/LAUNCH_CHECKLIST.md +64 -0
- package/docs/LAUNCH_PLAN.md +40 -0
- package/docs/LOCAL_PROJECT_ASSETS.md +250 -0
- package/docs/MCP_PLUGIN_SCANNING.md +53 -0
- package/docs/NEXT_SESSION.md +110 -0
- package/docs/NPM_PUBLISHING.md +66 -0
- package/docs/OPENCLAW_CLAWHUB_RESEARCH.md +128 -0
- package/docs/POLICY_MODEL.md +198 -0
- package/docs/PROJECT_REVIEW.md +108 -0
- package/docs/REAL_WORLD_VALIDATION.md +57 -0
- package/docs/RELEASE_NOTES_v0.1.0.md +52 -0
- package/docs/REPORT_SCHEMA.md +81 -0
- package/docs/RULES.md +92 -0
- package/docs/THREAT_MODEL.md +50 -0
- package/docs/WEB_DEMO.md +39 -0
- package/docs/WORKSPACE_SCANNING.md +41 -0
- package/examples/clawhub-origin-without-lock/skills/orphan-helper/.clawhub/origin.json +6 -0
- package/examples/clawhub-origin-without-lock/skills/orphan-helper/SKILL.md +11 -0
- package/examples/clawhub-workspace/.clawhub/lock.json +22 -0
- package/examples/clawhub-workspace/skills/drift-helper/.clawhub/origin.json +6 -0
- package/examples/clawhub-workspace/skills/drift-helper/SKILL.md +11 -0
- package/examples/clawhub-workspace/skills/missing-origin/SKILL.md +11 -0
- package/examples/clawhub-workspace/skills/weather-helper/.clawhub/origin.json +6 -0
- package/examples/clawhub-workspace/skills/weather-helper/SKILL.md +15 -0
- package/examples/declared-api-skill/SKILL.md +27 -0
- package/examples/dependency-python-skill/SKILL.md +16 -0
- package/examples/dependency-python-skill/pyproject.toml +5 -0
- package/examples/dependency-python-skill/requirements.txt +3 -0
- package/examples/dependency-risky-skill/SKILL.md +16 -0
- package/examples/dependency-risky-skill/package.json +12 -0
- package/examples/dependency-safe-skill/SKILL.md +16 -0
- package/examples/dependency-safe-skill/package-lock.json +19 -0
- package/examples/dependency-safe-skill/package.json +7 -0
- package/examples/metadata-mismatch-skill/SKILL.md +22 -0
- package/examples/openclaw-plugin-config/.openclaw/plugins.json +18 -0
- package/examples/openclaw-workspace/.agents/skills/research-helper/SKILL.md +11 -0
- package/examples/openclaw-workspace/skills/notes/SKILL.md +3 -0
- package/examples/openclaw-workspace/skills/research-helper/SKILL.md +17 -0
- package/examples/risky-mcp-config/.cursor/mcp.json +29 -0
- package/examples/risky-openclaw-plugin/openclaw.plugin.json +6 -0
- package/examples/risky-openclaw-plugin/package.json +7 -0
- package/examples/risky-openclaw-plugin/src/index.ts +1 -0
- package/examples/risky-skill/SKILL.md +17 -0
- package/examples/safe-mcp-config/.cursor/mcp.json +15 -0
- package/examples/safe-openclaw-plugin/dist/index.js +1 -0
- package/examples/safe-openclaw-plugin/openclaw.plugin.json +5 -0
- package/examples/safe-openclaw-plugin/package.json +14 -0
- package/examples/safe-skill/SKILL.md +12 -0
- package/package.json +49 -0
- package/schemas/clawguard-report.schema.json +266 -0
- package/scripts/capture-demo.js +206 -0
- package/src/clawhub.js +383 -0
- package/src/cli.js +296 -0
- package/src/config.js +205 -0
- package/src/dependencies.js +417 -0
- package/src/mcp-config.js +592 -0
- package/src/policy.js +165 -0
- package/src/reporters/html.js +482 -0
- package/src/reporters/sarif.js +121 -0
- package/src/rule-catalog.js +400 -0
- package/src/rules.js +121 -0
- package/src/scanner.js +387 -0
- package/src/skill-metadata.js +516 -0
- package/src/web-server.js +395 -0
- package/src/workspace.js +233 -0
- package/web/app.js +374 -0
- package/web/index.html +119 -0
- package/web/styles.css +453 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Architecture Roadmap
|
|
2
|
+
|
|
3
|
+
This roadmap turns the current ClawGuard starter into a complete, strong, secure companion project.
|
|
4
|
+
|
|
5
|
+
## Phase 0: Current Foundation
|
|
6
|
+
|
|
7
|
+
Status: started
|
|
8
|
+
|
|
9
|
+
Already present:
|
|
10
|
+
|
|
11
|
+
- Static CLI scanner.
|
|
12
|
+
- Explainable findings.
|
|
13
|
+
- JSON output.
|
|
14
|
+
- CI fail threshold.
|
|
15
|
+
- File-size limit.
|
|
16
|
+
- Symlink skipping.
|
|
17
|
+
- Safe and risky example skills.
|
|
18
|
+
- Unit tests.
|
|
19
|
+
- Threat model.
|
|
20
|
+
- Security reporting policy.
|
|
21
|
+
|
|
22
|
+
Finish before public announcement:
|
|
23
|
+
|
|
24
|
+
- Add at least 20 fixtures.
|
|
25
|
+
- Add at least 20 tests.
|
|
26
|
+
- Add rule documentation.
|
|
27
|
+
- Add config file support.
|
|
28
|
+
- Add stable report schema.
|
|
29
|
+
|
|
30
|
+
## Phase 1: OpenClaw Skill Intelligence
|
|
31
|
+
|
|
32
|
+
Goal: make ClawGuard understand real OpenClaw-style skill structure.
|
|
33
|
+
|
|
34
|
+
Build:
|
|
35
|
+
|
|
36
|
+
- `SKILL.md` and `skill.md` detection.
|
|
37
|
+
- YAML frontmatter parser.
|
|
38
|
+
- `metadata.openclaw` normalizer.
|
|
39
|
+
- Required field checks.
|
|
40
|
+
- Runtime requirement extraction.
|
|
41
|
+
- Declared versus observed mismatch rules.
|
|
42
|
+
|
|
43
|
+
Rules:
|
|
44
|
+
|
|
45
|
+
- Env var used but not declared.
|
|
46
|
+
- Binary used but not declared.
|
|
47
|
+
- Config path read but not declared.
|
|
48
|
+
- Install requirement mentioned but not declared.
|
|
49
|
+
- Broad permission language without clear purpose.
|
|
50
|
+
- Skill name/version/description missing.
|
|
51
|
+
|
|
52
|
+
Success demo:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
clawguard scan examples/risky-skill
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Report should say not only "risky pattern found", but also "the skill did not declare this requirement".
|
|
59
|
+
|
|
60
|
+
## Phase 2: Workspace and Precedence
|
|
61
|
+
|
|
62
|
+
Goal: scan what OpenClaw will actually load.
|
|
63
|
+
|
|
64
|
+
Status: started
|
|
65
|
+
|
|
66
|
+
Build:
|
|
67
|
+
|
|
68
|
+
- `scan-workspace` command.
|
|
69
|
+
- Workspace `skills/` scanner.
|
|
70
|
+
- Project `.agents/skills` scanner.
|
|
71
|
+
- Duplicate skill-name detection.
|
|
72
|
+
- Effective skill precedence report.
|
|
73
|
+
- Optional managed/global scan when explicitly passed.
|
|
74
|
+
|
|
75
|
+
Already present:
|
|
76
|
+
|
|
77
|
+
- `scan-workspace` alias.
|
|
78
|
+
- Workspace `skills/` discovery.
|
|
79
|
+
- Project `.agents/skills` discovery.
|
|
80
|
+
- Duplicate skill-name findings.
|
|
81
|
+
- Higher-precedence override findings.
|
|
82
|
+
- Riskier winning-skill override findings.
|
|
83
|
+
|
|
84
|
+
Success demo:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
clawguard scan-workspace ~/.openclaw/workspace
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Output should explain which duplicate skill wins and whether the winning copy has higher risk.
|
|
91
|
+
|
|
92
|
+
## Phase 3: Policy Engine
|
|
93
|
+
|
|
94
|
+
Goal: turn findings into decisions.
|
|
95
|
+
|
|
96
|
+
Build:
|
|
97
|
+
|
|
98
|
+
- Presets: personal, governed, enterprise.
|
|
99
|
+
- Decisions: allow, warn, manual review, sandbox required, dual approval, block.
|
|
100
|
+
- `.clawguard.json` config.
|
|
101
|
+
- Suppressions with reason and optional expiry.
|
|
102
|
+
- Policy check command for saved reports.
|
|
103
|
+
|
|
104
|
+
Success demo:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
clawguard scan ./skills --policy governed --fail-on-policy
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Phase 4: Reports and CI
|
|
111
|
+
|
|
112
|
+
Goal: make ClawGuard easy to adopt by maintainers.
|
|
113
|
+
|
|
114
|
+
Build:
|
|
115
|
+
|
|
116
|
+
- Stable JSON schema.
|
|
117
|
+
- SARIF reporter.
|
|
118
|
+
- GitHub Action.
|
|
119
|
+
- PR annotation examples.
|
|
120
|
+
- HTML report.
|
|
121
|
+
- JSONL audit output.
|
|
122
|
+
|
|
123
|
+
Success demo:
|
|
124
|
+
|
|
125
|
+
- Add ClawGuard to a sample skill repo.
|
|
126
|
+
- Open a PR with a risky skill.
|
|
127
|
+
- Show SARIF annotations and failed policy gate.
|
|
128
|
+
|
|
129
|
+
## Phase 5: MCP and Plugin Config Scanner
|
|
130
|
+
|
|
131
|
+
Goal: cover the second half of the OpenClaw/ClawHub surface: tools and plugins.
|
|
132
|
+
|
|
133
|
+
Status: started
|
|
134
|
+
|
|
135
|
+
Build:
|
|
136
|
+
|
|
137
|
+
- `.openclaw/plugins.json` parser.
|
|
138
|
+
- `.openclaw/mcp.json` parser.
|
|
139
|
+
- `.cursor/mcp.json` parser.
|
|
140
|
+
- Generic `mcp.json` parser.
|
|
141
|
+
- Plugin capability rule pack.
|
|
142
|
+
- Environment injection risk checks.
|
|
143
|
+
- Package/source trust checks.
|
|
144
|
+
|
|
145
|
+
Already present:
|
|
146
|
+
|
|
147
|
+
- Config path detection for `.cursor/mcp.json`, `.openclaw/mcp.json`, `.openclaw/plugins.json`, and `mcp.json`.
|
|
148
|
+
- JSON parsing with invalid-config findings.
|
|
149
|
+
- Runtime package command checks.
|
|
150
|
+
- Unpinned package checks.
|
|
151
|
+
- Secret env checks.
|
|
152
|
+
- Broad filesystem checks.
|
|
153
|
+
- Shell execution checks.
|
|
154
|
+
- Remote URL checks.
|
|
155
|
+
- Write-capability checks.
|
|
156
|
+
|
|
157
|
+
Success demo:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
clawguard scan-mcp .cursor/mcp.json
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Output should explain which tools are powerful and what approval/sandbox action is recommended.
|
|
164
|
+
|
|
165
|
+
## Phase 6: ClawHub Metadata
|
|
166
|
+
|
|
167
|
+
Goal: connect local scans to registry context.
|
|
168
|
+
|
|
169
|
+
Status: started
|
|
170
|
+
|
|
171
|
+
Build:
|
|
172
|
+
|
|
173
|
+
- `.clawhub/lock.json` parser.
|
|
174
|
+
- `.clawhub/origin.json` parser.
|
|
175
|
+
- Version/source reporting.
|
|
176
|
+
- Local drift detection.
|
|
177
|
+
- Metadata comparison.
|
|
178
|
+
- Optional `clawhub inspect` adapter.
|
|
179
|
+
|
|
180
|
+
Already present:
|
|
181
|
+
|
|
182
|
+
- `.clawhub/lock.json` detection and parsing.
|
|
183
|
+
- Per-skill `.clawhub/origin.json` detection and parsing.
|
|
184
|
+
- Version drift findings across lockfile, origin metadata, and local `SKILL.md`.
|
|
185
|
+
- Source drift findings across lockfile and origin metadata.
|
|
186
|
+
- Missing lockfile and missing origin findings.
|
|
187
|
+
- Untrusted or unusual source findings.
|
|
188
|
+
- JSON, CLI, and HTML report summaries for ClawHub metadata.
|
|
189
|
+
|
|
190
|
+
Success demo:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
clawguard scan examples/clawhub-workspace --fail-on none
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Output should show version/source context and mismatches.
|
|
197
|
+
|
|
198
|
+
## Phase 7: Web Demo
|
|
199
|
+
|
|
200
|
+
Goal: create the visibility engine.
|
|
201
|
+
|
|
202
|
+
Status: started
|
|
203
|
+
|
|
204
|
+
Build:
|
|
205
|
+
|
|
206
|
+
- Paste `SKILL.md` scanner.
|
|
207
|
+
- Folder or zip scanner.
|
|
208
|
+
- Visual risk score.
|
|
209
|
+
- Shareable report.
|
|
210
|
+
- Demo GIF script.
|
|
211
|
+
|
|
212
|
+
Already present:
|
|
213
|
+
|
|
214
|
+
- Local no-dependency web server.
|
|
215
|
+
- Paste `SKILL.md` scan flow.
|
|
216
|
+
- Built-in examples for static, metadata, workspace, ClawHub, dependency, and MCP risk.
|
|
217
|
+
- Policy selector.
|
|
218
|
+
- Visual score, policy decision, required actions, finding counts, metadata summaries, and finding cards.
|
|
219
|
+
- Copy JSON action.
|
|
220
|
+
|
|
221
|
+
Success demo:
|
|
222
|
+
|
|
223
|
+
> Upload OpenClaw skill -> ClawGuard scans -> Risk score -> Risk explanation -> Safer install recommendation.
|
|
224
|
+
|
|
225
|
+
This should be the first viral surface.
|
|
226
|
+
|
|
227
|
+
## Phase 8: MCP Server and Install Gate
|
|
228
|
+
|
|
229
|
+
Goal: make ClawGuard available inside agent workflows.
|
|
230
|
+
|
|
231
|
+
Build:
|
|
232
|
+
|
|
233
|
+
- Read-only MCP server.
|
|
234
|
+
- `scan_skill` tool.
|
|
235
|
+
- `scan_mcp_config` tool.
|
|
236
|
+
- `policy_decision` tool.
|
|
237
|
+
- Optional install wrapper.
|
|
238
|
+
|
|
239
|
+
Success demo:
|
|
240
|
+
|
|
241
|
+
An agent can ask ClawGuard to review a skill before recommending installation.
|
|
242
|
+
|
|
243
|
+
## Phase 9: Authority Assets
|
|
244
|
+
|
|
245
|
+
Goal: turn the project into a visible ecosystem security resource.
|
|
246
|
+
|
|
247
|
+
Build:
|
|
248
|
+
|
|
249
|
+
- `awesome-openclaw-security` companion repo.
|
|
250
|
+
- Security articles.
|
|
251
|
+
- Demo videos.
|
|
252
|
+
- OpenClaw/ClawHub PRs for docs and safer defaults.
|
|
253
|
+
- Fixture corpus from public safe/risky examples.
|
|
254
|
+
- Public rule documentation.
|
|
255
|
+
|
|
256
|
+
## Build Order Recommendation
|
|
257
|
+
|
|
258
|
+
Do this next:
|
|
259
|
+
|
|
260
|
+
1. Polish dependency/package lock scanning against real installed examples.
|
|
261
|
+
2. Add web paste demo.
|
|
262
|
+
3. Add demo GIF script and launch README assets.
|
|
263
|
+
4. Add optional ClawHub pre-install wrapper.
|
|
264
|
+
5. Prepare upstream OpenClaw/ClawHub docs PRs.
|
|
265
|
+
6. Create the first public security checklist.
|
|
266
|
+
|
|
267
|
+
This sequence gives the fastest path to a credible public release.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ClawHub Metadata Scanning
|
|
2
|
+
|
|
3
|
+
ClawGuard can inspect local ClawHub install metadata without contacting the network.
|
|
4
|
+
|
|
5
|
+
## What It Reads
|
|
6
|
+
|
|
7
|
+
- Workspace lockfile: `.clawhub/lock.json`
|
|
8
|
+
- Per-skill origin metadata: `skills/<name>/.clawhub/origin.json`
|
|
9
|
+
- Root origin metadata: `.clawhub/origin.json`
|
|
10
|
+
- Local skill metadata from `skills/<name>/SKILL.md`
|
|
11
|
+
|
|
12
|
+
The parser accepts a few lockfile shapes so it can work with early or changing ClawHub metadata:
|
|
13
|
+
|
|
14
|
+
- `skills` or `packages` arrays
|
|
15
|
+
- `skills` or `packages` objects keyed by skill name
|
|
16
|
+
- Top-level objects that contain metadata-like fields such as `version`, `source`, `repo`, `url`, `path`, or `dir`
|
|
17
|
+
|
|
18
|
+
## What It Reports
|
|
19
|
+
|
|
20
|
+
ClawHub scanning adds a `clawhub` block to JSON reports:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"clawhub": {
|
|
25
|
+
"lockfile": ".clawhub/lock.json",
|
|
26
|
+
"entries": [
|
|
27
|
+
{
|
|
28
|
+
"name": "weather-helper",
|
|
29
|
+
"version": "1.0.0",
|
|
30
|
+
"source": "https://github.com/openclaw/skills/weather-helper",
|
|
31
|
+
"skillDir": "skills/weather-helper"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"origins": []
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
It also emits findings when provenance cannot be trusted:
|
|
40
|
+
|
|
41
|
+
- Invalid ClawHub JSON metadata.
|
|
42
|
+
- Installed origin metadata exists but the workspace lockfile is missing.
|
|
43
|
+
- A lock entry has no matching local origin metadata.
|
|
44
|
+
- Lock, origin, and local `SKILL.md` versions drift apart.
|
|
45
|
+
- Lock source and origin source disagree.
|
|
46
|
+
- Source metadata points to an untrusted or unusual location.
|
|
47
|
+
|
|
48
|
+
## Example
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
node src/cli.js scan examples/clawhub-workspace --fail-on none
|
|
52
|
+
node src/cli.js scan examples/clawhub-workspace --json --fail-on none
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Trust Model
|
|
56
|
+
|
|
57
|
+
This is a local provenance check, not a registry verifier. ClawGuard does not fetch ClawHub data or prove that a remote source is safe. It highlights drift and unusual sources so users can pause before installing, updating, publishing, or recommending a skill.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Demo Capture
|
|
2
|
+
|
|
3
|
+
Use this command to regenerate launch demo assets:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm run demo:capture
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The capture script starts a temporary local ClawGuard web server, opens the web demo in Playwright, moves a visible cursor through the `Dependency Risk` flow, clicks `Download HTML`, and writes assets to `docs/assets`.
|
|
10
|
+
|
|
11
|
+
Generated files:
|
|
12
|
+
|
|
13
|
+
- `docs/assets/clawguard-web-demo.png`
|
|
14
|
+
- `docs/assets/clawguard-html-report.png`
|
|
15
|
+
- `docs/assets/clawguard-dependency-risk-report.html`
|
|
16
|
+
- `docs/assets/clawguard-demo.webm`
|
|
17
|
+
- `docs/assets/clawguard-demo.mp4` when `ffmpeg` is installed
|
|
18
|
+
|
|
19
|
+
The script does not install skill dependencies, run scanned code, or contact external registries. It scans local fixtures through the same web API used by the demo.
|
|
20
|
+
|
|
21
|
+
If Playwright browsers are missing, install them once:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx playwright install chromium
|
|
25
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Demo Script
|
|
2
|
+
|
|
3
|
+
Use this script for a short ClawGuard demo, README GIF, launch post, or maintainer walkthrough.
|
|
4
|
+
|
|
5
|
+
## One-Minute Web Demo
|
|
6
|
+
|
|
7
|
+
Setup:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm test
|
|
11
|
+
npm run web -- --port 4176
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Open:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
http://127.0.0.1:4176
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Talk track:
|
|
21
|
+
|
|
22
|
+
> ClawGuard is a companion security layer for OpenClaw-style skills, ClawHub installs, MCP configs, and skill dependencies. Before trusting a skill, it gives you a local risk score, policy decision, evidence, and an HTML report you can share.
|
|
23
|
+
|
|
24
|
+
Click path:
|
|
25
|
+
|
|
26
|
+
1. Open the local web demo.
|
|
27
|
+
2. Click `Dependency Risk`.
|
|
28
|
+
3. Point at the score: `100`, `Critical`, `Block`.
|
|
29
|
+
4. Point at required actions: `Manual Review`, `Do Not Install`, `Pin Dependencies`.
|
|
30
|
+
5. Point at findings:
|
|
31
|
+
- Install lifecycle script.
|
|
32
|
+
- Direct Git dependency.
|
|
33
|
+
- Missing lockfile.
|
|
34
|
+
- Unpinned dependency.
|
|
35
|
+
- Suspicious dependency name.
|
|
36
|
+
6. Click `Download HTML`.
|
|
37
|
+
7. Say:
|
|
38
|
+
|
|
39
|
+
> This report is self-contained. A maintainer can attach it to an issue, PR, or internal review without running the scanner again.
|
|
40
|
+
|
|
41
|
+
## Thirty-Second ClawHub Demo
|
|
42
|
+
|
|
43
|
+
Click path:
|
|
44
|
+
|
|
45
|
+
1. Click `ClawHub Drift`.
|
|
46
|
+
2. Point at source drift and version drift findings.
|
|
47
|
+
3. Say:
|
|
48
|
+
|
|
49
|
+
> ClawGuard reads local ClawHub metadata and tells you when the installed skill no longer matches the lockfile or origin metadata.
|
|
50
|
+
|
|
51
|
+
## Thirty-Second Workspace Demo
|
|
52
|
+
|
|
53
|
+
Click path:
|
|
54
|
+
|
|
55
|
+
1. Click `Workspace Override`.
|
|
56
|
+
2. Point at duplicate skill and override findings.
|
|
57
|
+
3. Say:
|
|
58
|
+
|
|
59
|
+
> OpenClaw workspace precedence matters. ClawGuard shows which skill wins and whether the winning copy is riskier.
|
|
60
|
+
|
|
61
|
+
## Paste Demo
|
|
62
|
+
|
|
63
|
+
Click path:
|
|
64
|
+
|
|
65
|
+
1. Click `Load sample`.
|
|
66
|
+
2. Click `Scan Paste`.
|
|
67
|
+
3. Point at the network declaration mismatch.
|
|
68
|
+
4. Say:
|
|
69
|
+
|
|
70
|
+
> Even a simple pasted `SKILL.md` can be checked for declared-versus-observed behavior before a user installs it.
|
|
71
|
+
|
|
72
|
+
## Folder Demo
|
|
73
|
+
|
|
74
|
+
Click path:
|
|
75
|
+
|
|
76
|
+
1. Click `Choose File` or `Skill Folder`.
|
|
77
|
+
2. Select a local skill folder.
|
|
78
|
+
3. Click `Scan Folder`.
|
|
79
|
+
4. Say:
|
|
80
|
+
|
|
81
|
+
> Folder scan is the real install-review workflow: choose a skill bundle, scan everything locally, and review evidence before trust.
|
|
82
|
+
|
|
83
|
+
## Demo Close
|
|
84
|
+
|
|
85
|
+
Use this close:
|
|
86
|
+
|
|
87
|
+
> ClawGuard does not replace OpenClaw or ClawHub. It is the review layer around them: local, explainable, CI-friendly, and designed to make third-party skills safer to install.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Dependency Scanning
|
|
2
|
+
|
|
3
|
+
ClawGuard can inspect common dependency manifests and lockfiles inside skill bundles and workspaces.
|
|
4
|
+
|
|
5
|
+
## What It Reads
|
|
6
|
+
|
|
7
|
+
- `package.json`
|
|
8
|
+
- `package-lock.json`
|
|
9
|
+
- `pnpm-lock.yaml`
|
|
10
|
+
- `yarn.lock`
|
|
11
|
+
- `requirements.txt`
|
|
12
|
+
- `pyproject.toml`
|
|
13
|
+
|
|
14
|
+
## What It Reports
|
|
15
|
+
|
|
16
|
+
Dependency scanning adds a `dependencies` block to JSON reports:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"manifests": [
|
|
22
|
+
{
|
|
23
|
+
"ecosystem": "npm",
|
|
24
|
+
"file": "package.json",
|
|
25
|
+
"directory": ".",
|
|
26
|
+
"name": "my-skill",
|
|
27
|
+
"dependencyCount": 3,
|
|
28
|
+
"scriptCount": 1
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"lockfiles": [
|
|
32
|
+
{
|
|
33
|
+
"file": "package-lock.json",
|
|
34
|
+
"ecosystem": "npm",
|
|
35
|
+
"directory": "."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
It emits findings for:
|
|
43
|
+
|
|
44
|
+
- Invalid dependency manifests.
|
|
45
|
+
- Install lifecycle scripts such as `preinstall`, `install`, `postinstall`, and `prepare`.
|
|
46
|
+
- Npm dependency manifests without a matching lockfile in the same directory.
|
|
47
|
+
- Unpinned dependency specs such as ranges, tags, or wildcards.
|
|
48
|
+
- Direct Git, URL, GitHub shorthand, or local file dependency sources.
|
|
49
|
+
- Dependency names containing security-sensitive terms such as `token`, `secret`, `credential`, `stealer`, `keylogger`, or `backdoor`.
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
node src/cli.js scan examples/dependency-risky-skill --fail-on none
|
|
55
|
+
node src/cli.js scan examples/dependency-safe-skill --json --fail-on none
|
|
56
|
+
node src/cli.js scan examples/dependency-python-skill --fail-on none
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Trust Model
|
|
60
|
+
|
|
61
|
+
Dependency scanning is static and local. It does not install packages, execute lifecycle scripts, contact registries, or claim that a package is safe. It highlights supply-chain risk signals so reviewers can pin versions, commit lockfiles, avoid install-time code, and manually review direct sources before enabling a skill.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# GitHub Action
|
|
2
|
+
|
|
3
|
+
ClawGuard can run in pull requests as a policy gate and emit SARIF for GitHub code scanning.
|
|
4
|
+
|
|
5
|
+
## Example Workflow
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
name: ClawGuard
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
pull_request:
|
|
12
|
+
push:
|
|
13
|
+
branches:
|
|
14
|
+
- main
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
security-events: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
scan:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- uses: denial-web/clawguard@v1
|
|
28
|
+
with:
|
|
29
|
+
target: skills
|
|
30
|
+
policy: governed
|
|
31
|
+
fail-on: critical
|
|
32
|
+
fail-on-policy: "true"
|
|
33
|
+
policy-fail-on: manual_review
|
|
34
|
+
sarif: clawguard.sarif
|
|
35
|
+
|
|
36
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
37
|
+
if: always()
|
|
38
|
+
with:
|
|
39
|
+
sarif_file: clawguard.sarif
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Inputs
|
|
43
|
+
|
|
44
|
+
- `target`: path to scan. Default: `.`
|
|
45
|
+
- `policy`: `personal`, `governed`, or `enterprise`. Default: `governed`
|
|
46
|
+
- `fail-on`: risk level that fails the workflow. Default: `critical`
|
|
47
|
+
- `fail-on-policy`: whether policy decisions fail the workflow. Default: `true`
|
|
48
|
+
- `policy-fail-on`: policy decision threshold. Default: `manual_review`
|
|
49
|
+
- `config`: optional `.clawguard.json` path
|
|
50
|
+
- `sarif`: optional SARIF output path. Default: `clawguard.sarif`
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
|
54
|
+
- The action is read-only. It scans files already present in the checked-out workspace.
|
|
55
|
+
- The action does not install scanned skill dependencies.
|
|
56
|
+
- Use `if: always()` for SARIF upload so GitHub receives results even when ClawGuard fails the policy gate.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# GitHub Repository Setup
|
|
2
|
+
|
|
3
|
+
Use this when publishing the ClawGuard repository.
|
|
4
|
+
|
|
5
|
+
## Repository Identity
|
|
6
|
+
|
|
7
|
+
Description:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Governance and security scanner for OpenClaw skills, ClawHub installs, MCP configs, and skill dependencies.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Topics:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
openclaw, clawhub, mcp, security, ai-agents, scanner, governance, supply-chain
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Short positioning:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
ClawGuard is an independent companion security layer for OpenClaw-style skills and MCP tool configs. It scans locally, explains risk, and helps teams decide whether to allow, review, sandbox, or block a skill before trusting it.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Recommended Settings
|
|
26
|
+
|
|
27
|
+
- Make the license visible from the repository root.
|
|
28
|
+
- Keep [SECURITY.md](../SECURITY.md) in the repository root.
|
|
29
|
+
- Enable Dependabot alerts for the repository.
|
|
30
|
+
- Enable GitHub code scanning if SARIF upload is used.
|
|
31
|
+
- Protect `main` once the first stable release exists.
|
|
32
|
+
- Require CI before merge after the project is public.
|
|
33
|
+
- Add screenshots from [docs/assets](assets) near the top of the README.
|
|
34
|
+
- Keep issue templates and the pull request template enabled.
|
|
35
|
+
|
|
36
|
+
## First Release
|
|
37
|
+
|
|
38
|
+
Recommended tag:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
v0.1.0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Release title:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
ClawGuard v0.1.0 - local OpenClaw skill and MCP risk scanner
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Release notes:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
Initial public preview of ClawGuard.
|
|
54
|
+
|
|
55
|
+
- Static scanning for OpenClaw-style SKILL.md files.
|
|
56
|
+
- Metadata mismatch checks for declared env vars, tools, config, network, and install behavior.
|
|
57
|
+
- MCP/plugin configuration scanning.
|
|
58
|
+
- OpenClaw workspace precedence scanning.
|
|
59
|
+
- ClawHub lockfile and origin metadata scanning.
|
|
60
|
+
- npm and Python dependency manifest scanning.
|
|
61
|
+
- CLI, JSON, SARIF, and self-contained HTML reports.
|
|
62
|
+
- Local web demo with paste scan, folder scan, built-in examples, JSON copy, and HTML export.
|
|
63
|
+
- OpenClaw plugin manifest checks for compatibility metadata, runtime code, missing compiled outputs, and sensitive host capabilities.
|
|
64
|
+
|
|
65
|
+
ClawGuard is static analysis. Findings are risk signals, not proof of malicious intent or proof of safety.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Launch Post
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
I am building ClawGuard, a companion governance/security scanner for OpenClaw-style skills, ClawHub installs, MCP configs, and skill dependencies.
|
|
72
|
+
|
|
73
|
+
It gives a local risk score, policy decision, evidence, and shareable HTML report before you trust a third-party skill.
|
|
74
|
+
|
|
75
|
+
It is static analysis, so findings are risk signals rather than proof of malicious intent. I would love safe/risky skill fixtures and feedback from people building with OpenClaw-style agents.
|
|
76
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# HTML Reports
|
|
2
|
+
|
|
3
|
+
ClawGuard can generate a self-contained HTML report for humans.
|
|
4
|
+
|
|
5
|
+
## Generate A Report
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run scan -- examples/metadata-mismatch-skill --html clawguard.html --fail-on none
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The report includes:
|
|
12
|
+
|
|
13
|
+
- Risk score and level.
|
|
14
|
+
- Policy decision and required actions.
|
|
15
|
+
- Finding counts by severity.
|
|
16
|
+
- Findings grouped by severity.
|
|
17
|
+
- Evidence and recommendations.
|
|
18
|
+
- Suppressed findings.
|
|
19
|
+
- Skipped files.
|
|
20
|
+
- Scan options and config path.
|
|
21
|
+
|
|
22
|
+
## Security Notes
|
|
23
|
+
|
|
24
|
+
- The report is generated from static scan data.
|
|
25
|
+
- Finding evidence is HTML-escaped before rendering.
|
|
26
|
+
- The report does not load external scripts, fonts, or styles.
|
|
27
|
+
- The report is meant for review and sharing, not proof that a skill is safe.
|