RouterOS credentials onto the two-slot pattern: terraform user, rollback backup password; retire rotate-password #147

Open
opened 2026-11-17 21:54:07 +00:00 by ginjiruu · 0 comments
Owner

Move the hand-rotated RouterOS credentials onto the two-slot pattern of routeros/modules/monitoring (ADR-0011, layer 1), and retire the imperative rotation tasks.

Today

Credential Where Rotation today
terraform REST user (<DEV>_PASSWORD) bootstrap creates it; OpenBao secret/routeros-secrets; ESO into routeros-<dev>-env (provider ROS_PASSWORD, the rollback scripts, the peer's ROLLBACK_PEER_PASSWORD) task routeros:rotate-password (imperative, device first, then OpenBao, then force-sync, one device at a time; 401 window for the device and its peer)
<DEV>_ROLLBACK_BACKUP_PASSWORD OpenBao; runner env vault kv patch + force-sync, by hand, while not armed
admin bootstrap only bench re-bootstrap
PPPoE ISP not ours to rotate

Target

  1. terraform user → two slots terraform-a / terraform-b (group terraform, same policy set). The root rotates the slot the provider is not logged in with, writes OpenBao first, sends the router what OpenBao holds, then publishes routeros/<dev>/terraform/active. The runner's ROS_PASSWORD/user come from the active slot (ESO template, as in mktxp-credentials). The provider can never lose its own login mid-apply, because the slot it uses is never the one being rotated. Open points:
    • The bootstrap creates only terraform-a; the first apply adds terraform-b. The guard and protected set need an exception for this module, with the same reasoning as modules/monitoring.
    • The peer check (ROLLBACK_PEER_PASSWORD) must read the peer's active slot.
    • rotate-password.sh and task routeros:rotate-sim are deleted once this is live.
  2. Rollback backup password → per arm, never stored. It is only used inside one armed apply. arm.sh can generate it and keep it in the disabled ppp secret it already uses, and the judge deletes it. No OpenBao key, no env var, nothing to rotate.
  3. admin: stays the bootstrap's break-glass credential. Decide whether it gets the same two slots or stays manual.

Verify each step with the sim (CHR + dev OpenBao) like the monitoring module: first apply, re-plan, a period flip, partial failure, and the provider's own login across a flip.

Refs ADR-0011, #139 (modules/monitoring), #68 (secrets and state), #74 (rollback fuse).

Move the hand-rotated RouterOS credentials onto the two-slot pattern of `routeros/modules/monitoring` (ADR-0011, layer 1), and retire the imperative rotation tasks. ## Today | Credential | Where | Rotation today | |---|---|---| | `terraform` REST user (`<DEV>_PASSWORD`) | bootstrap creates it; OpenBao `secret/routeros-secrets`; ESO into `routeros-<dev>-env` (provider `ROS_PASSWORD`, the rollback scripts, the peer's `ROLLBACK_PEER_PASSWORD`) | `task routeros:rotate-password` (imperative, device first, then OpenBao, then force-sync, one device at a time; 401 window for the device and its peer) | | `<DEV>_ROLLBACK_BACKUP_PASSWORD` | OpenBao; runner env | `vault kv patch` + force-sync, by hand, while not armed | | `admin` | bootstrap only | bench re-bootstrap | | PPPoE | ISP | not ours to rotate | ## Target 1. **terraform user → two slots `terraform-a` / `terraform-b`** (group `terraform`, same policy set). The root rotates the slot the provider is not logged in with, writes OpenBao first, sends the router what OpenBao holds, then publishes `routeros/<dev>/terraform/active`. The runner's `ROS_PASSWORD`/user come from the active slot (ESO template, as in mktxp-credentials). The provider can never lose its own login mid-apply, because the slot it uses is never the one being rotated. Open points: - The bootstrap creates only `terraform-a`; the first apply adds `terraform-b`. The guard and protected set need an exception for this module, with the same reasoning as `modules/monitoring`. - The peer check (`ROLLBACK_PEER_PASSWORD`) must read the peer's active slot. - `rotate-password.sh` and `task routeros:rotate-sim` are deleted once this is live. 2. **Rollback backup password → per arm, never stored.** It is only used inside one armed apply. `arm.sh` can generate it and keep it in the disabled ppp secret it already uses, and the judge deletes it. No OpenBao key, no env var, nothing to rotate. 3. **admin**: stays the bootstrap's break-glass credential. Decide whether it gets the same two slots or stays manual. Verify each step with the sim (CHR + dev OpenBao) like the monitoring module: first apply, re-plan, a period flip, partial failure, and the provider's own login across a flip. Refs ADR-0011, #139 (`modules/monitoring`), #68 (secrets and state), #74 (rollback fuse).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/iac#147
No description provided.