Repository navigation
Self-host updates never wait on the deploy role or its boundary - #519
Merged
Merged
Conversation
… as installed, checked before running, newer permissions applied separately by an admin, stuck rollbacks finished
…rces, the preflight fails closed, recovery compares whole roles against verified templates only
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.
Summary
A self-hosted update is never held back by a change to the deploy role or its permissions boundary again, and an install never stays stuck after such a change.
Root cause of v0.8.54-beta.20261108 "needs an AWS admin": the parent template's
BoundaryandDeployBoundarychanged (PRs #511 and #516: Airflow, ECS and ECR reads,iam:Simulate*, the log analyzer's tag; the sts wildcard collapse rewrote two more statements). Every update runs as the deploy role, which the boundary forbids to change itself or a boundary, so the updater held the whole release for an AWS admin. That admin path could never work: the stack's service role is the deploy role, so CloudFormation runs a console Execute as that role too. On the live install it was denied (iam:DeletePolicyVersionon the boundary,iam:CreatePolicyVersionon the deploy boundary), the rollback was denied the same way, and the stack endedUPDATE_ROLLBACK_FAILED.Changes
Boundary,DeployBoundaryandDeployRolecome frominfra/lib/native/access-pinned.json, byte for byte what v0.8.36 to v0.8.53 shipped. So the first release with this change installs on every install from v0.8.36 on through its current (older) updater, with no admin step, and brings the new updater with it.keep_for,held_template). The helper's newstage_heldwrites that template toreleases/<v>/held/coderhelm.jsonfrom the verified release (sha256 checked), only those three replaced, same type, no conditions. The updater checks the helper's canonical sha against its own and against what CloudFormation fetched. The updater role may create change sets from that path only.infra/test/iam-eval.ts). A call that would be refused, or a change to the role or a boundary, deletes the change set and ends the update as "couldn't start", naming the call and the rule. It is never offered for a console Execute. An update an older updater left waiting "for an AWS admin" ends the same way.access.json, pinned by sha256 inReleaseAssetsand in the native tarball. It is a quick-create stackcoderhelm-<name>-accesswith no service role. Its writer (lambda/native-access, inline, namedCoderHelmAccess-<name>so no install role can invoke, pass or edit it) writes a new default version of each boundary and the deploy role'sdeploypolicy, only where they differ. On delete it does nothing. The boundary already reserves the stack's name (TheAccessStackStays).native.access(cached 5 minutes) holdspendingorapplied, plain-words lines ("adds read access to Airflow, ECR and ECS (...)"), and the one quick-create link with the install's parameters.native.recoveryreports a stuck rollback.pending.heldandpending.preflightare new fields.UPDATE_ROLLBACK_FAILEDthe updater reads which resources failed in the last rollback. For each one it compares the live IAM document (the managed policy's default version, the role's inline policies) with the rollback target's verified template. If all match, it runsContinueUpdateRollbackskipping exactly those. Otherwise it skips nothing, emails once and shows what differs. Tries are capped at 3. Proposing while the stack is stuck or busy is refused with a reason.boundary_refusal,PENDING_PERMISSION_FIX).infra/test/native-access.test.tsfails when today's boundary or deploy policy changes (ACCESS_DOCS) or the pinned file changes, with the reason. It also checks that every call in the simulator's deploy table is still allowed under the pinned boundary, so a held update can't fail on it, and that no install role reaches the access stack or its writer. cfn-lint now coversaccess.json.updates.md(Permissions, A rollback that stopped, the state table),security.md.Verification
python3 -m unittest discover -s lambda/tests: 397 tests OK. Newtest_updater_access.py:iam:CreatePolicyVersionandiam:DeletePolicyVersiondenied byTheBoundaryStays, the change set is deleted, and nothing executes or is offered;stageonly);applied;infra:npm test154 passed, 0 failed. cfn-lint 1.58.0 is clean on the builtcoderhelm.json,access.jsonand every part. The built parent's Boundary, DeployBoundary and DeployRole are equal to the published v0.8.53-beta.20261107's.services:cargo fmt --checkpasses,cargo clippy -p common --all-targets -D warningsis clean, andcargo test -p common --lib live::passed 237.infra/scripts/deploy-role-sim.py --nativeneeds AWS credentials and the owner's OK. No policy it simulates changed (deploy role, boundary and helper are unchanged), and its fixture tests pass.