Rotate the connection key
Each installation connects to Alien with its own deployment-scoped connection key. After first registration, the operator stores that key on its identity volume; the Kubernetes credentials Secret's sync-token or the ECS Secrets Manager secret's syncToken may still hold the original one-time registration token. During rotation, the replacement key is written to that Secret, then the operator validates and stores it on the identity volume. Rotation changes only the connection key. The installation keeps its deployment identity, encryption key, and identity storage. On Kubernetes, it also keeps the collector token.
Before you start
- You must be a workspace administrator. Other roles cannot view, prepare, cancel, or download a rotation.
- The installation must be registered through Kubernetes manual setup or ECS CloudFormation setup, and it must be running a build that supports rotation.
- Rotate on its own. Do not combine it with an image, plugin, permission, or CRD change.
The downloaded credential patch or JSON value, including a rollback download, contains a live connection key. Keep these files in a private directory outside version control and synced or shared folders, restrict them to your user with chmod 600, and remove them after the rotation completes or the rollback has been applied. Do not commit or share them.
How a rotation completes
A rotation has three states:
| State | What it means |
|---|---|
| Prepared | Alien created a replacement key. The old key stays valid until the operator sends a heartbeat with the replacement. The replacement expires 24 hours after it is prepared. |
| Completed | Alien received a heartbeat with the replacement and revoked the old key. A completed rotation cannot bring back the old key. |
| Cancelled | You cancelled a prepared rotation. Alien revoked the replacement. If the operator already stored it, apply the rollback value to put the current key back. |
Each rotation has a revision number. The operator ignores credentials with an older revision than the one it has.
Kubernetes
Open the installation on the setup page. After it registers, the Install and verify step shows Rotate this installation’s connection key.
- Under Installed release ownership, select Dedicated Remote Operator release or Product release with embedded Remote Operator. Take this from your installation records. The release name alone does not tell them apart.
- Confirm the target:
- For a dedicated release, select the checkbox that confirms the release, namespace, and Kubernetes context.
- For a product release, enter the Installed chart reference from the saved install command or deployment record, the Installed chart version from
helm history, and the Installed credentials Secret fromhelm get values. The Secret name isremoteOperator.existingSecret.name.helm historydoes not retain the repository or OCI source; if the reference was not recorded, recover it from the deployment configuration or package record before continuing. Select the Credentials Secret owner: Setup flow or Terraform. Then select the checkbox.
- Select Prepare replacement key.
- Select Download credential patch. The browser saves
operator-credential-patch.yaml, which contains only the newsync-token:
stringData:
sync-token: "<replacement key>"- Copy Apply this credential revision and run it from the directory that contains the patch file. For a dedicated release, run it from the directory that also contains the
remote-operatorchart.
For a Secret owned by the setup flow, the command:
- Checks the target. The release must be deployed, its values must point at the Secret, the Secret must hold exactly
collector-token,encryption-key, andsync-token, and the SHA-256 ofencryption-keymust matchremoteOperator.existingSecret.encryptionKeySha256. - Stops unless the patch file contains exactly one non-empty
stringData.sync-token. - Patches only
sync-tokenin the Secret withkubectl patch secret --type merge. - Runs
helm upgrade --reuse-values --set remoteOperator.syncTokenRevision=<revision> --atomic --wait --timeout 5mso the operator restarts with the new key.
For a Secret owned by Terraform, the command writes the key and revision to .alien-remote-operator.auto.tfvars.json as remote_operator_sync_token and remote_operator_sync_token_revision. It then runs terraform plan and applies the plan only if it updates nothing except kubernetes_secret_v1.remote_operator_credentials and helm_release.runtime. Run it in the exact module and workspace that installed the release. In a Git checkout, the tfvars file must be ignored by Git, or the command stops.
When the operator reports the replacement, the status changes to Replacement active. Run a read-only diagnostic to confirm operations still work.
Amazon ECS
Open the installation on the setup page. Under Manage the ECS installation, find Rotate the deployment-scoped connection key.
- Select the checkbox that confirms the account, Region, stack, and cluster from the installed stack outputs.
- Select Prepare replacement key.
- Select Download credential value. The browser saves
remote-operator-credential-rotation.jsonwithsyncToken,revision, and, for a prepared rotation,expiresAt. - Copy Apply rotation and run it from the directory that contains that file.
The command:
- Checks that the file's revision matches the rotation. For a prepared rotation, it also checks the expiry and that the replacement has not expired.
- Checks the AWS account and the stack outputs
AccountId,Region,EnvironmentName, andClusterArn. - Writes a new version of the registration secret with the new
syncTokenand the sameencryptionKey. - Creates a CloudFormation change set that changes only the
RegistrationSecretVersionIdparameter, executes it, and waits for the stack update. ECS replaces the task. - Waits until the ECS service is stable.
If another stack update wins, the command stops. Wait for that update to finish, then rerun the same command to reconcile the secret and stack. When safe, the command moves the secret's current stage back to the version pinned by the stack.
If the rotation is interrupted
- If the apply command stops after it changed the Secret or secret version, run the same command again. Do not prepare another revision.
- If the replacement expired or you need to stop, select Cancel pending rotation. Then select Download rollback patch (Kubernetes) or Download rollback value (ECS), and run the apply command again with that file. It puts the current key back.
- Do not delete the identity volume, the credentials Secret, or the registration secret to recover.
Security
A practical review of permissions, secrets, connections, and data leaving the customer environment.
Upgrade and roll back
Change an installed operator's image, operations, or permissions, go back to the previous version, recover a stuck Helm release, or remove the operator from a product release.