Skip to content

Commit 7679a61

Browse files
committed
Phase 20 part 1: security review and release checklist (self-review, no new features)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UBL2N1CcnAWZVRkTYV5oB
1 parent c2219bd commit 7679a61

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

‎docs/RELEASE_CHECKLIST.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Release checklist
2+
3+
Mark each item only when it has actually been done. "Written" is not "tested".
4+
5+
## Automated (run on every push; CI is green on `c2219bd`)
6+
- [x] `pnpm lint`, `pnpm typecheck`, `pnpm test`, `pnpm build`
7+
- [x] Migrations applied to the Supabase project and a live RLS test run per module
8+
- [x] Security advisors reviewed
9+
10+
## Owner actions (cannot be done from the development sandbox)
11+
- [ ] Set `GEMINI_API_KEY` or `OPENROUTER_API_KEY` in Vercel (the assistant and coach have never made a real AI call)
12+
- [ ] Strava: callback domain `kkingg-ai.vercel.app`; regenerate the secret and revoke the pasted tokens
13+
- [ ] Revoke the GitHub token pasted earlier
14+
- [ ] Supabase Auth: Site URL and redirect URLs; consider disabling public sign-up; enable leaked-password protection
15+
- [ ] Create an Expo account and token for an Android APK (`eas build --profile preview`)
16+
- [ ] Download the Windows installer from the Desktop workflow run's artifact and install it
17+
18+
## Manual smoke test, signed in (never done yet)
19+
- [ ] Sign up or sign in on https://kkingg-ai.vercel.app
20+
- [ ] Create a task, goal, habit and reminder; reload and confirm they persist
21+
- [ ] Add a journal entry and an important date
22+
- [ ] Add a venture and a ledger entry
23+
- [ ] Add a news feed (a real RSS URL) and refresh it
24+
- [ ] Import a PGN and a GPX file
25+
- [ ] Two accounts: create a chess game, join by link, play a few moves, resign
26+
- [ ] Confirm the notifications job fires (hourly) and an item appears
27+
- [ ] Mobile app: sign in on a device or emulator
28+
- [ ] Desktop app: launch, confirm it loads the site
29+
30+
## Release
31+
- [ ] Update `DEVELOPMENT_STATUS.md` with what was actually observed
32+
- [ ] Tag `v0.1.0` only after the smoke test above passes

‎docs/SECURITY_REVIEW.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Security review (Phase 20, first pass, 2026-11-17)
2+
3+
This is a self-review by the developer (Claude) of what was checked and what was not. It is not an independent audit or a penetration test.
4+
5+
## Checked (evidence in this session)
6+
7+
| Check | Result |
8+
| --- | --- |
9+
| Row-level security on every public table (live query) | 50 tables, 0 without RLS, 0 without at least one policy |
10+
| Service-role key in code | Not referenced in any source file. `.env.example` lists an empty `SUPABASE_SERVICE_ROLE_KEY=` placeholder only; the app uses the publishable key plus the signed-in user's session |
11+
| Secrets committed | Pattern scan (OpenAI-style, GitHub tokens, Google keys, JWTs, `client_secret = "..."`) over tracked files found nothing. Only `.env.example` files are tracked |
12+
| Public (client-visible) env vars | Only `NEXT_PUBLIC_SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` and the Expo equivalents |
13+
| Server-only env vars | `STRAVA_CLIENT_ID` and `STRAVA_CLIENT_SECRET` are read only in server code; AI provider keys are read only in `@kkingg/ai` on the server (no key is currently set) |
14+
| Per-feature cross-user tests | Live, rolled-back RLS tests for every module (see TESTING.md), each with an outsider and an anonymous user |
15+
| Supabase security advisors | Only accepted warnings: workspace helper functions and the `mp_*` game RPCs are SECURITY DEFINER and executable by signed-in users on purpose; leaked-password protection is disabled |
16+
| Outbound fetching (news feeds) | Guarded server-side: HTTPS only, private and loopback addresses blocked, with unit tests (mocked DNS and fetch) |
17+
| Multiplayer chess | Writes only through SECURITY DEFINER RPCs that check participation, turn and ply; invite codes are 32 hex characters and are cleared on join |
18+
19+
## Known gaps and decisions for the owner
20+
21+
1. **Hard-delete policies exist on 13 early tables** (workspaces, workspace_members, tasks, goals, projects, events, milestones, task_completions, reminders, habits, habit_logs, idea_backlog, strava_connections). Later modules have no DELETE policy and use soft delete. Decide whether the early tables should move to soft delete too; I have not changed them.
22+
2. **Leaked-password protection is off** (Supabase Auth dashboard setting; cannot be set from here).
23+
3. **Public sign-up is still enabled.** For a private system, consider disabling it in the Supabase Auth settings once your account exists.
24+
4. **Auth Site URL and redirect URLs** must be set to `https://kkingg-ai.vercel.app`.
25+
5. **Revoke the GitHub token and the Strava secret/tokens that were pasted into the chat earlier**, then issue new ones. Neither was written to the repo or memory.
26+
6. **Multiplayer chess does not enforce chess rules in the database** (cheating by direct API call is detected by clients, not prevented).
27+
7. **No rate limiting** on server actions, sign-in, feed fetches or game creation (only a 20-open-games cap per user).
28+
8. **Desktop installers are unsigned**, so Windows SmartScreen will warn.
29+
30+
## Not checked
31+
32+
- No signed-in browser session has exercised any page, so UI-level access control (module gating, redirects) is verified by code and build only.
33+
- No dependency vulnerability audit was run in this pass.
34+
- No review of Vercel project settings (preview protection, env scoping) beyond what was configured earlier.
35+
- Mobile app and desktop shell have never run on a real device.

0 commit comments

Comments
 (0)