You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(claude): sync setup-security-tools to canonical
Replaces the older zod-based setup-security-tools with canonical
TypeBox version (sourced from socket-repo-template/template). Key
changes:
- TypeBox schemas (matches the rest of the fleet's xport pattern)
- PURL-based AgentShield package spec (pkg:npm/ecc-agentshield@1.4.0)
- downloadPackage from @socketsecurity/lib/dlx/package — installs
AgentShield via dlx instead of requiring it as a workspace
devDep, so consumers don't need ecc-agentshield in
devDependencies
- mkdtemp (collision-safe) instead of Date.now()-only naming
- normalizePath on binary paths
- parseSchema from @socketsecurity/lib/schema/parse
- pip3 added to ecosystems lists
The hook's package.json now declares @sinclair/typebox +
@socketregistry/packageurl-js (catalog refs); the new socket-registry
setup action provisions all three zero-dep packages
(@socketsecurity/lib + @socketregistry/packageurl-js +
@sinclair/typebox) via the multi-package bootstrap loop, so a
fresh checkout has them resolvable at hook-load time.
Copy file name to clipboardExpand all lines: .claude/hooks/setup-security-tools/README.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,24 @@ Sets up all three Socket security tools for local development in one command.
5
5
## Tools
6
6
7
7
### 1. AgentShield
8
+
8
9
Scans your Claude Code configuration (`.claude/` directory) for security issues like prompt injection, leaked secrets, and overly permissive tool permissions.
9
10
10
-
**How it's installed**: Already a devDependency (`ecc-agentshield`). The setup script just verifies it's available — if not, run `pnpm install`.
11
+
**How it's installed**: npm package downloaded via the dlx system (pinned version + integrity hash from `external-tools.json`), cached at `~/.socket/_dlx/`. Subsequent runs reuse the cache. No `devDependencies` entry required in the consumer repo.
11
12
12
13
### 2. Zizmor
14
+
13
15
Static analysis tool for GitHub Actions workflows. Catches unpinned actions, secret exposure, template injection, and permission issues.
14
16
15
17
**How it's installed**: Binary downloaded from [GitHub releases](https://github.com/zizmorcore/zizmor/releases), SHA-256 verified, cached via the dlx system at `~/.socket/_dlx/`. If you already have it via `brew install zizmor`, the download is skipped.
16
18
17
19
### 3. SFW (Socket Firewall)
20
+
18
21
Intercepts package manager commands (`npm install`, `pnpm add`, etc.) and scans packages against Socket.dev's malware database before installation.
19
22
20
23
**How it's installed**: Binary downloaded from GitHub, SHA-256 verified, cached via the dlx system at `~/.socket/_dlx/`. Small wrapper scripts ("shims") are created at `~/.socket/sfw/shims/` that transparently route commands through the firewall.
21
24
22
-
**Free vs Enterprise**: If you have a `SOCKET_API_KEY` (in env, `.env`, or `.env.local`), enterprise mode is used with additional ecosystem support (gem, bundler, nuget, go). Otherwise, free mode covers npm, yarn, pnpm, pip, uv, and cargo.
25
+
**Free vs Enterprise**: If you have a `SOCKET_API_KEY` (in env, `.env`, or `.env.local`), enterprise mode is used with additional ecosystem support (gem, bundler, nuget, go). Otherwise, free mode covers npm, yarn, pnpm, pip, pip3, uv, and cargo.
23
26
24
27
## How to use
25
28
@@ -31,16 +34,17 @@ Claude will ask if you have an API key, then run the setup script.
2.Ensure the consumer repo has `@socketsecurity/lib`, `@socketregistry/packageurl-js`, and `@sinclair/typebox` available (via workspace catalog or direct deps)
62
67
3. Ensure `.claude/hooks/` is not gitignored (add `!/.claude/hooks/` to `.gitignore`)
63
-
4.Ensure `ecc-agentshield` is a devDep in the target repo
68
+
4.Run `pnpm install` in the consumer repo so the hook's workspace deps resolve
64
69
65
70
## Troubleshooting
66
71
67
-
**"AgentShield not found"** — Run `pnpm install`. It's the `ecc-agentshield` devDependency.
72
+
**"AgentShield install failed"** — Check network access to npm registry. The dlx system caches at `~/.socket/_dlx/`; clear the cache (`rm -rf ~/.socket/_dlx/`) to force a fresh download.
68
73
69
74
**"zizmor found but wrong version"** — The script downloads the expected version via the dlx cache. Your system version (e.g. from brew) will be ignored in favor of the correct version.
70
75
71
76
**"No supported package managers found"** — SFW only creates shims for package managers found on your PATH. Install npm/pnpm/etc. first.
72
77
73
-
**SFW shims not intercepting** — Make sure `~/.socket/sfw/shims` is at the *front* of PATH. Run `which npm` — it should point to the shim, not the real binary.
78
+
**SFW shims not intercepting** — Make sure `~/.socket/sfw/shims` is at the _front_ of PATH. Run `which npm` — it should point to the shim, not the real binary.
0 commit comments