Repository navigation
fix(apps): require the dashboard owner to enable an app - #14948
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the release PR's changelog names the breaking 403 for non-owner dashboard callers of enable, since the writer sweep covered in-tree callers only. [DESIGN-REVIEWED] 165c3e3 Description read[DESCRIPTION-READ] 83f2e6bf9b05f5503e4ad9ab2d67613514ac3a5aae752a50beea5df0a846a72f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The new gate deadens the consent-branch owner check at Not justified as shipped
What this change shipsInventory (6 items) — 5 justifiedIntent: stop a signed-in non-owner dashboard user from enabling (and thereby starting) an app the owner disabled — a FIX.
[FIRST-PRINCIPLES-REVIEWED] 165c3e3 Description read[DESCRIPTION-READ] 4d1f8cfd0c220746697cddbf66776af99e9359ba6901d03f6c08728cfa31d6e4 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNo findings that block; one advisory below. FINDING — src/kiro_crew/apps/routes.py:1936 — the new gate at :1910 runs the identical [OPUS-REVIEWED] 165c3e3 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
Disposition: rebutted (span=dad9cf90636a, the consent gate is now redundant with the new enable gate).
|
|
Disposition: rebutted (span=63305eadfce3, the inner consent gate can no longer deny).
|
|
Disposition: fixed (span=2fd62d7a9875, two hook tests passed on an AttributeError).
|
UX Review (Fable 5) — ⏭️ skippedRevision |
|
Disposition: rebutted (span=964b43bc928c, the retained consent gate can no longer deny).
|
|
Disposition: rebutted (span=63305eadfce3, the inner consent gate can no longer deny).
|
POST /api/apps/{name}/enable refused app tokens but let any other
dashboard subject re-enable an app, which registers its agents, skills,
MCP servers and crons, starts its backend and runs onEnable. Gate it with
require_owner_dashboard_request, the same call disable and uninstall use.
Existing enable tests now act as the owner, and a new test pins the
non-owner refusal.
The enable hook wiring reads broadcast_ws from the dashboard state. The owner test state had none, so two hook tests passed on an AttributeError instead of on the hook they drive. Put the attribute on the shared helper state.
ea4fecc to
165c3e3
Compare
|
Disposition: rebutted (span=81fccdf51ff5, the retained consent gate can no longer deny).
|
|
Disposition: rebutted (span=63305eadfce3, the inner consent gate can no longer deny).
|
…0.8.0 Backport of #14658, #14652, #14650, #14775, #14656, #14900, #14898, #14894, #14891, #14948, #15046, #15332, #15333, #15331 to release/0.8.0, cherry-picked in main's merge order. * fix(dashboard): owner-gate the host-file reader routes (#14658) (cherry picked from commit 778b51a) * fix(auto-improvement): owner-gate the routes that drive agents or publish (#14652) (cherry picked from commit 59f0d89) * fix(dashboard): owner-gate POST /api/memory/enable-embeddings (#14650) (cherry picked from commit bd2a9c0) * fix(dashboard): owner-gate GET /api/file-search (#14775) (cherry picked from commit a0b9de6) * fix(apps): owner-gate app install, update and registry-write routes (#14656) (cherry picked from commit 4f5cb65) * fix(meetings): owner-only meeting write routes (#14900) (cherry picked from commit 6b9a56c) * fix(auto-improvement): owner-gate forget, purge, stop, session links and PR status (#14898) (cherry picked from commit ee051d9) * fix(apps): require the dashboard owner for app register, uninstall, disable (#14894) (cherry picked from commit 42894c3) * fix(dashboard): require the owner for cron job update, run, enable and delete (#14891) (cherry picked from commit ccb78e6) * fix(apps): require the dashboard owner to enable an app (#14948) (cherry picked from commit 41de374) * fix(dashboard): let an app token manage only its own cron jobs (#15046) (cherry picked from commit 95a78b1) * fix(issue-radar): owner gate on every forge-write route (#15332) (cherry picked from commit 4b6ab60) * fix(ops-mission-control): owner-gate provider secret save and revoke (#15333) (cherry picked from commit e5f61b2) * fix(meetings): owner-gate dictionary add and remove (#15331) (cherry picked from commit e5ba84e) Co-authored-by: Joe Guo <zejiangg@amazon.com> Co-authored-by: zejiangg <zejiangg@amazon.com>
…0.8.0 (#15621) Backport of #14658, #14652, #14650, #14775, #14656, #14900, #14898, #14894, #14891, #14948, #15046, #15332, #15333, #15331 to release/0.8.0, cherry-picked in main's merge order. * fix(dashboard): owner-gate the host-file reader routes (#14658) (cherry picked from commit 778b51a) * fix(auto-improvement): owner-gate the routes that drive agents or publish (#14652) (cherry picked from commit 59f0d89) * fix(dashboard): owner-gate POST /api/memory/enable-embeddings (#14650) (cherry picked from commit bd2a9c0) * fix(dashboard): owner-gate GET /api/file-search (#14775) (cherry picked from commit a0b9de6) * fix(apps): owner-gate app install, update and registry-write routes (#14656) (cherry picked from commit 4f5cb65) * fix(meetings): owner-only meeting write routes (#14900) (cherry picked from commit 6b9a56c) * fix(auto-improvement): owner-gate forget, purge, stop, session links and PR status (#14898) (cherry picked from commit ee051d9) * fix(apps): require the dashboard owner for app register, uninstall, disable (#14894) (cherry picked from commit 42894c3) * fix(dashboard): require the owner for cron job update, run, enable and delete (#14891) (cherry picked from commit ccb78e6) * fix(apps): require the dashboard owner to enable an app (#14948) (cherry picked from commit 41de374) * fix(dashboard): let an app token manage only its own cron jobs (#15046) (cherry picked from commit 95a78b1) * fix(issue-radar): owner gate on every forge-write route (#15332) (cherry picked from commit 4b6ab60) * fix(ops-mission-control): owner-gate provider secret save and revoke (#15333) (cherry picked from commit e5f61b2) * fix(meetings): owner-gate dictionary add and remove (#15331) (cherry picked from commit e5ba84e) Co-authored-by: Joe Guo <zejiang.guo@gmail.com> Co-authored-by: Joe Guo <zejiangg@amazon.com>
Problem / Motivation
Goal: Only the dashboard owner can enable an app.
POST /api/apps/{name}/enable(handle_enable_appinsrc/kiro_crew/apps/routes.py) refused app tokens. It checked the owner only when the body carriedsessionApprovalConsent. So a signed-in dashboard user who is not the owner could turn an owner-disabled app back on.Why it matters
Enable is not a flag flip. It registers the app's agents, skills, MCP servers and crons. It starts the app's backend. It runs the app's
onEnablescript. A channel user who may chat should not be able to start that code. Disable and uninstall in the same file already require the owner.Not a goal
app_token_forbiddencode.POST /api/apps/{name}/open,POST /api/apps/{name}/devandDELETE /api/apps/{name}/migrate-cleanupare not touched.What changed (motivation → approach → change)
Enable skipped the owner check that disable runs. It read the app and the body before it checked who was calling.
The handler now calls
require_owner_dashboard_request(request, "app_enable")right after the app-token refusal. This is the same call disable uses. It runs before the app lookup and before the body is read. A non-owner gets 403owner_only, and the gate writes the denial to the audit log.Every real caller still works. The dashboard Library, the Mochi and crew-companion pages, and
kirocrew app enableall send the owner's credential. The CLI sends the same credential for enable and disable, and disable is already gated.Backwards compatibility
Breaking: a non-owner dashboard subject calling enable now gets 403 instead of enabling the app. Writer sweep on origin/main @ 3b0f4ad:
website/src/api/client/apps.ts,website/src/apps/mochi/api.ts,website/src/apps/crew-companion/constants.tsandsrc/kiro_crew/app_lifecycle_client.pyall send the owner's credential. No other in-tree code calls the route.Tests
test/test_apps_routes_coverage.py::TestEnableRefusesAppTokens::test_non_owner_dashboard_user_cannot_enableis new. A non-owner posts enable with no consent body. It asserts 403owner_only, no backend start, noonEnable, and the app still disabled. It fails with 200 when the gate is removed.test_app_execution.py,test_apps_routes_coverage.py,test_enable_deps_resolution.py,test_lifecycle_hooks.py.test_apps_routes_coverage.pyalso setbroadcast_wson the test state. They used to run with no state at all. The owner gate needs a state, and the hook wiring then readsbroadcast_wsfrom it.test_enable_does_not_re_register_after_the_backend_startsnow asserts the 200 status. Without it, a refused enable would pass the test without testing anything.Manual verification
N/A. Unit coverage is enough because the route is exercised through the real route table with the real gate.
Related Issues
N/A
Pattern harvest
Not generalizable: this is the same missing-owner-gate shape the earlier rounds fixed in this file, and the fix reuses the shared gate.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)