PKI: pki-net-caosh + routeros role; sim REST over verified HTTPS (#85) #88
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac!88
Loading…
Reference in a new issue
No description provided.
Delete branch "routeros-pki"
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?
Closes #85
Production (vault root, applied by the tofu-controller on merge)
vault/pki-net.tf:pki-net-caosh: key generated inside OpenBao, CSR signed online bypki-issue(no Nano), pathlen 0, DNS name constraintnet.caosh.int.animeteamspeak.moe, 3 yearsrouteros: subdomains of that zone plus IP SANs (management addresses), server auth only, EC P-256, 90-day TTL (Terraform renews ahead of expiry), 1-year maxpki-net-routeros-issue:updateonpki-net-caosh/issue/routerosonly, for the bench renderer and the routeros runnertofu validatepasses.Merging applies it right away.
openbao-configruns withapprovePlan: "auto", so there's no plan gate. It only adds resources (one mount, its CA, one role, one policy) and changes nothing that already exists. The bootstrap runner AppRole may configure all of OpenBao (ADR-0003), so permissions are fine.Rehearsed against the harness OpenBao (same 2.7.x) with this exact file, mount and policy renamed
*-rehearsal:r9.net.caosh...+ IP verifies against the (fake) root through the chaincommon_name=evil.example.comis refused by the roleThe rehearsal caught one bug, fixed here: role TTLs as
"2160h"drift forever because OpenBao stores seconds. They're now7776000/31536000.Sim (verified)
scripts/harness-bao.shbuilds the same mount, role and name constraint under the fake ceremony'spki-issuescripts/lab-router-certs.shissues r1/r2 certs from it and installs them right after boot. The leaf is imported alone aswww-ssl, and the chain separately aslab-ca-1/2.routeros/simnow useshttps://withca_certificate= the lab root, neverinsecureResults on a fresh lab:
curl --cacert <lab root>gives verify=0 / HTTP 200 on both routerstofu applyover HTTPS created 228 resources, andplan -detailed-exitcodethen returns 0Findings
www-sslpicked a CA without a key, which showed up as a handshake EOF. The leaf now goes in alone./certificate importinside an imported script makes RouterOS 7.25's REST/importanswer{}instead of{"ret":"true"}, and containerlab then marks the node failed. In the lab the cert is pushed after boot. netinstall doesn't use REST, so the real bootstrap (#64) keeps the cert inside its.rsc.Not in this PR
vault_pki_secret_backend_cert->routeros_system_certificate->www-ssl)r1/r2undernet.caosh...(#50)