🤖 Generated by the Daily AI Engineer
Summary
Bind KSail-managed EKS lifecycle state to an immutable AWS account and cluster identity before destructive delete/start/stop/update actions.
Motivation
The exact guard introduced while delivering #6087 corroborates the resolved name, region, and eksctl-created marker, and requires matching local KSail config or persisted EKS/AWS state. Those signals are still replayable across AWS accounts:
- Create or manage
demo through KSail in AWS account A.
- Leave the local
eks.yaml or ~/.ksail/clusters/demo/spec.json in place.
- Switch the configured credentials to account B, where another operator has an eksctl-created
demo in the same region.
- A lifecycle command can match the stale local name plus the generic
EksctlCreated=True result and target the account-B cluster.
Name, region, and generic eksctl provenance establish target intent, but do not prove that the current live cluster is the instance KSail created. Delete and nodegroup scaling make that identity gap destructive.
Proposed Solution
- Record the AWS account ID and immutable EKS cluster ARN or equivalent instance identity after KSail creates the cluster.
- Resolve the current caller identity through the same credential-isolated AWS configuration used by the lifecycle operation.
- Before every destructive EKS lifecycle action, compare current account and live cluster identity with persisted ownership state and fail closed on absence, parse errors, or mismatch.
- Define an explicit, non-destructive migration/rebind flow for legacy state rather than silently trusting name-only records.
- Keep custom AWS credential environment mappings isolated from the parent process.
Acceptance Criteria
Alternatives Considered
Treating a matching local config or name-only state as authorization is sufficient for #6087 routing, but cannot distinguish stale state from the original live cluster. EKS or eksctl generic tags have the same collision problem unless KSail writes and persists a unique marker.
Additional Context
Follow-up to #6087 and draft PR #6201.
🤖 Generated by the Daily AI Engineer
Summary
Bind KSail-managed EKS lifecycle state to an immutable AWS account and cluster identity before destructive delete/start/stop/update actions.
Motivation
The exact guard introduced while delivering #6087 corroborates the resolved name, region, and eksctl-created marker, and requires matching local KSail config or persisted EKS/AWS state. Those signals are still replayable across AWS accounts:
demothrough KSail in AWS account A.eks.yamlor~/.ksail/clusters/demo/spec.jsonin place.demoin the same region.EksctlCreated=Trueresult and target the account-B cluster.Name, region, and generic eksctl provenance establish target intent, but do not prove that the current live cluster is the instance KSail created. Delete and nodegroup scaling make that identity gap destructive.
Proposed Solution
Acceptance Criteria
Alternatives Considered
Treating a matching local config or name-only state as authorization is sufficient for #6087 routing, but cannot distinguish stale state from the original live cluster. EKS or eksctl generic tags have the same collision problem unless KSail writes and persists a unique marker.
Additional Context
Follow-up to #6087 and draft PR #6201.