leakray 0.0.0-stage → 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.
Files changed (3) hide show
  1. package/README.md +73 -2
  2. package/dist/cli.mjs +107 -0
  3. package/package.json +45 -3
package/README.md CHANGED
@@ -1,3 +1,74 @@
1
- # Temporary Holding Version
1
+ # leakray
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Zero-config, strictly passive URL security scanner for modern full-stack and AI-built web apps (**Next.js, Vite/React, Supabase, Firebase, Stripe, Vercel, Cloudflare**).
4
+
5
+ Runs **16 read-only checks** locally from your terminal or CI pipeline — zero signup, zero telemetry, zero false positives on intentionally public client keys (like Supabase `anon` or Stripe `pk_live_`).
6
+
7
+ ## Quick Start
8
+
9
+ ```bash
10
+ npx leakray https://myapp.com
11
+ ```
12
+
13
+ Scan a local dev or preview server before deploying:
14
+
15
+ ```bash
16
+ npx leakray http://localhost:3000 --allow-local
17
+ ```
18
+
19
+ Fail CI if any `high` or `critical` finding is detected:
20
+
21
+ ```bash
22
+ npx leakray https://staging.myapp.com --fail-on high
23
+ ```
24
+
25
+ Print copy-paste fix prompts for Cursor / Claude Code:
26
+
27
+ ```bash
28
+ npx leakray https://myapp.com --ai-prompt
29
+ ```
30
+
31
+ Output structured JSON for scripts:
32
+
33
+ ```bash
34
+ npx leakray https://myapp.com --json
35
+ ```
36
+
37
+ ## What It Checks (16 Passive Rules)
38
+
39
+ - **Leaked Secrets & Keys:** Real private keys in HTML and first-party JS bundles (`sk_live_`, `rk_live_`, `sk-ant-`, `sk-proj-`, `AKIA`, `ghp_`, PEM blocks, Supabase `service_role` JWTs) — without false-flagging public keys (`anon`, `pk_live_`, Firebase web `apiKey`).
40
+ - **Exposed Files & Metadata:** `/.env`, `/.git/HEAD`, public `.js.map` source maps, `__NEXT_DATA__` sensitive fields, Next.js debug exposure, OpenAPI/Swagger endpoints, and sensitive `robots.txt` paths.
41
+ - **Transport, Headers & Cookies:** HTTPS/HSTS, CSP, `X-Content-Type-Options`, clickjacking, `Referrer-Policy`, `Permissions-Policy`, SRI, COOP/COEP, CORS credential reflection, `Set-Cookie` flags, and server banner leaks.
42
+
43
+ ## GitHub Actions Example
44
+
45
+ ```yaml
46
+ name: LeakRay Security Check
47
+ on: [deployment_status]
48
+
49
+ jobs:
50
+ leakray:
51
+ if: github.event.deployment_status.state == 'success'
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/setup-node@v4
55
+ with:
56
+ node-version: 22
57
+ - run: npx -y leakray "${{ github.event.deployment_status.target_url }}" --fail-on high
58
+ ```
59
+
60
+ ## Options
61
+
62
+ | Flag | Description |
63
+ | :--- | :--- |
64
+ | `--allow-local` | Allow scanning `localhost` / private network URLs |
65
+ | `--fail-on <severity>` | Exit with code `1` if any finding is `>=` severity (`critical`, `high`, `medium`, `low`, `info`) |
66
+ | `--ai-prompt` | Print copy-paste AI fix prompts for each finding |
67
+ | `--json` | Output machine-readable JSON |
68
+ | `--timeout <ms>` | Overall scan timeout in milliseconds (default: `20000`) |
69
+ | `--no-color` | Disable ANSI colors (also respects `NO_COLOR`) |
70
+
71
+ ## Web App
72
+
73
+ Prefer a browser UI, interactive 16-check matrix, and Grade A+ README badge?
74
+ Visit **[LeakRay Web](https://leakray.leakray-app.workers.dev)**.