Initial Rancher token secrets engine #1

Merged
benvin merged 2 commits from benvin/plugin-scaffold into main 2026-07-16 22:18:19 +10:00
Owner

Why

Rancher caps API-token TTLs (commonly 90 days via auth-token-max-ttl-minutes), so long-lived automation tokens expire and break. This engine seeds a Rancher token, auto-rotates it before expiry, and mints short-lived scoped tokens on demand.

Changes

  • Add the secrets engine (paths config, service-accounts/<name> + /rotate, roles/<name>, creds/<role>; secret type rancher_token).
  • Mint/revoke Rancher tokens via the public tokens.ext.cattle.io API.
  • Rotate seeded tokens on a PeriodicFunc schedule (default 45d rotate / 90d TTL) by minting a replacement with the current token, then retiring the old one.
  • Mint dynamic, lease-bound, cluster_name-scoped tokens deleted from Rancher on revoke.
  • Ship Woodpecker RPM release (Vault + OpenBao flavors → artifactapi), nfpm packaging, make patch|minor|major, unit tests, and a mock-Rancher e2e.
## Why Rancher caps API-token TTLs (commonly 90 days via `auth-token-max-ttl-minutes`), so long-lived automation tokens expire and break. This engine seeds a Rancher token, auto-rotates it before expiry, and mints short-lived scoped tokens on demand. ## Changes - Add the secrets engine (paths `config`, `service-accounts/<name>` + `/rotate`, `roles/<name>`, `creds/<role>`; secret type `rancher_token`). - Mint/revoke Rancher tokens via the public `tokens.ext.cattle.io` API. - Rotate seeded tokens on a `PeriodicFunc` schedule (default 45d rotate / 90d TTL) by minting a replacement with the current token, then retiring the old one. - Mint dynamic, lease-bound, `cluster_name`-scoped tokens deleted from Rancher on revoke. - Ship Woodpecker RPM release (Vault + OpenBao flavors → artifactapi), nfpm packaging, `make patch|minor|major`, unit tests, and a mock-Rancher e2e.
unkinben added 2 commits 2026-07-16 00:02:04 +10:00
Vault/OpenBao secrets engine managing Rancher API tokens via the public
tokens.ext.cattle.io API.

- config: Rancher connection (URL + TLS)
- service-accounts/<name>: seeded root tokens, auto-rotated before Rancher's
  TTL cap via a PeriodicFunc (default 45d rotation, 90d token TTL); the current
  token mints its own replacement. Manual /rotate endpoint too.
- roles/<name>: mint policy referencing a service account; cluster_name + TTL
  scoping (Rancher tokens inherit the seeding user's RBAC).
- creds/<role>: dynamic, lease-bound tokens deleted from Rancher on revoke.

Ports the bind-tsig Woodpecker RPM release, nfpm packaging, and a mock-Rancher
e2e (Vault + OpenBao). Unit tests cover the full lifecycle.
benvin merged commit 67989d9768 into main 2026-07-16 22:18:19 +10:00
benvin deleted branch benvin/plugin-scaffold 2026-07-16 22:18:20 +10:00
Sign in to join this conversation.