Repository navigation
fix: move ops secret store under its data dir and declare its mask - #34296
JLargent42 wants to merge 1 commit into
Conversation
Sensitive Change ReviewSensitive files changed:
|
Sensitive change reviewHead: 5385b02
|
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Only one string changes: the retention note. The blind reader read the new wording correctly ("sure") and it fits on one line in both themes. Notes
[UX-REVIEWED] 75876c6 Description read[DESCRIPTION-READ] 4315d2bbaab406e825b040ae0a00d4ab807f0672f10a9923631796c270706b2a That sha256 names everything this verdict read: the PR description, plus the 7 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Every item traces to owner ruling 3 on #26967 or to the risk of losing or exposing tokens on upgrade. One gap in the framing is a note below. Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: let Ops Mission Control's provider tokens live in the app's own data directory, masked by its own declaration, without losing existing tokens. FIX, serving the app's move out of core.
[FIRST-PRINCIPLES-REVIEWED] 75876c6 Description read[DESCRIPTION-READ] e610a68c023ac8e147bd99ed24cbe023c23f5450650ac1aae7dc546a16a66d19 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the store keeps its bytes when it moves, a failed move refuses the write instead of hiding the old tokens, and rendered evidence is attached. Notes
[DESIGN-REVIEWED] 75876c6 Description read[DESCRIPTION-READ] 6a7fb304d84fcb02c08c90974854f1758a347b9981c41865f8ba08693697965a 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 |
5385b02 to
1543414
Compare
Sensitive change reviewHead: 1543414
|
Opus 5.5 Review — 🔴 changes requested (blocking)Reviewed Blocks merge: the token store now sits in a directory the agent can rename, so on the Linux namespace sandbox every saved provider token can be read from the next session. It also adds a new core path row naming the app, plus a matching exemption in a list that may only shrink. BLOCKING — src/kiro_crew/apps/builtins/ops_mission_control/backend/secrets.py:129 BLOCKING — src/kiro_crew/security/paths_lists.py:608 [BLOCK-MERGE] 75876c6 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/apps/builtins/ops_mission_control/backend/routes.py:529 -- Secret-store migration performs durability flushes on the event loop
[BLOCK-MERGE] 75876c6 Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1: UPHOLD (autosde-blocking-rule)
False positive or not applicable? A repository writer can comment: |
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: The stricter rule is in the path gate and sandbox mask tables. None of the three shell checks reads those tables: TIGHTENING: The keystone read+write floor ADJUDICATED: 21 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: I wrote rows for posix, windows and any.
UNADJUDICATED:
[SCOPE-REVIEWED] 75876c6 |
1543414 to
75876c6
Compare
Sensitive change reviewHead: 75876c6
|
|
AI review dispositions for 1543414, addressed in 75876c6:
|
|
Held, per the security findings on 75876c6, until two seam PRs land: #34339 (credentialMasks parents pinned against rename on the Linux namespace backend) and #34346 (built-in credentialMasks on the agent tool gate, so this PR drops its app-named tool-gate row and its KNOWN_NAME_REFERENCES entry). This PR will be rebased onto them and pushed once. |
Code change approver recommendation: A person should decideAutomated, not a person, and not a review: a maintainer still decides.
Why: the decider flagged 2 possible problems (p_defect 0.9); a person should check them. The migration design is careful: the copy is byte for byte and fsynced, a failed move refuses the save, and an existing new store wins. But the head breaks CI in two places, both caused by this PR. (1) The rewritten test_config_routes imports Things to check (the decider's concerns; it is right less than half the time):
If this recommendation is wrong, reply here; the replies are how the approver is evaluated. |
|
Layout note from the #26967 campaign, so this PR and the external repo agree on where the Ops Mission Control provider tokens live. The external repo ( If both land as they stand, an install that ran this wheel copy and then adopts the repo copy finds neither
On the tool gate: a shipped built-in's |
Problem / Motivation
Goal: Ops Mission Control's provider-token store moves into the app's own data directory and is masked by the app's
credentialMasksdeclaration, so the core no longer carries its hard-coded rows, and an existing install keeps its tokens.Owner ruling 3 on #26967 approved app-declared credential masks as the replacement for the hard-coded
ops_mission_control_secrets.jsonrows in the sandbox tables. #32652 added the seam but could not use it here: a declaration may only name files under the app's own data directory, and the store sat at the data-home root (<data home>/ops_mission_control_secrets.json). Dropping the rows before moving the store would have left the PagerDuty / Datadog tokens unmasked.Why it matters
Until the store moves, the core keeps app-specific credential rows, which blocks Ops Mission Control from leaving the repository whole (#26967). Moving it carelessly risks the worst outcome for a credential store: lost tokens on upgrade (the operator has to mint new ones at the provider) or tokens that are briefly unmasked.
Not a goal
credentialMasksdeclarations into the agent tool gate. The seam is documented as tightening-only and read by nothing but the sandbox; this PR keeps an explicit tool-gate row instead.ops_mission_control_policy.json). It is a READONLY ceiling, not a credential, andcredentialMasksonly hides files.What changed (motivation → approach → change)
Symptom → cause → change:
backend/secrets.py):secrets_path()is nowapps/ops-mission-control/data/secrets.json. Writes still stage in the data home's maskedauth-store-stagingdirectory, never beside the file:publish_through_auth_store_staginggainshome=(the staging home when the target is deeper than the root) andfsync=.KeystoneFileBackend._migrate_legacy): at gateway startup (register_routes→migrate_legacy_store, before the loop serves anything, fail-open like the registry warm-up) and before the first save or revoke (both already off the loop), under the new store's lock and then the old store's lock, the root file is copied byte for byte, published with fsync, its directory synced, and only then is the root file removed. A store already at the new path wins and a root file next to it (restored backup) is left in place. A lookup never moves the store (the provider catalog reads it on the event loop); until the move succeeds it reads the root file where it is. A save or revoke whose move fails refuses, so it never starts a fresh store that would hide the old one's tokens. Corrupt content is moved as is, not dropped.app.jsongets"credentialMasks": ["secrets.json"]._hidden_leaves()/_hardlink_refused_leaves()add every declared leaf). The root name is kept as a retired leaf, treated exactly asbrowser-cookies.txtis: insandbox_leaves._CREW_HIDDEN_LEAVESit moves to the retired block, and it stays insandbox_aliases._CREW_HARDLINK_REFUSED_LEAVES, because a restored hard-linked backup of the root file is still live tokens (review finding on the first head).security/paths_lists._CREW_SECRET_LEAVESnow namesapps/ops-mission-control/data/secrets.json, which keeps the agent's file tools off it, and the derived.lock/.tmpartifact fence covers the data dir. The root name stays fenced as a retired leaf for the same restored-backup reason asbrowser-cookies.txt. The other option, dropping the row, would leave the moved store readable to the agent's file tools wherever the sandbox is off.ops-mission-control.md("Repository boundary", contract 4, the data layout),app-kit-platform.md§37 "Built-ins",security.mdstaging paragraph.Backwards compatibility
Compatible: an existing install's root store is moved on first access with its bytes unchanged; every reader goes through
secrets_path()/ the backend.Reader: src/kiro_crew/apps/builtins/ops_mission_control/backend/secrets.py:KeystoneFileBackend._read -- app -- reads the new path, or the root file until it is moved, without moving it (test_a_lookup_reads_the_old_store_without_moving_it)
Reader: src/kiro_crew/apps/builtins/ops_mission_control/backend/routes.py:register_routes -- app -- moves the root store at startup (test_registering_the_routes_moves_the_store, test_a_secret_store_move_fault_does_not_break_startup)
Reader: src/kiro_crew/apps/builtins/ops_mission_control/backend/secrets.py:KeystoneFileBackend.put -- app -- migrates (refusing on failure) before the locked read-modify-write (test_a_save_keeps_every_token_already_stored, test_a_failed_move_keeps_the_old_store_and_refuses_the_save)
Reader: src/kiro_crew/sandbox_leaves.py:_CREW_HIDDEN_LEAVES -- chat|cron|subagent -- the root name stays masked as a retired leaf; the new path is masked via credentialMasks (test_sandbox_governance_mask.py MASKED)
Reader: src/kiro_crew/sandbox_aliases.py:_hardlink_refused_leaves -- chat|cron|subagent -- includes the declared leaf (test_the_manifest_declares_the_store_a_credential_mask)
Reader: src/kiro_crew/security/paths_lists.py:_CREW_SECRET_LEAVES -- chat|subagent -- fences both names and the new .lock (test_agent_file_tools_cannot_touch_it)
Tests
test_security.py:TestTheRootStoreMovesToTheDataDirectory(byte-for-byte move at startup,register_routesmoves it, a lookup reads the root store without moving it, save keeps old tokens, corrupt store moved not dropped, existing new store wins, failed move refuses the save and keeps the old file, staging only in the masked dir); keystone tests now pin the manifest declaration, the hard-link set and the tool gate for the new path.test_sandbox_governance_mask.py: the moved store is masked in every mode on Linux and denied read/write/link on Seatbelt, as the root store was.test_config_routes.py: retention boundary rewritten for the new layout (declared, fenced, default uninstall keeps data).test_app_credential_masks.py: pins the shipped built-in declarations; other cases isolate from them.Proof: PROVEN test_sandbox_governance_mask.py::TestSecretsAreMaskedInEveryMode[apps/ops-mission-control/data/secrets.json-*] (18 cases), test_config_routes.py::TestManifestCrons::test_secrets_live_in_the_masked_data_dir_that_uninstall_keeps, test_security.py (collection error on main: no APP_NAME / legacy path) (head 75876c6)
Local: ~11.9k tests across every
test/test_sandbox*,test/test_security*,test/test_app_credential*,test/test_app_backend*, the decoupling gate and all ops-mission-control tests at-n 2; the only failure istest_the_seatbelt_profile_is_the_golden, which fails identically on main on this host (path-regex escaping of the runner's tmp path). Frontend:src/apps/ops-mission-controlvitest 398/398, eslint,i18n:checkwithI18N_BASE_REF=origin/mainall PASS.Manual verification
Rendered the Settings PagerDuty card with a stored credential on main and on this branch (static build of a local capture page, Playwright), dark and light. Below.
Screenshots / video
Before (main), dark:
After (this branch), dark:
Light theme
Related Issues
Fixes #32681
Part of #26967
Sibling sweep
Swept: git grep -nE "ops_mission_control_secrets|SECRETS_FILENAME|outside the app's folder" -- src test docs website
Sibling: src/kiro_crew/apps/builtins/ops_mission_control/tests/test_notify_out.py -- changed here
Sibling: src/kiro_crew/apps/builtins/ops_mission_control/tests/test_slack_out.py -- changed here
Sibling: website/src/i18n/locales/en.json -- changed here
Sibling: src/kiro_crew/apps/builtins/ops_mission_control/backend/policy_store.py -- not affected -- a READONLY ceiling, not a credential the mask seam covers
Pattern harvest
Not generalizable: a one-off relocation of the only core-named app credential store onto the app-declared mask seam.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.