security(#297): lock down dashboard/API — auth, 127.0.0.1 bind, CSRF, OAuth state, CSP#307
Draft
nolanmak wants to merge 2 commits into
Draft
security(#297): lock down dashboard/API — auth, 127.0.0.1 bind, CSRF, OAuth state, CSP#307nolanmak wants to merge 2 commits into
nolanmak wants to merge 2 commits into
Conversation
…e + CSP Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…t login/callbacks/webhook) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #297.
Locks down the unauthenticated Node dashboard (the critical finding).
127.0.0.1by default on both entrypoints (index.ts,dashboard-server.ts);AUGMENTAGENT_BIND_HOSToverride.requireAuthmiddleware:Authorization: Bearer/x-api-keyfor machines, HMAC-signedHttpOnly; SameSite=Strictsession cookie for the UI (/login). Local mode is now fail-closed — a key is generated, persisted to the DBconfigtable, and logged once on first run (no more no-op).Hostagainst an allow-list and rejects cross-origin state-changing requests via Origin/Referer.statenow random per-flow + validated on callback (was hardcodedaugmentagent).X-Frame-Options/nosniff/frame-ancestors 'none'.New file
src/security.ts; edits toindex.ts,dashboard-server.ts,apiV1.ts.Verification:
npm install+npx tsc --noEmitpass (exit 0). Type-checked only; no runtime test run.Reviewer note / caveat: UI-router auth currently leans on the app-level Host/Origin guard plus the existing
/api/repos*guards; consider adding a one-linerouter.use(requireAuth)near the top ofdashboard.ts(after/loginmounts) for token-level auth on every UI route. TLS/reverse-proxy for split mode is config-knob only, not enforced.🤖 swarm-authored, human-review-required (draft).