Repository navigation
fix(cloud): make two AWS pre-flight rows name the real cause - #19960
Conversation
df07c23 to
5607a02
Compare
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 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 (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Before merge, confirm on a real macOS install that AWS's What this change shipsInventory (9 items) — 9 justifiedIntent: a user setting up a Remote Crew gets told the real cause, and the fix, when the credentials row or the plugin row fails on a GUI-launched gateway. FIX.
[FIRST-PRINCIPLES-REVIEWED] 0647b7a Description read[DESCRIPTION-READ] 5d24a40e0d1d50a0b3cb33d0c442ce839e3938141eb425e5ee7bcc0ea0b6ee3f That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check whether a "reinstall from AWS first" sentence is enough warning before a [DESIGN-REVIEWED] 0647b7a Description read[DESCRIPTION-READ] 1cdb90601444534314c96c6850c1f60837e96212a53d9574e5484fb75a95d256 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 |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The no-fix plugin refusal ends at "Fix the file's ownership or permissions" with no way to do it, and both plugin variants paste the backend's raw reason mid-sentence. Watch
Suggestions
[UX-REVIEWED] 0647b7a Description read[DESCRIPTION-READ] 97fdc6456491eac28b6476393692e5cd1d0e37c104b9b7450f3fb190214a4c67 That sha256 names everything this verdict read: the PR description, plus the 9 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 |
5607a02 to
3289fc1
Compare
|
Folded into the single commit (head 3289fc1):
Not changed: naming the AWS config file in the credentials sentence, and more guidance for the no-command refusal. Both are advisory, and each needs a catalog string change in all 12 languages, so they are left for a follow-up. |
3289fc1 to
34eb80d
Compare
|
Folded into the single commit (head 34eb80d), answering the GPT 6.1
|
|
Notes on the advisory UX and First Principles concerns on 34eb80d (no code change in this reply):
|
bolichen97
left a comment
There was a problem hiding this comment.
Readiness sweep: full diff read, PR Readiness success on this head, no live change requests.
Sensitive change review
Rule changed: none in acceptance. deploy/engine.py resolve_aws_tool_bin now delegates to resolve_aws_tool_bin_with_refusals, which runs the identical walk (same PATH-first lookup, same validate_provider_executable, same _REFUSED_AWS_BIN_DIRS add/discard) and only additionally returns this walk's refused (path, reason) pairs. Before->after: refused plugin reported as 'not installed' + install command -> reported as 'found at X but refused: reason' + (only when the realpath is under /usr/local/sessionmanagerplugin and some component is owned by a uid that is neither root nor the gateway euid) a displayed-but-never-executed 'sudo chown -R root:<wheel|root> /usr/local/sessionmanagerplugin'. Worst case if wrong: user is advised to root-own AWS's plugin tree so the provenance check then accepts a binary that a third account had placed; limited to AWS's own fixed package prefix, and requires the user's own sudo. Evidence checked: whole diff incl. engine.py refactor (return values only, delegating wrapper keeps signature/result), ssm._plugin_ownership_remedy chain check, handler never calls install command for a refused plugin, tests in test_deploy_web_engine/test_cloud_ssm/test_cloud_handlers/test_cloud_iam; the credential_process regex only extracts a bare name from stderr and adds no execution. No secret exposure: detail was already returned (truncated 300). Undo: revert the squash commit.
Undo: revert the squash commit.
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at 34eb80d. The proposed privileged remedy can leave the actual refusal unchanged. session_manager_plugin_refusal selects an ownership remedy without passing the refusal reason. The helper then decides only from the package path's owners. But root-gateway execution is refused before ownership checks. An ownership change cannot clear that refusal. Offer a remedy only for the matching, actionable refusal category. Keep the trust validator intact and test unrelated root/strict-policy refusals. Also link the accepted CLI-row and translated-copy follow-ups. The packaged-macOS verification question still needs evidence. Credential and executable-trust changes require human review. No ownership command, AWS operation or tests were executed locally. — crew-pr-reviewer (r99)
|
Thanks. Your 09:26 review on 34eb80d is addressed on 0673078. That is a second commit on top, with no force-push.
No copy changed in this commit, so no translations moved. CI: the Frontend Tests (2) failure on 0673078 came from main ( |
5014bfc to
0647b7a
Compare
|
@iamwhatever your r101 hold on
Local checks on this head:
Your r99 change request on |
|
|
|
|
|
|
Notes on the two PASS punchlines on
The four UX items and the GPT 6.1 finding on this head each have their own disposition, deferred to #20239, #20389, #20390 and #20563. |
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and readiness passed at 0647b7a; no behavior change.
|
HOLD at 0647b7a. Reserved for human review: this changes executable-trust and credential diagnostics ( The r101 items are addressed. The plugin row now links AWS's install page under "reinstall it from AWS first", each failed row draws one icon, and every current-head UX and GPT 6.1 item has its own disposition. The chown remedy is still offered only for the third-account ownership refusal inside AWS's package prefix (ssm.py L296-L329). #20239, #20389 and #20390 are linked in the description and match their items. CI is green. Still open:
Auto-merge is armed. Our r99 change request (on 34eb80d) is what blocks it today. The existing approval says "no behavior change", which does not describe this diff, so it should not stand in for the security review. — crew-pr-reviewer (r103) |
|
Follow-ups now lists #20563 for the "Ask the agent" finding. The maintainer review of the credential and executable-trust change and the packaged-macOS check stay with a maintainer. |
|
Still holding at 0647b7a for a maintainer: this changes executable-trust and credential diagnostics ( The last open author item from r103 is done: #20563 is now on the Follow-ups line, and #20238, #20239, #20389, #20390 and #20563 are all open and match their deferred items. Every current-head AI item has a disposition. What is left is for a maintainer:
Auto-merge is armed. The current approval says "no behavior change", which does not describe this diff, so it should not count as that security review. Our earlier r99 change request on 34eb80d is still the active review decision; its asks are met, and it is the only thing stopping auto-merge today. Reviewed head: 0647b7a — crew-pr-reviewer (r104) |
Problem / Motivation
Goal: The Remote Crew set-up pre-flight tells the user what is actually wrong when the AWS credentials row or the Session Manager plugin row fails on a GUI-launched gateway, and what to do about it.
Two rows of the "Before you start - your AWS setup" pre-flight report a failure the user cannot act on:
[Errno 2] No such file or directory: '<name>'when the profile'scredential_processruns a helper by bare name and that helper is not on the gateway's PATH (a Dock/Finder launch hands the gateway a minimal PATH). Nothing says the missing file is the profile's credential helper, or that giving it a full path fixes it.Why it matters
A user whose profile works in a terminal is stopped at the first step of setting up a Remote Crew with an error that points nowhere, and a user with an installed plugin is sent round a reinstall loop. Both rows need to say what is wrong and what fixes it.
Not a goal
What changed (motivation → approach → change)
Symptom: two pre-flight rows that report the wrong cause. Cause: the backend returned only the raw CLI error for the credentials row, and only a boolean for the plugin, so a refused candidate and an absent one looked the same.
deploy/engine.py:resolve_aws_tool_bin_with_refusals(name)runs the same walk asresolve_aws_tool_bin(which now delegates to it) and also returns the candidates THIS walk refused, each with the provenance check's own reason. Same search order, same validation, same refused-set updates; the list is read from the walk, not from the shared set, so a candidate deleted since an earlier walk is not reported.cloud/ssm.py:session_manager_plugin_refusal()returns the first refused candidate (path, reason, remedy) when no plugin was accepted, elseNone. The remedy is a copyablesudo chown -R root:<group> /usr/local/sessionmanagerpluginonly when the provenance check's refusal is its third-account ownership refusal ("owned by another user (uid N)"), the candidate resolves inside AWS's package prefix, and some component there is owned by an account that is neither root nor the gateway user; otherwise it is empty. A root gateway, the strict policy and permission refusals are not cleared by a root-owned tree, so they get the reason alone. The trust check itself is unchanged.cloud/iam.py:reachability_checkdetects a bare program name in the CLI's[Errno 2] No such file or directory: '<name>'and returns it ascredential_helper_missing, with a note namingcredential_processand the full-path fix. A name with a path separator is not matched, because it was never looked up on PATH.handlers_cloud.py:GET /api/cloud/preflightaddssession_manager_plugin_refused_path/_reason; for a refused pluginsession_manager_plugin_commandcarries the remedy (or "") instead of the install command.RemoteCrewPanel.tsx: the credentials row leads with the localized helper sentence and puts the CLI's own error under it as a smaller monospace line (ErrorNotice's existingtitle+messagePlacement="below", so the hand-off still carries the CLI's words); the plugin row shows "Found at , but Kiro Crew will not run it: " with the fix command when one is known. Both failure diagnostics, and the credentials row's other CLI failures, render throughErrorNoticewith the agent hand-off (a newfailureslot on the row) instead of muted status text; "Not installed" stays status text. The row's own warning circle is its one triangle:ErrorNoticegains ashowIconopt-out (on by default, so every other notice is unchanged) for a notice nested in such a row. Four new catalog keys in all 12 languages, pseudolocale regenerated, translator context added.kirocrew cloud doctorprints the same refusal and remedy.kirocrew cloud doctorand the guide ask the user to reinstall the plugin from AWS first unless they installed it from AWS themselves. Making the tree root-owned makes whatever binary is in it an accepted receiver of AWS credentials, and the third account that owns the tree could have replaced that binary. The plugin row links AWS's Session Manager plugin install page under that sentence: the same page the guide and the gateway's not-installed message link.remote-crew-on-ec2.md: a short troubleshooting entry for both rows.Alternatives considered and not taken:
Backwards compatibility
Compatible: the pre-flight response gains three fields and
reachability_checkgains one key; every existing field keeps its meaning, except thatsession_manager_plugin_commandfor a refused plugin is the fix rather than an install command that cannot fix it.Removes nothing: no field, key, function or accepted input is removed or renamed;
resolve_aws_tool_binkeeps its signature and result.Tests
test_deploy_web_engine.py: the resolver reports this walk's refusals with their reason (and still returns a later accepted candidate); a refused pair left in the shared set for a removed file is not reported.test_cloud_ssm.py: a refused plugin reports its path and reason; an absent or accepted plugin has no refusal; AWS's package tree owned by a third account gets the chown remedy; a trusted tree or a file outside the prefix gets none; a root-gateway, strict-policy, permission or unreadable-hierarchy refusal gets none even when the tree is third-account owned, with the root-gateway, strict and third-account cases driven through the real provenance check so its wording and the remedy's category cannot drift apart.test_cloud_iam.py: an ENOENT for a bare helper setscredential_helper_missingand a note namingcredential_process; an absolute path does not; both quote styles parse.test_cloud_handlers.py: the pre-flight route returns the refusal and its remedy and never asks for the install command for a refused plugin.test_cloud_cli.py: the doctor prints "found at ... but refused" with the fix, not "not found", and asks for an AWS reinstall before the command.RemoteCrewPanel.test.tsx: the plugin row renders the refusal, the reinstall-from-AWS sentence before the fix command, a link to AWS's install page (href, new tab), and the fix command, and not "Not installed"; the credentials row names the helper andcredential_process, with the CLI's error as a separate monospace line; each failure renders in an alert carrying the "Ask the agent" hand-off, and each failed row draws exactly one warning triangle.ErrorNotice.showIcon.test.tsx: both variants draw the triangle by default;showIcon={false}drops it and keepsrole="alert".Red without the fix: reverting the source files leaves 14 of the new backend tests and the new frontend tests failing (reverting only the last round's dashboard change fails 4: both
showIconcases and both row tests); removing only the refusal-category guard leaves the 7 non-ownership refusal tests failing. Locally green: the five backend test files (250 passed), the wider cloud/deploy suites (416 passed), every website test file that rendersRemoteCrewPanelorErrorNotice(139 files, 5,058 passed), the i18n vitest suite againstorigin/main(776 passed),npm run i18n:check, typecheck, eslint, flake8, isort, mypy on the touched modules, the black gate, the comment-history gate, docs lint and the fast-gate scripts.Manual verification
Rendered against the built SPA with fixture answers (
website/scripts/capture-aws-preflight-honest.mjs, which asserts each claim before it writes a frame). Not exercised against a real macOS install of AWS's package; no Mac with that package is available here. The evidence for the third-account state is a user's report of a stock install refused as "owned by another user (uid 1501)". The command is offered only when the check on the user's own machine reports that same refusal and the tree's owners show it. The opt-in macOS test suite did not run on this pull request; the unit tests above ran on Linux.Screenshots / video
Credentials row, helper not on the gateway's PATH:
Plugin installed but refused, with the known fix:
Plugin refused, no known command:
Other themes
Related Issues
Part of a reported Remote Crew pre-flight gap: this covers the two misleading messages. Whether the AWS child should search more install directories is a separate decision and is not changed here.
Follow-ups: #20238 (the AWS CLI row reports a found but declined CLI as missing), #20239 (two wording changes that need fresh translations), #20389 (the refusal reason stays English in every locale), #20390 (say where the ownership command runs, that it asks for the administrator password, and that it changes only the plugin folder) and #20563 ("Ask the agent" drops an unsaved subnet or Identity Center entry).
Closes #20545 (link AWS's install page from the "reinstall it from AWS first" step), which this pull request now does.
Pattern harvest
Rule candidate: review-prompt
Pattern: a probe that collapses "found but refused by a check" into "not installed", so the remedy it offers cannot fix the state it reports.
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; see the Licensing section of CONTRIBUTING.md.