routeros: read-only monitoring users + api-ssl, two-slot rotation published by Terraform (#139) #143
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac!143
Loading…
Reference in a new issue
No description provided.
Delete branch "routeros-monitoring-user"
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?
The router half of #139, on the design recorded in the new ADR-0011 (orchestration across GitOps loops: converge first, a controller last). The first draft, which used an ESO generator and PushSecret, is replaced. It had a login-failure window on every rotation and needed the repos merged in a fixed order.
Design (
routeros/modules/monitoring, called by all three roots)Two read-only users per device,
monitoring-aandmonitoring-b, in groupmonitoring(policyread,api). Login, andapi-sslon 8729, are allowed only from mini's pod pool10.44.0.0/16. The service uses the device's www-ssl cert.They rotate alternately. The period is
v = floor(plantimestamp / 15d): slot a holds the last evenv, slot b the last odd one. Every plan agrees on these numbers without storing anything, and each slot keeps working for a full period after the other one rotates.One writer, in graph order. For the slot that rotates:
random_passwordgoes to OpenBaosecret/routeros-monitoring/<dev>/<slot>(write-onlydata_json_wo);password_wo;<dev>/activepointed at that slot.A retry after a partial failure re-sends the stored value, and
activealways names a slot the router accepts.No password in state or plans. No runner env. No dependency on the clusters repo for merge order.
Other changes
vault/runners-k8s.tf: new policyrunner-routeros-monitoring(create/read/update/delete onsecret/routeros-monitoring/*only) added to roletf-routeros.vault/eso-mini.tf: ESO gets read-only access tosecret/routeros-monitoring/*.required_version >= 1.11, plusrandom ~> 3.7andtime ~> 0.11.render.pyandgate.sh: the users and the OpenBao entries are gate-allowlisted creates./useris never rendered and is skipped by coverage. The gate checks api-ssl's address restriction (available-fromon RouterOS 7.25) and that both slot users exist.lib.shpoints the sim at the harness'sinfraKV mount and addsROUTEROS_TOFURCfor testing unreleased provider builds.docs/routeros/README.md,docs/adr/0011-orchestration-layers.md, and the guard header.Tests
-targetto write OpenBao only:activedoesn't move and the router is unchanged; the retry sends exactly OpenBao's value.tofu validatepasses for all three roots. The gate used provider 1.99.1004 throughdev_overrides, with the module constraint relaxed locally only, because the locks still pin 1.99.1003.Before merge
lab/release.sh 1.99.1004; tagv1.99.1004is pushed, and the registry push needs a package-writing token).tofu init -upgradewithrouteros/tofu.rc): routeros 1.99.1004, plus random and time.tf-controller plan output:
To apply this plan, please merge this pull request.
tf-controller plan output:
To apply this plan, please merge this pull request.
tf-controller plan output:
To apply this plan, please merge this pull request.
WIP: routeros: read-only monitoring user + api-ssl, ESO-generated write-only password (#139)to routeros: read-only monitoring users + api-ssl, two-slot rotation published by Terraform (#139)