RouterOS 006: Secret handling for state and vars #68
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac#68
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #43
Refs: lab/iac#45
Migrated from router-as-code tracker 006 (docs/routeros/tracker in this repo history). Research notes: docs/routeros/notes/.
Terraform state holds device passwords in plaintext, so state security =
router admin security. iac#45 caveat; OpenBao later, sops today.
Decisions to make
rendered into the
varsFromSecret via the existing flow (how the otherTerraform objects get theirs), vs ESO from OpenBao when it lands (mc#7 line
of work). Start SOPS, keep the Secret name/shape stable so the swap is a
source change only.
terraformAPI user per router, group withoutfullifpolicy coverage allows (test in sim), password rotated through the SAME
secret (the bootstrap #002 sets it; rotation = bootstrap re-run on bench,
which is allowed, vs editing the user over the API, which the protected-set
rule forbids — see #002 rules).
generated boot script contains real credentials only at render time in CI,
never in git; golden renders use the
CHANGEME-with-warning pattern borrowedfrom 1911-gold.
Done when
password is a documented one-command change; state backend documented
(controller-managed, in-cluster, access = flux-system).
Status 2026-11-17: ESO-from-OpenBao path shipped (secret/routeros-secrets on Bao, per-device ExternalSecret -> varsFrom, env-only secrets for the rollback fuse, iac#115/#119; no plaintext creds in git; cutover renders shredded after use). Gaps vs done-when: password rotation is not a documented one-command change, and state-backend doc line never written. Otherwise done; mark ready-for-human, likely closes with a docs note.
Detail 2026-11-17, what exactly is left (verified against live + master):
SHIPPED: Bao KV -> ESO (ClusterSecretStore openbao) -> routeros--env/-vars -> tf-runner env (ROS_PASSWORD, ROUTEROS_PASSWORD, ROLLBACK_BACKUP/PEER_PASSWORD). Zero plaintext creds in git; modules/rollback/main.tf keeps passwords env-only ('no password reaches state or a plan file'); dedicated REST-only terraform user with the group gate proven on CHR 7.25.1 (bootstrap README); renders shredded after use.
REMAINS (2 items, both docs):
Everything else in the body is decided and shipped. Suggest: write the two paragraphs (15 min, can do it in a docs PR on request), then close.