Repository navigation
fix: reconcile vault grants across cloud updates - #932
Conversation
|
@greptile review Please review the update paths, setup authority checks, saved-state retry behavior, and GCP preservation of other vaults' conditional grants. CI is deferred until review findings are addressed; regression tests are being validated in an isolated Linux sandbox. |
|
@greptileai please review Please review the current head, 48d3572. The original handlers now fail nine sandbox regressions; validation of the fixed handlers is running. This push corrects only the new GCP test fixture's optional condition title. CI remains deferred until review findings are addressed. |
|
|
@greptileai please review the current head. Both findings are addressed: the fixture title now uses New executor regressions cover matching saved dependencies and checkpoints without the revision field. All 15 preceding vault regressions passed in the Linux sandbox; the expanded suite is running now. CI remains deferred until review findings are resolved. |
|
@greptileai please review the current head, 1d1eca4. The empty-profile finding is fixed and has a create/update regression. Permission-only scheduling now covers AWS as well as Azure and GCP. GCP preserves other vault namespaces and shared unconditional roles, and retries can adopt an already-committed policy without writing again. The new grant revision defaults to None on older checkpoints and is recorded only after successful reconciliation. The preceding expanded vault suite passed all 19 tests. The final full infrastructure unit suite is running in the Linux sandbox. CI remains deferred until review findings are resolved. |
|
@greptileai please review the latest commit. All 947 infrastructure unit tests pass in an isolated Linux sandbox (one existing test ignored). All review findings have been addressed and resolved, including permission-only scheduling and empty GCP grant profiles. Please update the confidence score for the latest head. |
|
@greptileai please review the latest head. The delayed findings on legacy empty-profile cleanup and order-sensitive retries are now fixed. The strengthened regression tests fail against the old behavior (6 passed, 2 failed) and the final full-suite rerun is underway. Existing unknown grant history requires project metadata; new or known-empty profiles remain supported. Binding and member order no longer cause redundant IAM writes. |
|
@greptileai please review the latest head. This is an empty commit to trigger GitHub CI after addressing review findings first. Its code tree is identical to ecd16e6, which received 5/5. Sandbox validation passed all 947 infrastructure unit tests, with one existing ignored test; all review threads are resolved. |
…-cloud-vault-updates-wt
…ss concurrent writers AWS: a vault reconcile now deletes its own inline policies (alien-<vault>-vault-* on service-account roles, alien-mgmt-<vault>-vault-* on the management role) that the desired stack no longer grants, before it records permissionsRevision. Only exact registered names are removed; NotFound counts as removed, AccessDenied fails with a setup-required message, and a lost delete response resumes cleanly. GCP: a stale etag on the project IAM write (409) re-reads and re-merges in the same state for up to 5 attempts instead of failing the step. The management identity's reconcile now leaves bindings conditioned on a vault namespace in this stack to the vault controllers, so its update can no longer strip a vault's conditional grants after the vault recorded its revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-updates' into alon/alien-1305-cross-cloud-vault-updates-wt
|
@greptileai review |
…e bindings [skip ci] Vault custom role IDs come from grant labels, so the permission-set prefix never matched them and a dropped vault/data-write left both its namespace-scoped custom-role binding and its unconditional secretmanager.secrets.create binding on the management identity. The vault now names its custom roles exactly, removes stale namespace bindings to them, and drops the member from a shared unconditional vault role only when no vault grant in the desired stack still produces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@greptileai review |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Container workload roles trusted only the retained legacy node identity, so nodes using the isolation identity could not vend credentials and workloads failed at startup. Trust both exact stack-scoped node role ARNs while retaining the account condition and caller-side AssumeRole requirement. Privileged setup reconciles older workload-role checkpoints; runtime authority rejects saved trust/policy write states before IAM access. Live AWS reproduction: old trust allows legacy nodes but denies isolated nodes. The candidate allows both node identities for newly created roles and for a preexisting legacy role repaired through the actual controller. An unrelated same-account node remains denied despite having its own caller-side AssumeRole grant. Every task-owned role is deleted and absence verified. Three focused tests also pass. Legacy checkpoint validation deserializes the older JSON without the new optional field and converges through the existing controller states. Full generated Terraform and CloudFormation compute renders pass terraform fmt/validate and cfn-lint. Full workload startup on isolated nodes is not yet exercised end to end; the STS role-chaining proof above covers the trust change itself. After merging main: the vault permission-update fixtures added by #932 now record the applied default trust policy, so ready roles are not scheduled for legacy trust repair (including the runner-owned role in the ignored live vault test). `alien-infra` service_account (15) and vault (31) tests and all `alien-cloudformation` tests pass. Refs ALIEN-1316, ALIEN-1314 **New controller state variants:** `AwsServiceAccountState::UpdatingStackPermissions` and `UpdatingResourcePermissions`. Updates go `UpdateStart -> UpdatingStackPermissions -> UpdatingResourcePermissions -> Ready`, report `Updating`, and fail into `UpdateFailed`, so a failed policy write can't put a live role into `CreateFailed`, where the executor would replace it. Only privileged setup writes these states. Older binaries can't read them, so a checkpoint that stopped mid-update needs this version to resume. Create states are unchanged. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Existing vaults could miss newly added grants during updates. Azure and GCP update handlers now reconcile their grants before reporting success. AWS, Azure, and GCP vaults also detect permission-only changes, so setup schedules reconciliation even when resource config and dependencies are unchanged.
Each controller records the resolved-grant revision only after success and stops scheduling updates once it converges. Setup authority checks remain in place. GCP reconciliation preserves other vaults' conditional grants and shared unconditional bindings. Retries compare binding and member sets, so a lost response can adopt a committed policy even if another writer reorders it. New and known-empty GCP profiles can skip namespace IAM work without project metadata; legacy checkpoints with unknown grant history must have metadata before setup can report cleanup success.
State compatibility: adds one optional
permissionsRevisionfield to the three vault controllers withserde(default). Older checkpoints load without it; direct setup reconciles them once. Importers initialize it toNone. No state variants are added or renamed.Validation:
cargo test -p alien-infra --all-features --libpassed in an isolated Linux sandbox: 947 passed, 0 failed, 1 existing test ignored. Regressions cover new consumers, permission-only changes, convergence, legacy checkpoints, missing saved identifiers, setup handoff, Live resources, empty GCP profiles, unrelated vault grants, and serialized retry after a lost response. Fail-then-pass validation: disabling permission-change scheduling caused all three cloud regressions to fail; restoring it passed all three. The legacy cleanup and reordered-policy retry regressions also failed against the old behavior and passed with the fixes. All Greptile review threads are resolved. Greptile scored the final commit 5/5 after findings were addressed before CI. GitHub CI passed: Rust crates, every-package/target checks, worker integration, and PR conventions. Cloud E2E selected no deployment jobs for this change.Closes ALIEN-1305
Live AWS validation: added an opt-in controller integration test. Reading the synthetic SecureString is denied before the permission-only update, then succeeds after the real executor reconciles IAM. Reading another namespace and reading from an unrelated role remain denied. All fixture roles and parameters are deleted and their absence verified. Disabling permission-change detection makes the same cloud test fail; restoring the candidate passes again. This validates AWS vault reconciliation, not full workload startup. Live Azure and GCP validation remains pending.