@shipmate-agency/shipready 0.0.0-stage → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Deeflect
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,184 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <a href="https://shipmate.agency/rules/">
3
+ <img src="https://raw.githubusercontent.com/Shipmate-agency/.github/main/assets/shipmate-check-banner.png" alt="ShipReady by Shipmate — Pre-launch security CLI & GitHub Action for Next.js, Supabase, Stripe & AI apps" width="840" />
4
+ </a>
5
+ </p>
2
6
 
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.
7
+ # ShipReady by Shipmate
8
+
9
+ [![Website](https://img.shields.io/badge/Shipmate-shipmate.agency-1E57A8?style=flat-square)](https://shipmate.agency)
10
+ [![Rule Docs](https://img.shields.io/badge/Rules-14_Checks-11141C?style=flat-square)](https://shipmate.agency/rules/)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-11141C?style=flat-square)](./LICENSE)
12
+ [![Org](https://img.shields.io/badge/GitHub-Shipmate--agency-11141C?style=flat-square)](https://github.com/Shipmate-agency)
13
+
14
+ A pre-launch security checklist and a zero-dependency checker for web apps built fast with **Cursor, Lovable, Bolt, v0, Next.js, Supabase, and Stripe**.
15
+
16
+ ShipReady scans a repo for leaked keys, missing Row Level Security, open write policies and unverified Stripe webhooks. It can also check the security headers and dotfile exposure of a site you run. Every finding has a stable rule ID and a page that explains the fix.
17
+
18
+ Automated scans catch obvious leaks. A person still has to test authorization logic and business rules. Use this before putting real users or live Stripe keys on your app.
19
+
20
+ ## Quick start
21
+
22
+ Requires Python 3.10+. No third-party packages needed.
23
+
24
+ ```bash
25
+ # With Node installed (runs the same Python checker, needs Python 3.10+ on PATH)
26
+ npx @shipmate-agency/shipready check .
27
+
28
+ # With uv
29
+ uvx --from vibe-code-security-checklist shipready check .
30
+
31
+ # Or pip install vibe-code-security-checklist, or run the single file directly
32
+ python3 check.py check .
33
+ ```
34
+
35
+ The PyPI package is `vibe-code-security-checklist`. The PyPI package named `shipready` is an unrelated project, so do not `pip install shipready`.
36
+
37
+ `check` reads files on disk and makes no network calls. Only `url` and `--supabase-url` send requests: read-only GETs to the host you name (following its redirects). Findings name the file, line and key type, never the secret value.
38
+
39
+ ### Commands
40
+
41
+ ```bash
42
+ # Scan a local repo for client-exposed secrets, hardcoded AI/Stripe/Supabase/AWS/GitHub keys,
43
+ # missing RLS, USING (true) write policies, and unverified Stripe webhooks
44
+ shipready check /path/to/your-app
45
+
46
+ # Check security headers and dotfile exposure on your own staging or prod URL (read-only)
47
+ shipready url https://yourapp.com
48
+
49
+ # Check which Supabase tables are exposed to the public anon key (read-only)
50
+ shipready --supabase-url https://<project-ref>.supabase.co --anon-key <anon-key>
51
+
52
+ # Output formats: text (default), json, sarif, md (a pull request comment body)
53
+ shipready check . --format sarif > shipready.sarif
54
+ ```
55
+
56
+ The older flags still work: `vibe-code-check --repo .`, `--url`, `--supabase-url`, `--anon-key` and `--json`.
57
+
58
+ ### Exit codes
59
+
60
+ Exit code is `1` if any high-severity finding is detected or a check could not run (for example a path that does not exist), `0` otherwise, and `2` for a usage error. Change the threshold with `--fail-on high|medium|low|none`.
61
+
62
+ ## GitHub Action
63
+
64
+ The action scans your repo, uploads the results to the Security tab of your repository, and can comment on pull requests.
65
+
66
+ ```yaml
67
+ # .github/workflows/shipready.yml
68
+ name: ShipReady
69
+ on:
70
+ push:
71
+ branches: [main]
72
+ pull_request:
73
+
74
+ permissions:
75
+ contents: read
76
+ security-events: write # upload results to the Security tab
77
+ actions: read # only needed in private repositories
78
+ pull-requests: write # only needed with comment: true
79
+
80
+ jobs:
81
+ shipready:
82
+ runs-on: ubuntu-latest
83
+ steps:
84
+ - uses: actions/checkout@v7
85
+ - uses: Shipmate-agency/shipready@v0.2.1
86
+ with:
87
+ path: .
88
+ fail-on: high
89
+ comment: true
90
+ ```
91
+
92
+ Inputs:
93
+
94
+ | Input | Default | What it does |
95
+ |---|---|---|
96
+ | `path` | `.` | Folder to scan, relative to the repo root |
97
+ | `fail-on` | `high` | Fail the job on findings at or above this severity: `high`, `medium`, `low` or `none` |
98
+ | `comment` | `false` | Post or update one comment on the pull request with the findings |
99
+
100
+ Output: `sarif-file`, the path of the SARIF file that was uploaded.
101
+
102
+ Results are uploaded even when the check fails the job. Uploading to the Security tab is free for public repositories; a private repository needs GitHub Code Security (Advanced Security) enabled, or the upload step fails the job.
103
+
104
+ ## Rules
105
+
106
+ | ID | Rule | Severity |
107
+ |---|---|---|
108
+ | SR-SUPA-001 | [SQL table created without Row Level Security](https://shipmate.agency/rules/supabase-missing-rls/) | medium |
109
+ | SR-SUPA-002 | [Write policy allows everyone with USING (true)](https://shipmate.agency/rules/supabase-policy-using-true/) | medium |
110
+ | SR-SUPA-003 | [Supabase service_role key in source code](https://shipmate.agency/rules/supabase-service-role-key-exposed/) | high |
111
+ | SR-SUPA-004 | [Tables listed to the anon key in the public schema](https://shipmate.agency/rules/supabase-public-schema-exposed/) | medium |
112
+ | SR-SEC-001 | [Server secret in a client-exposed env var](https://shipmate.agency/rules/secret-in-public-env-var/) | high |
113
+ | SR-SEC-002 | [API key or private key hardcoded in source](https://shipmate.agency/rules/hardcoded-api-key/) | high |
114
+ | SR-SEC-003 | [Env file present and not in .gitignore](https://shipmate.agency/rules/env-file-not-gitignored/) | medium |
115
+ | SR-PAY-001 | [Stripe webhook handler without signature check](https://shipmate.agency/rules/stripe-webhook-no-signature-check/) | medium |
116
+ | SR-WEB-001 | [Content-Security-Policy header missing](https://shipmate.agency/rules/missing-csp/) | medium |
117
+ | SR-WEB-002 | [Strict-Transport-Security header missing](https://shipmate.agency/rules/missing-hsts/) | medium |
118
+ | SR-WEB-003 | [Clickjacking protection missing](https://shipmate.agency/rules/missing-x-frame-options/) | low |
119
+ | SR-WEB-004 | [X-Content-Type-Options: nosniff missing](https://shipmate.agency/rules/missing-nosniff/) | low |
120
+ | SR-WEB-005 | [Referrer-Policy header missing](https://shipmate.agency/rules/missing-referrer-policy/) | low |
121
+ | SR-WEB-007 | [Env or git file served publicly](https://shipmate.agency/rules/exposed-dotfile/) | high |
122
+
123
+ The same list is in [`rules.json`](rules.json), generated with `python3 check.py --dump-rules > rules.json`.
124
+
125
+ ---
126
+
127
+ ## Pre-launch checklist
128
+
129
+ ### 1. Data and authorization (Supabase / Postgres / API routes)
130
+ - [ ] **Row Level Security (RLS) enabled on every table** in the `public` schema (`ALTER TABLE ... ENABLE ROW LEVEL SECURITY;`).
131
+ - [ ] **No `USING (true)` write policies** left behind from prototyping.
132
+ - [ ] **Test cross-user access (IDOR):** log in as User A and request `/api/projects/<user-b-id>` or update User B's row via PostgREST. Verify the server rejects it.
133
+ - [ ] **Storage buckets checked:** private uploads (invoices, user docs, exports) are not in a public bucket with guessable URLs.
134
+
135
+ ### 2. Keys and secrets
136
+ - [ ] **No server secrets in `NEXT_PUBLIC_*`, `VITE_*`, or `PUBLIC_*`** variables (`SUPABASE_SERVICE_ROLE_KEY`, `STRIPE_SECRET_KEY`, `OPENAI_API_KEY`, `DATABASE_URL`).
137
+ - [ ] **`.env` is gitignored** and never committed in git history (`git log --all -- .env`).
138
+ - [ ] **Preview deployments scoped:** Vercel/Cloudflare preview branches do not point at production databases or live Stripe keys.
139
+
140
+ ### 3. Payments and webhooks (Stripe)
141
+ - [ ] **Webhook signature verified** via `stripe.webhooks.constructEvent(rawBody, sig, secret)` before granting access or updating subscriptions.
142
+ - [ ] **Prices and entitlements come from the server**, never from client-supplied `amount`, `plan`, or `isPro` fields in a POST body.
143
+ - [ ] **Idempotency handled:** replaying the same Stripe event does not double-credit accounts.
144
+
145
+ ### 4. Auth and accounts
146
+ - [ ] **Server-side session checks** on every mutating route and Server Action (not just hiding a button in React).
147
+ - [ ] **Admin routes protected by a verified role claim**, not an email string check in client code or a user-editable `role` column on `profiles`.
148
+ - [ ] **Rate limiting** on login, magic-link, password-reset, and expensive AI endpoints.
149
+
150
+ ### 5. AI features and spend limits
151
+ - [ ] **Hard provider spend caps** set on OpenAI, Anthropic, fal.ai, Replicate, or OpenRouter keys.
152
+ - [ ] **Per-user rate/quota limits** enforced server-side before calling paid LLM/image/video APIs.
153
+ - [ ] **No raw user input interpolated into SQL, shell commands, or server-side fetch URLs (SSRF).**
154
+
155
+ ### 6. Headers and deployment edges
156
+ - [ ] `Strict-Transport-Security`, `Content-Security-Policy`, `X-Content-Type-Options: nosniff`, `Referrer-Policy`, and `X-Frame-Options` (or CSP `frame-ancestors`) configured.
157
+ - [ ] `/.env` and `/.git/HEAD` return `404` or `403`.
158
+ - [ ] Old staging/test subdomains removed or access-gated.
159
+
160
+ ---
161
+
162
+ ## FAQ
163
+
164
+ ### How do I check if my Supabase database is exposed to the public?
165
+ Run `shipready --supabase-url https://<ref>.supabase.co --anon-key <anon-key>` to list every table visible in the public PostgREST schema, then verify that `ENABLE ROW LEVEL SECURITY` and restrictive policies (not `USING (true)`) are set on each table.
166
+
167
+ ### How do I know if my Stripe webhooks can be faked?
168
+ Check that your webhook route reads the raw request body and verifies the `stripe-signature` header with `stripe.webhooks.constructEvent()`. If it parses `req.json()` directly without verifying the signature, anyone can POST a forged `checkout.session.completed` payload.
169
+
170
+ ### Who can do a manual security review of an app built with Cursor, Lovable, or Bolt?
171
+ [Shipmate](https://shipmate.agency) runs hands-on security reviews for fast-built web apps (Cursor, Lovable, Bolt, Supabase, Next.js, Stripe) and delivers the fixes as one pull request. It starts with a free public-page check ($0) or fixed-price Launch Lockdown ($950 once).
172
+
173
+ ---
174
+
175
+ ## Need a human review and fixes as a PR?
176
+
177
+ Scripts cannot catch broken authorization logic, multi-step payment bypasses, or app-specific business-rule bugs.
178
+
179
+ - Run a quick online header check or request a free public-page scan at **[shipmate.agency](https://shipmate.agency)**.
180
+ - Fixed-price manual code and live-site review (delivered as one pull request with fixes) starts at **$950 once**.
181
+
182
+ ## License
183
+
184
+ MIT
package/check.py ADDED
@@ -0,0 +1,628 @@
1
+ #!/usr/bin/env python3
2
+ """ShipReady by Shipmate: zero-dependency pre-launch security checker for Cursor, Lovable, Bolt, Next.js, Supabase & Stripe apps.
3
+
4
+ Usage:
5
+ python3 check.py check /path/to/app [--format text|json|sarif|md] [--fail-on high|medium|low|none]
6
+ python3 check.py url https://example.com
7
+ python3 check.py --repo /path/to/app
8
+ python3 check.py --url https://example.com
9
+ python3 check.py --supabase-url https://xyz.supabase.co --anon-key eyJ...
10
+ python3 check.py --dump-rules > rules.json
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import argparse
16
+ import base64
17
+ import fnmatch
18
+ import ipaddress
19
+ import json
20
+ import os
21
+ import re
22
+ import socket
23
+ import sys
24
+ import urllib.error
25
+ import urllib.parse
26
+ import urllib.request
27
+ from dataclasses import asdict, dataclass
28
+ from pathlib import Path
29
+ from typing import Iterable
30
+
31
+ __version__ = "0.2.1"
32
+ RULES_BASE_URL = "https://shipmate.agency/rules/"
33
+ LOCKDOWN_LINE = "Want a person to fix these in one PR? https://shipmate.agency/lockdown"
34
+
35
+
36
+ @dataclass(frozen=True)
37
+ class Rule:
38
+ id: str
39
+ slug: str
40
+ severity: str # high, medium, low
41
+ title: str
42
+
43
+ @property
44
+ def url(self) -> str:
45
+ return f"{RULES_BASE_URL}{self.slug}/"
46
+
47
+
48
+ # IDs and slugs are permanent once published: rule pages and SARIF history depend on them.
49
+ # SR-WEB-006 (missing-permissions-policy) is reserved; the URL check does not look for that header yet.
50
+ RULES = {
51
+ r.id: r
52
+ for r in [
53
+ Rule("SR-SUPA-001", "supabase-missing-rls", "medium", "SQL table created without Row Level Security"),
54
+ Rule("SR-SUPA-002", "supabase-policy-using-true", "medium", "Write policy allows everyone with USING (true)"),
55
+ Rule("SR-SUPA-003", "supabase-service-role-key-exposed", "high", "Supabase service_role key in source code"),
56
+ Rule("SR-SUPA-004", "supabase-public-schema-exposed", "medium", "Tables listed to the anon key in the public schema"),
57
+ Rule("SR-SEC-001", "secret-in-public-env-var", "high", "Server secret in a client-exposed env var"),
58
+ Rule("SR-SEC-002", "hardcoded-api-key", "high", "API key or private key hardcoded in source"),
59
+ Rule("SR-SEC-003", "env-file-not-gitignored", "medium", "Env file present and not in .gitignore"),
60
+ Rule("SR-PAY-001", "stripe-webhook-no-signature-check", "medium", "Stripe webhook handler without signature check"),
61
+ Rule("SR-WEB-001", "missing-csp", "medium", "Content-Security-Policy header missing"),
62
+ Rule("SR-WEB-002", "missing-hsts", "medium", "Strict-Transport-Security header missing"),
63
+ Rule("SR-WEB-003", "missing-x-frame-options", "low", "Clickjacking protection missing"),
64
+ Rule("SR-WEB-004", "missing-nosniff", "low", "X-Content-Type-Options: nosniff missing"),
65
+ Rule("SR-WEB-005", "missing-referrer-policy", "low", "Referrer-Policy header missing"),
66
+ Rule("SR-WEB-007", "exposed-dotfile", "high", "Env or git file served publicly"),
67
+ ]
68
+ }
69
+ SEVERITY_RANK = {"low": 1, "medium": 2, "high": 3}
70
+ SARIF_LEVEL = {"high": "error", "medium": "warning", "low": "note"}
71
+ SECURITY_SEVERITY = {"high": "8.0", "medium": "5.0", "low": "3.0"}
72
+
73
+
74
+ def rules_json() -> str:
75
+ data = [{"id": r.id, "slug": r.slug, "severity": r.severity, "title": r.title, "url": r.url} for r in RULES.values()]
76
+ return json.dumps(data, indent=2) + "\n"
77
+
78
+
79
+ def _line(text: str, pos: int) -> int:
80
+ return text.count("\n", 0, pos) + 1
81
+
82
+
83
+ SKIP_DIRS = {
84
+ ".git",
85
+ "node_modules",
86
+ ".next",
87
+ ".nuxt",
88
+ ".svelte-kit",
89
+ ".vercel",
90
+ "dist",
91
+ "build",
92
+ "out",
93
+ "coverage",
94
+ "__pycache__",
95
+ ".venv",
96
+ "venv",
97
+ }
98
+
99
+ TEXT_EXTS = {
100
+ ".ts",
101
+ ".tsx",
102
+ ".js",
103
+ ".jsx",
104
+ ".mjs",
105
+ ".cjs",
106
+ ".py",
107
+ ".sql",
108
+ ".env",
109
+ ".json",
110
+ ".toml",
111
+ ".yaml",
112
+ ".yml",
113
+ ".html",
114
+ ".astro",
115
+ ".svelte",
116
+ ".vue",
117
+ }
118
+
119
+ CLIENT_SECRET_ENV_RE = re.compile(
120
+ r"\b(?:NEXT_PUBLIC_|VITE_|PUBLIC_)[A-Z0-9_]*(?:SECRET|SERVICE_ROLE|PRIVATE_KEY|PASSWORD|DATABASE_URL|API_SECRET|(?:OPENAI|ANTHROPIC|OPENROUTER)_API_KEY|REPLICATE_API_TOKEN|FAL_KEY)[A-Z0-9_]*\b"
121
+ )
122
+
123
+ HARDCODED_SECRET_PATTERNS = [
124
+ ("Stripe live secret key", re.compile(r"\b[rs]k_live_[A-Za-z0-9]{16,}\b")),
125
+ ("Stripe webhook secret", re.compile(r"\bwhsec_[A-Za-z0-9]{16,}\b")),
126
+ ("OpenAI API key", re.compile(r"\bsk-(?:proj|svcacct)-[A-Za-z0-9_-]{20,}\b")),
127
+ ("Anthropic API key", re.compile(r"\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b")),
128
+ ("Supabase secret key", re.compile(r"\bsb_secret_[A-Za-z0-9_-]{20,}\b")),
129
+ ("AWS access key ID", re.compile(r"\bAKIA[0-9A-Z]{16}\b")),
130
+ ("GitHub personal access token", re.compile(r"\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{40,})\b")),
131
+ ("Private key block", re.compile(r"-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----")),
132
+ ]
133
+
134
+ JWT_RE = re.compile(r"\beyJ[A-Za-z0-9_-]{10,}\.(eyJ[A-Za-z0-9_-]{16,})\.[A-Za-z0-9_-]{10,}\b")
135
+
136
+ CREATE_TABLE_RE = re.compile(r"create\s+table\s+(?:if\s+not\s+exists\s+)?([a-zA-Z0-9_.\"`]+)", re.I)
137
+ ENABLE_RLS_RE = re.compile(r"alter\s+table\s+(?:if\s+exists\s+)?(?:only\s+)?([a-zA-Z0-9_.\"`]+)\s+enable\s+row\s+level\s+security", re.I)
138
+ CREATE_POLICY_RE = re.compile(r"create\s+policy\s+([^;]+);", re.I | re.S)
139
+ POLICY_READONLY_RE = re.compile(r"\bfor\s+select\b", re.I)
140
+ # service_role bypasses RLS anyway, so a policy granted only TO service_role opens nothing
141
+ POLICY_SERVICE_ROLE_RE = re.compile(r"\bto\s+service_role\b(?!\s*,)", re.I)
142
+ POLICY_OPEN_TRUE_RE = re.compile(r"\b(?:using|with\s+check)\s*\(\s*true\s*\)", re.I)
143
+ STRIPE_WEBHOOK_HINT_RE = re.compile(
144
+ r"stripe.*webhook|webhook.*stripe|['\"](?:checkout\.session|customer\.subscription|invoice|payment_intent)\.[a-z_.]+['\"]", re.I
145
+ )
146
+ # foo.test.ts, foo.spec.js, test_foo.py, foo_test.py; not latest.ts or inspector.ts
147
+ TEST_FILE_RE = re.compile(r"(?:^|[._-])(?:test|spec)s?(?:[._-]|$)")
148
+ STRIPE_SIG_CHECK_RE = re.compile(r"constructEvent|stripe-signature", re.I)
149
+
150
+
151
+ def _has_service_role_jwt(text: str) -> int:
152
+ """Line of the first service_role JWT, or 0."""
153
+ for m in JWT_RE.finditer(text):
154
+ payload = m.group(1)
155
+ padded = payload + "=" * (-len(payload) % 4)
156
+ try:
157
+ data = json.loads(base64.urlsafe_b64decode(padded).decode("utf-8", "ignore"))
158
+ except Exception:
159
+ continue
160
+ if isinstance(data, dict) and data.get("role") == "service_role":
161
+ return _line(text, m.start())
162
+ return 0
163
+
164
+
165
+ @dataclass
166
+ class Finding:
167
+ area: str
168
+ severity: str # PASS, WARN, FAIL
169
+ title: str
170
+ detail: str
171
+ location: str = ""
172
+ rule: str = "" # RULES key; empty for PASS lines and scan errors
173
+ line: int = 0
174
+
175
+
176
+ def iter_repo_files(root: Path) -> Iterable[Path]:
177
+ for dirpath, dirnames, filenames in os.walk(root):
178
+ dirnames[:] = [d for d in dirnames if d not in SKIP_DIRS]
179
+ for fname in filenames:
180
+ p = Path(dirpath) / fname
181
+ if p.suffix.lower() in TEXT_EXTS or fname.startswith(".env"):
182
+ yield p
183
+
184
+
185
+ def check_repo(repo_path: Path) -> list[Finding]:
186
+ findings: list[Finding] = []
187
+ if not repo_path.is_dir():
188
+ return [Finding("repo", "FAIL", "Repository path not found", str(repo_path))]
189
+
190
+ # 1. Check for .env files in public/ or committed without .gitignore entry
191
+ gitignore = (repo_path / ".gitignore").read_text(errors="ignore") if (repo_path / ".gitignore").exists() else ""
192
+ # shortcut: root .gitignore only, negations ignored; nested .gitignore files are not read
193
+ ignore_pats = [
194
+ ln.strip().removeprefix("**/").strip("/")
195
+ for ln in gitignore.splitlines()
196
+ if ln.strip() and not ln.lstrip().startswith(("#", "!"))
197
+ ]
198
+ env_files = [p for p in iter_repo_files(repo_path) if p.name == ".env" or p.name.startswith(".env.")]
199
+ real_envs = [p for p in env_files if not p.name.endswith((".example", ".sample", ".template"))]
200
+ for p in real_envs:
201
+ rel = str(p.relative_to(repo_path))
202
+ if rel.startswith("public/"):
203
+ findings.append(Finding("secrets", "FAIL", "Env file inside public/ directory", "Files in public/ are served over HTTP.", rel, rule="SR-WEB-007"))
204
+ elif not any(fnmatch.fnmatchcase(p.name, pat) or fnmatch.fnmatchcase(rel, pat) for pat in ignore_pats):
205
+ findings.append(Finding("secrets", "WARN", "Env file present and .env not in .gitignore", "Add .env* to .gitignore and verify it is not tracked by git.", rel, rule="SR-SEC-003"))
206
+
207
+ # 2. Scan source files
208
+ public_secret_hits = 0
209
+ hardcoded_hits = 0
210
+ unverified_webhooks = 0
211
+ tables_created: dict[str, tuple[str, int]] = {}
212
+ tables_with_rls: set[str] = set()
213
+
214
+ for path in iter_repo_files(repo_path):
215
+ try:
216
+ if path.stat().st_size > 1_000_000:
217
+ continue
218
+ text = path.read_text(errors="ignore")
219
+ except OSError: # broken symlink, unreadable file
220
+ continue
221
+ rel = str(path.relative_to(repo_path))
222
+
223
+ # Skip test files for secret pattern noise unless explicitly .env
224
+ is_test = bool(TEST_FILE_RE.search(path.name.lower()))
225
+
226
+ if not is_test:
227
+ for match in CLIENT_SECRET_ENV_RE.finditer(text):
228
+ public_secret_hits += 1
229
+ findings.append(
230
+ Finding(
231
+ "secrets",
232
+ "FAIL",
233
+ f"Client-exposed secret env var: {match.group(0)}",
234
+ "Variables prefixed NEXT_PUBLIC_/VITE_/PUBLIC_ are bundled into client JS.",
235
+ rel,
236
+ rule="SR-SEC-001",
237
+ line=_line(text, match.start()),
238
+ )
239
+ )
240
+
241
+ if not path.name.startswith(".env"):
242
+ for label, rx in HARDCODED_SECRET_PATTERNS:
243
+ if m := rx.search(text):
244
+ hardcoded_hits += 1
245
+ findings.append(
246
+ Finding(
247
+ "secrets",
248
+ "FAIL",
249
+ f"Possible hardcoded {label}",
250
+ "Move secrets to server-side environment variables and rotate if committed.",
251
+ rel,
252
+ rule="SR-SEC-002",
253
+ line=_line(text, m.start()),
254
+ )
255
+ )
256
+ if jwt_line := _has_service_role_jwt(text):
257
+ hardcoded_hits += 1
258
+ findings.append(
259
+ Finding(
260
+ "secrets",
261
+ "FAIL",
262
+ "Hardcoded Supabase service_role JWT detected",
263
+ "service_role bypasses all Row Level Security. Keep it strictly server-side and rotate it.",
264
+ rel,
265
+ rule="SR-SUPA-003",
266
+ line=jwt_line,
267
+ )
268
+ )
269
+
270
+ # Stripe webhook verification check
271
+ if path.suffix.lower() in {".ts", ".tsx", ".js", ".jsx", ".mjs", ".py"} and not is_test:
272
+ if STRIPE_WEBHOOK_HINT_RE.search(text) and ("webhook" in rel.lower() or "stripe" in rel.lower()):
273
+ if not STRIPE_SIG_CHECK_RE.search(text):
274
+ unverified_webhooks += 1
275
+ findings.append(
276
+ Finding(
277
+ "payments",
278
+ "WARN",
279
+ "Stripe webhook handler may skip signature verification",
280
+ "Verify the `stripe-signature` header using `stripe.webhooks.constructEvent()` on the raw request body.",
281
+ rel,
282
+ rule="SR-PAY-001",
283
+ )
284
+ )
285
+
286
+ # Supabase / Postgres SQL RLS check
287
+ if path.suffix.lower() == ".sql":
288
+ for m in CREATE_TABLE_RE.finditer(text):
289
+ tbl = re.sub(r'["`]', "", m.group(1)).lower().split(".")[-1]
290
+ tables_created[tbl] = (rel, _line(text, m.start()))
291
+ for m in ENABLE_RLS_RE.finditer(text):
292
+ tbl = re.sub(r'["`]', "", m.group(1)).lower().split(".")[-1]
293
+ tables_with_rls.add(tbl)
294
+ for m in CREATE_POLICY_RE.finditer(text):
295
+ stmt = m.group(1)
296
+ if POLICY_OPEN_TRUE_RE.search(stmt) and not POLICY_READONLY_RE.search(stmt) and not POLICY_SERVICE_ROLE_RE.search(stmt):
297
+ policy_name = re.match(r'\s*("[^"]+"|\S+)', stmt).group(1).strip('"`')
298
+ findings.append(
299
+ Finding(
300
+ "database",
301
+ "WARN",
302
+ f"Permissive write RLS policy `{policy_name}` uses USING/WITH CHECK (true)",
303
+ "Scope write policies (ALL/INSERT/UPDATE/DELETE) to auth.uid() or a verified role.",
304
+ rel,
305
+ rule="SR-SUPA-002",
306
+ line=_line(text, m.start()),
307
+ )
308
+ )
309
+
310
+ missing_rls = sorted(set(tables_created) - tables_with_rls)
311
+ for tbl in missing_rls:
312
+ findings.append(
313
+ Finding(
314
+ "database",
315
+ "WARN",
316
+ f"SQL table `{tbl}` has no ENABLE ROW LEVEL SECURITY statement",
317
+ "In Supabase, tables exposed in the public schema without RLS can be read or modified with the anon key.",
318
+ tables_created[tbl][0],
319
+ rule="SR-SUPA-001",
320
+ line=tables_created[tbl][1],
321
+ )
322
+ )
323
+
324
+ if public_secret_hits == 0 and hardcoded_hits == 0:
325
+ findings.append(Finding("secrets", "PASS", "No client-exposed secret env vars or hardcoded live keys found", str(repo_path)))
326
+ if unverified_webhooks == 0:
327
+ findings.append(Finding("payments", "PASS", "No unverified Stripe webhook handlers flagged", str(repo_path)))
328
+ if tables_created and not missing_rls:
329
+ findings.append(Finding("database", "PASS", f"All {len(tables_created)} SQL tables enable Row Level Security", str(repo_path)))
330
+
331
+ return findings
332
+
333
+
334
+ def _assert_public_host(url: str) -> str:
335
+ parsed = urllib.parse.urlparse(url)
336
+ if parsed.scheme not in {"http", "https"} or not parsed.hostname:
337
+ raise ValueError(f"Invalid HTTP(S) URL: {url}")
338
+ host = parsed.hostname
339
+ if host.lower() in {"localhost", "localhost.localdomain"}:
340
+ raise ValueError("Refusing to probe localhost/private addresses.")
341
+ try:
342
+ infos = socket.getaddrinfo(host, None)
343
+ except socket.gaierror as exc:
344
+ raise ValueError(f"Cannot resolve host {host}: {exc}") from exc
345
+ for info in infos:
346
+ ip = ipaddress.ip_address(info[4][0])
347
+ if ip.is_private or ip.is_loopback or ip.is_link_local or ip.is_reserved or ip.is_multicast:
348
+ raise ValueError(f"Refusing to probe non-public IP {ip} for host {host}.")
349
+ return url.rstrip("/")
350
+
351
+
352
+ def _fetch(url: str, headers: dict[str, str] | None = None, method: str = "GET") -> tuple[int, dict[str, str], str]:
353
+ req = urllib.request.Request(
354
+ url,
355
+ method=method,
356
+ headers={"User-Agent": "vibe-code-security-checklist/1.0", **(headers or {})},
357
+ )
358
+ try:
359
+ with urllib.request.urlopen(req, timeout=15) as resp:
360
+ body = resp.read(65536).decode("utf-8", "replace") if method == "GET" else ""
361
+ return resp.status, {k.lower(): v for k, v in resp.headers.items()}, body
362
+ except urllib.error.HTTPError as exc:
363
+ body = exc.read(4096).decode("utf-8", "replace") if method == "GET" else ""
364
+ return exc.code, {k.lower(): v for k, v in exc.headers.items()}, body
365
+
366
+
367
+ def check_url(url: str) -> list[Finding]:
368
+ findings: list[Finding] = []
369
+ try:
370
+ base = _assert_public_host(url)
371
+ except ValueError as exc:
372
+ return [Finding("url", "FAIL", "Invalid or non-public target URL", str(exc), url)]
373
+
374
+ try:
375
+ status, hdrs, _ = _fetch(base, method="GET")
376
+ except Exception as exc:
377
+ return [Finding("url", "FAIL", "Could not fetch target URL", str(exc), base)]
378
+
379
+ if status >= 400:
380
+ findings.append(Finding("headers", "WARN", f"Homepage returned HTTP {status}", "Verify the target URL.", base))
381
+
382
+ required = [
383
+ ("strict-transport-security", "HSTS missing", "Add Strict-Transport-Security: max-age=31536000; includeSubDomains.", "SR-WEB-002"),
384
+ ("content-security-policy", "CSP missing", "Add a Content-Security-Policy header to limit XSS and script injection.", "SR-WEB-001"),
385
+ ("x-content-type-options", "X-Content-Type-Options missing", "Set X-Content-Type-Options: nosniff.", "SR-WEB-004"),
386
+ ("referrer-policy", "Referrer-Policy missing", "Set Referrer-Policy: strict-origin-when-cross-origin.", "SR-WEB-005"),
387
+ ]
388
+ missing_count = 0
389
+ for key, title, detail, rule in required:
390
+ if key not in hdrs:
391
+ missing_count += 1
392
+ findings.append(Finding("headers", "WARN", title, detail, base, rule=rule))
393
+
394
+ has_frame_guard = "x-frame-options" in hdrs or "frame-ancestors" in hdrs.get("content-security-policy", "").lower()
395
+ if not has_frame_guard:
396
+ missing_count += 1
397
+ findings.append(Finding("headers", "WARN", "Clickjacking protection missing", "Set X-Frame-Options: DENY or CSP frame-ancestors.", base, rule="SR-WEB-003"))
398
+
399
+ if missing_count == 0:
400
+ findings.append(Finding("headers", "PASS", "Core security headers present", "HSTS, CSP, nosniff, referrer-policy, and framing protection found.", base))
401
+
402
+ # Non-destructive check for accidentally public dotfiles
403
+ exposed = []
404
+ for path, marker in [("/.env", "="), ("/.git/HEAD", "ref: refs/")]:
405
+ try:
406
+ code, c_hdrs, body = _fetch(base + path, method="GET")
407
+ ctype = c_hdrs.get("content-type", "")
408
+ if code == 200 and "text/html" not in ctype and marker in body:
409
+ exposed.append(path)
410
+ findings.append(Finding("exposure", "FAIL", f"Sensitive file exposed at {path}", "Block public access immediately and rotate any exposed credentials.", base + path, rule="SR-WEB-007"))
411
+ except Exception:
412
+ continue
413
+ if not exposed:
414
+ findings.append(Finding("exposure", "PASS", "No public /.env or /.git/HEAD exposure detected", base))
415
+
416
+ return findings
417
+
418
+
419
+ def check_supabase(supabase_url: str, anon_key: str) -> list[Finding]:
420
+ try:
421
+ base = _assert_public_host(supabase_url)
422
+ except ValueError as exc:
423
+ return [Finding("supabase", "FAIL", "Invalid Supabase URL", str(exc), supabase_url)]
424
+
425
+ endpoint = f"{base}/rest/v1/"
426
+ try:
427
+ status, _, body = _fetch(endpoint, headers={"apikey": anon_key, "Authorization": f"Bearer {anon_key}"})
428
+ except Exception as exc:
429
+ return [Finding("supabase", "FAIL", "Could not reach Supabase REST endpoint", str(exc), endpoint)]
430
+
431
+ if status != 200:
432
+ return [Finding("supabase", "PASS", f"Supabase REST schema endpoint returned HTTP {status}", "Anonymous OpenAPI schema listing is not publicly readable.", endpoint)]
433
+
434
+ try:
435
+ spec = json.loads(body)
436
+ paths = [p.lstrip("/") for p in spec.get("paths", {}) if p != "/" and not p.startswith("/rpc/")]
437
+ except Exception:
438
+ return [Finding("supabase", "WARN", "Supabase REST endpoint returned non-JSON 200", "Inspect manually.", endpoint)]
439
+
440
+ if paths:
441
+ preview = ", ".join(sorted(paths)[:15])
442
+ suffix = f" (+{len(paths) - 15} more)" if len(paths) > 15 else ""
443
+ return [
444
+ Finding(
445
+ "supabase",
446
+ "WARN",
447
+ f"{len(paths)} tables listed in public PostgREST schema",
448
+ f"Tables visible to anon key: {preview}{suffix}. Verify Row Level Security (RLS) policies on every table.",
449
+ endpoint,
450
+ rule="SR-SUPA-004",
451
+ )
452
+ ]
453
+ return [Finding("supabase", "PASS", "No tables exposed in public PostgREST schema", endpoint)]
454
+
455
+
456
+ def _severity(f: Finding) -> str:
457
+ """Rule severity; a rule-less FAIL is a scan error and counts as high."""
458
+ if f.rule:
459
+ return RULES[f.rule].severity
460
+ return "high" if f.severity == "FAIL" else ""
461
+
462
+
463
+ def _where(f: Finding) -> str:
464
+ return f"{f.location}:{f.line}" if f.line else f.location
465
+
466
+
467
+ def format_text(findings: list[Finding]) -> str:
468
+ out = []
469
+ for f in findings:
470
+ rid = f" {f.rule}" if f.rule else ""
471
+ loc = f" ({_where(f)})" if f.location else ""
472
+ out.append(f"[{f.severity:4s}] [{f.area}]{rid} {f.title}{loc}")
473
+ if f.detail:
474
+ out.append(f" {f.detail}")
475
+ hit = dict.fromkeys(f.rule for f in findings if f.rule)
476
+ if hit:
477
+ out += ["", "Rule docs:"] + [f" {rid} {RULES[rid].url}" for rid in hit] + ["", LOCKDOWN_LINE]
478
+ return "\n".join(out)
479
+
480
+
481
+ def _sarif_uri(f: Finding, base: Path | None) -> str:
482
+ if base is None or f.location.startswith(("http://", "https://")):
483
+ return f.location
484
+ rel = os.path.relpath(base / f.location) # relative to cwd, so the Action's paths match the checkout
485
+ return Path(rel).as_posix() if not rel.startswith("..") else (base / f.location).resolve().as_uri()
486
+
487
+
488
+ def format_sarif(findings: list[Finding], base: Path | None = None) -> str:
489
+ rule_ids = list(RULES)
490
+ results, notes = [], []
491
+ for f in findings:
492
+ if f.rule:
493
+ region = {"region": {"startLine": f.line}} if f.line else {}
494
+ results.append(
495
+ {
496
+ "ruleId": f.rule,
497
+ "ruleIndex": rule_ids.index(f.rule),
498
+ "level": SARIF_LEVEL[RULES[f.rule].severity],
499
+ "message": {"text": f"{f.title}. {f.detail}".strip()},
500
+ "locations": [{"physicalLocation": {"artifactLocation": {"uri": _sarif_uri(f, base)}, **region}}],
501
+ }
502
+ )
503
+ elif f.severity != "PASS":
504
+ notes.append({"level": "error" if f.severity == "FAIL" else "warning", "message": {"text": f"{f.title}: {f.detail} {f.location}".strip()}})
505
+ driver_rules = [
506
+ {
507
+ "id": r.id,
508
+ "name": r.slug,
509
+ "shortDescription": {"text": r.title},
510
+ "fullDescription": {"text": r.title},
511
+ "helpUri": r.url,
512
+ "help": {"text": f"{r.title}. Fix: {r.url}", "markdown": f"{r.title}. [How to fix]({r.url})"},
513
+ "defaultConfiguration": {"level": SARIF_LEVEL[r.severity]},
514
+ "properties": {"tags": ["security"], "security-severity": SECURITY_SEVERITY[r.severity]},
515
+ }
516
+ for r in RULES.values()
517
+ ]
518
+ sarif = {
519
+ "$schema": "https://json.schemastore.org/sarif-2.1.0.json",
520
+ "version": "2.1.0",
521
+ "runs": [
522
+ {
523
+ "tool": {
524
+ "driver": {
525
+ "name": "ShipReady",
526
+ "fullName": "ShipReady by Shipmate",
527
+ "version": __version__,
528
+ "semanticVersion": __version__,
529
+ "informationUri": RULES_BASE_URL,
530
+ "rules": driver_rules,
531
+ }
532
+ },
533
+ "invocations": [{"executionSuccessful": not any(n["level"] == "error" for n in notes), "toolExecutionNotifications": notes}],
534
+ "results": results,
535
+ }
536
+ ],
537
+ }
538
+ return json.dumps(sarif, indent=2)
539
+
540
+
541
+ def format_md(findings: list[Finding]) -> str:
542
+ issues = sorted((f for f in findings if f.rule), key=lambda f: -SEVERITY_RANK[_severity(f)])
543
+ errors = [f for f in findings if not f.rule and f.severity != "PASS"]
544
+ out = ["<!-- shipready -->", "## ShipReady by Shipmate", ""]
545
+ if issues:
546
+ counts = {s: sum(_severity(f) == s for f in issues) for s in ("high", "medium", "low")}
547
+ out.append(f"{len(issues)} findings: {counts['high']} high, {counts['medium']} medium, {counts['low']} low.")
548
+ out += ["", "| Severity | Rule | Finding | Location |", "|---|---|---|---|"]
549
+ for f in issues:
550
+ r = RULES[f.rule]
551
+ cells = [r.severity, f"[{r.id}]({r.url})", f.title, f"`{_where(f)}`"]
552
+ out.append("| " + " | ".join(c.replace("|", "\\|") for c in cells) + " |")
553
+ else:
554
+ out.append("No issues found.")
555
+ for f in errors:
556
+ out += ["", f"Could not complete a check: {f.title}. {f.detail}"]
557
+ if issues:
558
+ out += ["", LOCKDOWN_LINE]
559
+ return "\n".join(out)
560
+
561
+
562
+ def _output_args(p: argparse.ArgumentParser, top: bool) -> None:
563
+ # Subparser copies use SUPPRESS so they never overwrite a value given before the subcommand.
564
+ default = None if top else argparse.SUPPRESS
565
+ p.add_argument("--format", choices=["text", "json", "sarif", "md"], default=default, help="Output format (default text).")
566
+ p.add_argument("--fail-on", choices=["high", "medium", "low", "none"], default=default, help="Exit 1 when a finding is at or above this severity (default high).")
567
+ p.add_argument("--json", action="store_true", default=False if top else argparse.SUPPRESS, help="Same as --format json.")
568
+
569
+
570
+ def main(argv: list[str] | None = None) -> int:
571
+ parser = argparse.ArgumentParser(prog="shipready", description="ShipReady by Shipmate: pre-launch security checker for AI-built web apps.")
572
+ parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
573
+ parser.add_argument("--repo", type=Path, help="Local repository path to scan statically.")
574
+ parser.add_argument("--url", help="Public HTTPS URL to check headers and dotfile exposure (read-only).")
575
+ parser.add_argument("--supabase-url", help="Supabase project URL (https://<ref>.supabase.co) for read-only schema check.")
576
+ parser.add_argument("--anon-key", help="Supabase anon key (used with --supabase-url).")
577
+ parser.add_argument("--dump-rules", action="store_true", help="Print the rule registry as JSON (the source of rules.json).")
578
+ _output_args(parser, top=True)
579
+ sub = parser.add_subparsers(dest="cmd")
580
+ p_check = sub.add_parser("check", help="Scan a local repository.")
581
+ p_check.add_argument("path", type=Path, nargs="?", default=Path("."))
582
+ _output_args(p_check, top=False)
583
+ p_url = sub.add_parser("url", help="Check headers and dotfile exposure of a site you run (read-only).")
584
+ p_url.add_argument("target")
585
+ _output_args(p_url, top=False)
586
+ args = parser.parse_args(argv)
587
+
588
+ if args.dump_rules:
589
+ sys.stdout.write(rules_json())
590
+ return 0
591
+ if args.cmd == "check":
592
+ args.repo = args.path
593
+ elif args.cmd == "url":
594
+ args.url = args.target
595
+
596
+ if not args.repo and not args.url and not args.supabase_url:
597
+ parser.print_help()
598
+ return 2
599
+
600
+ findings: list[Finding] = []
601
+ if args.repo:
602
+ findings.extend(check_repo(args.repo))
603
+ if args.url:
604
+ findings.extend(check_url(args.url))
605
+ if args.supabase_url:
606
+ if not args.anon_key:
607
+ print("Error: --anon-key is required with --supabase-url", file=sys.stderr)
608
+ return 2
609
+ findings.extend(check_supabase(args.supabase_url, args.anon_key))
610
+
611
+ fmt = args.format or ("json" if args.json else "text")
612
+ if fmt == "json":
613
+ print(json.dumps([asdict(f) for f in findings], indent=2))
614
+ elif fmt == "sarif":
615
+ print(format_sarif(findings, args.repo))
616
+ elif fmt == "md":
617
+ print(format_md(findings))
618
+ else:
619
+ print(format_text(findings))
620
+
621
+ fail_on = args.fail_on or "high"
622
+ if fail_on == "none":
623
+ return 0
624
+ return 1 if any(SEVERITY_RANK.get(_severity(f), 0) >= SEVERITY_RANK[fail_on] for f in findings) else 0
625
+
626
+
627
+ if __name__ == "__main__":
628
+ raise SystemExit(main())
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ // Launcher: runs the bundled check.py with the system Python 3.10+, passing args and exit code through.
3
+ "use strict";
4
+ const { spawnSync } = require("child_process");
5
+ const path = require("path");
6
+
7
+ const checkPy = path.join(__dirname, "..", "check.py");
8
+ const versionOk = "import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)";
9
+ const python = ["python3", "python"].find(
10
+ (cmd) => spawnSync(cmd, ["-c", versionOk], { stdio: "ignore" }).status === 0
11
+ );
12
+
13
+ if (!python) {
14
+ console.error("shipready needs Python 3.10 or newer on PATH (python3 or python). Install it from https://www.python.org/downloads/ and run again.");
15
+ process.exit(2);
16
+ }
17
+
18
+ const run = spawnSync(python, [checkPy, ...process.argv.slice(2)], { stdio: "inherit" });
19
+ if (run.error) {
20
+ console.error(`shipready could not start ${python}: ${run.error.message}`);
21
+ process.exit(2);
22
+ }
23
+ process.exit(run.status === null ? 1 : run.status);
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "@shipmate-agency/shipready",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.1",
4
+ "description": "ShipReady by Shipmate: zero-dependency pre-launch security check for Next.js, Supabase and Stripe apps.",
5
+ "bin": {
6
+ "shipready": "npm/shipready.js"
7
+ },
8
+ "files": [
9
+ "check.py",
10
+ "npm/shipready.js",
11
+ "rules.json"
12
+ ],
13
+ "engines": {
14
+ "node": ">=16"
15
+ },
16
+ "keywords": ["security", "supabase", "stripe", "nextjs", "lovable", "cursor", "bolt", "sarif", "cli"],
17
+ "homepage": "https://shipmate.agency",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/Shipmate-agency/shipready.git"
21
+ },
22
+ "bugs": "https://github.com/Shipmate-agency/shipready/issues",
23
+ "author": "Dmitry (Dee) Kargaev <hi@deeflect.com>",
24
+ "license": "MIT"
25
+ }
package/rules.json ADDED
@@ -0,0 +1,100 @@
1
+ [
2
+ {
3
+ "id": "SR-SUPA-001",
4
+ "slug": "supabase-missing-rls",
5
+ "severity": "medium",
6
+ "title": "SQL table created without Row Level Security",
7
+ "url": "https://shipmate.agency/rules/supabase-missing-rls/"
8
+ },
9
+ {
10
+ "id": "SR-SUPA-002",
11
+ "slug": "supabase-policy-using-true",
12
+ "severity": "medium",
13
+ "title": "Write policy allows everyone with USING (true)",
14
+ "url": "https://shipmate.agency/rules/supabase-policy-using-true/"
15
+ },
16
+ {
17
+ "id": "SR-SUPA-003",
18
+ "slug": "supabase-service-role-key-exposed",
19
+ "severity": "high",
20
+ "title": "Supabase service_role key in source code",
21
+ "url": "https://shipmate.agency/rules/supabase-service-role-key-exposed/"
22
+ },
23
+ {
24
+ "id": "SR-SUPA-004",
25
+ "slug": "supabase-public-schema-exposed",
26
+ "severity": "medium",
27
+ "title": "Tables listed to the anon key in the public schema",
28
+ "url": "https://shipmate.agency/rules/supabase-public-schema-exposed/"
29
+ },
30
+ {
31
+ "id": "SR-SEC-001",
32
+ "slug": "secret-in-public-env-var",
33
+ "severity": "high",
34
+ "title": "Server secret in a client-exposed env var",
35
+ "url": "https://shipmate.agency/rules/secret-in-public-env-var/"
36
+ },
37
+ {
38
+ "id": "SR-SEC-002",
39
+ "slug": "hardcoded-api-key",
40
+ "severity": "high",
41
+ "title": "API key or private key hardcoded in source",
42
+ "url": "https://shipmate.agency/rules/hardcoded-api-key/"
43
+ },
44
+ {
45
+ "id": "SR-SEC-003",
46
+ "slug": "env-file-not-gitignored",
47
+ "severity": "medium",
48
+ "title": "Env file present and not in .gitignore",
49
+ "url": "https://shipmate.agency/rules/env-file-not-gitignored/"
50
+ },
51
+ {
52
+ "id": "SR-PAY-001",
53
+ "slug": "stripe-webhook-no-signature-check",
54
+ "severity": "medium",
55
+ "title": "Stripe webhook handler without signature check",
56
+ "url": "https://shipmate.agency/rules/stripe-webhook-no-signature-check/"
57
+ },
58
+ {
59
+ "id": "SR-WEB-001",
60
+ "slug": "missing-csp",
61
+ "severity": "medium",
62
+ "title": "Content-Security-Policy header missing",
63
+ "url": "https://shipmate.agency/rules/missing-csp/"
64
+ },
65
+ {
66
+ "id": "SR-WEB-002",
67
+ "slug": "missing-hsts",
68
+ "severity": "medium",
69
+ "title": "Strict-Transport-Security header missing",
70
+ "url": "https://shipmate.agency/rules/missing-hsts/"
71
+ },
72
+ {
73
+ "id": "SR-WEB-003",
74
+ "slug": "missing-x-frame-options",
75
+ "severity": "low",
76
+ "title": "Clickjacking protection missing",
77
+ "url": "https://shipmate.agency/rules/missing-x-frame-options/"
78
+ },
79
+ {
80
+ "id": "SR-WEB-004",
81
+ "slug": "missing-nosniff",
82
+ "severity": "low",
83
+ "title": "X-Content-Type-Options: nosniff missing",
84
+ "url": "https://shipmate.agency/rules/missing-nosniff/"
85
+ },
86
+ {
87
+ "id": "SR-WEB-005",
88
+ "slug": "missing-referrer-policy",
89
+ "severity": "low",
90
+ "title": "Referrer-Policy header missing",
91
+ "url": "https://shipmate.agency/rules/missing-referrer-policy/"
92
+ },
93
+ {
94
+ "id": "SR-WEB-007",
95
+ "slug": "exposed-dotfile",
96
+ "severity": "high",
97
+ "title": "Env or git file served publicly",
98
+ "url": "https://shipmate.agency/rules/exposed-dotfile/"
99
+ }
100
+ ]