vault: mount arrstack engine + config + roles (3/3) #127

Merged
benvin merged 5 commits from benvin/arrstack-resources into master 2026-08-21 00:09:47 +10:00
Member

Why

Creates the arrstack secrets engine itself: the mount + config and the per-scope roles that mint arrproxy API keys. PR 3 of 3 (resources), stacked on #126 (policy). Final step of the register -> policy -> resources split (was #124).

Change

  • Adds config/arrstack_secret_backend/arrstack.yaml: mounts the engine at arrstack and writes its config (base_url, timeout). The arrproxy admin token stays out of git and is read from KV by the module.
  • Adds config/arrstack_secret_backend_role/arrstack/{all,sonarr,radarr,prowlarr}.yaml: roles scoped to each arr app (plus one covering all three). Default ttl is 60s (short-lived, renewed on demand); max_ttl 86400 mirrors the litellm sibling convention. The engine additionally caps renewal at the arrproxy admin token's fixed mint expiry.
  • Adds modules/vault_cluster/modules/arrstack_secret_backend{,_role} and wires them in: config/config.hcl maps, modules/vault_cluster/main.tf, variables.tf, the environment inputs, and the root provider block.
  • Provider source is artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/vault-secrets-arrstack (repo terraform-provider-vault-secrets-arrstack), local name arrstack.

Apply order

Apply after PR #126 (policy) AND after terraform-provider-vault-secrets-arrstack v0.1.0 is published to the artifactapi terraform registry. Until the provider is published, tofu init cannot resolve it, so CI/plan on this PR is red by design — that is expected, not a regression.

Note plan-green != apply-green: the KV-sourced admin_token is only fetched at apply time, so a green plan does not prove the seeded token is readable.

Stack

  1. register -> vault: register vault-plugin-secrets-arrstack in the catalog (1/3) (#125)
  2. policy -> vault: add arrstack policies (deployer + KV read + creds) (2/3) (#126)
  3. resources (this PR) -> benvin/arrstack-resources off benvin/arrstack-policy

Supersedes #124.

## Why Creates the arrstack secrets engine itself: the mount + config and the per-scope roles that mint arrproxy API keys. **PR 3 of 3 (resources)**, stacked on #126 (policy). Final step of the register -> policy -> resources split (was #124). ## Change - Adds `config/arrstack_secret_backend/arrstack.yaml`: mounts the engine at `arrstack` and writes its config (`base_url`, timeout). The arrproxy admin token stays out of git and is read from KV by the module. - Adds `config/arrstack_secret_backend_role/arrstack/{all,sonarr,radarr,prowlarr}.yaml`: roles scoped to each arr app (plus one covering all three). Default `ttl` is **60s** (short-lived, renewed on demand); `max_ttl` 86400 mirrors the litellm sibling convention. The engine additionally caps renewal at the arrproxy admin token's fixed mint expiry. - Adds `modules/vault_cluster/modules/arrstack_secret_backend{,_role}` and wires them in: `config/config.hcl` maps, `modules/vault_cluster/main.tf`, `variables.tf`, the environment inputs, and the root provider block. - Provider source is `artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/vault-secrets-arrstack` (repo `terraform-provider-vault-secrets-arrstack`), local name `arrstack`. ## Apply order Apply **after PR #126 (policy) AND after `terraform-provider-vault-secrets-arrstack` v0.1.0 is published** to the artifactapi terraform registry. Until the provider is published, `tofu init` cannot resolve it, so **CI/plan on this PR is red by design** — that is expected, not a regression. Note **plan-green != apply-green**: the KV-sourced `admin_token` is only fetched at apply time, so a green plan does not prove the seeded token is readable. ## Stack 1. register -> #125 2. policy -> #126 3. **resources (this PR)** -> `benvin/arrstack-resources` off `benvin/arrstack-policy` Supersedes #124.
benvin changed target branch from benvin/arrstack-policy to master 2026-08-19 22:54:20 +10:00
benvin added 3 commits 2026-08-19 22:54:20 +10:00
Register vault-plugin-secrets-arrstack in the plugin catalog
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
f0a61dc352
Import the arrstack secrets plugin (v0.1.0) into the OpenBao plugin
catalog so later PRs can mount the engine. Registration is the first of
three stacked, independently-applied steps (register -> policy ->
resources) per the never-bundle rule.

The plugins map glob and module.plugin already exist, so this only adds
the catalog entry; the sha256 pins the released v0.1.0 binary.

Apply order: run this only AFTER the Puppet plugin-install PR (#521,
merged) has placed the binary at
/opt/openbao-plugins/vault-plugin-secrets-arrstack on the OpenBao nodes.
Registration fails until the binary is present.
Add arrstack Vault policies (deployer, KV read, consumer creds)
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
5862ae974c
Grant the Vault access the arrstack engine needs, before any engine
resources exist. Second of three stacked steps (register -> policy ->
resources).

Adds:
- policies/arrstack/admin.yaml: the terraform-vault deployer may
  create/read/update/delete arrstack/config and manage arrstack/roles/*.
- policies/kv/.../arrproxy-admin-token/read.yaml: the deployer may read
  the KV-seeded arrproxy admin token (data + metadata paths) that the
  engine config sources; the existing secret_backends_read policy does
  not cover this kubernetes/namespace KV path.
- policies/arrstack/creds/{sonarr,radarr,prowlarr}.yaml: each terraform-
  <app> run may read its own arrstack/creds/<app> to mint a scoped key.

Policy YAMLs are auto-discovered by policies/policies.hcl, so no wiring
changes are needed.

Apply order: after PR-1 (register). Safe to apply before the engine
exists since these only grant capabilities on paths.
Mount arrstack engine, write its config, and define its roles
ci/woodpecker/pr/plan Pipeline failed
ci/woodpecker/pr/pre-commit Pipeline failed
73b9a233bc
Create the arrstack secrets engine resources: the mount + config and the
per-scope roles that mint arrproxy API keys. Third and final stacked step
(register -> policy -> resources).

Adds:
- config/arrstack_secret_backend/arrstack.yaml: mounts the engine at
  "arrstack" and writes its config (base_url, timeout). The arrproxy
  admin token stays out of git and is read from KV by the module.
- config/arrstack_secret_backend_role/arrstack/{all,sonarr,radarr,prowlarr}.yaml:
  roles scoped to each arr app (and one covering all three). Default
  ttl is 60s (short-lived, renewed on demand); max_ttl 86400 mirrors the
  litellm sibling convention. The engine also caps renewal at the
  arrproxy admin token's fixed mint expiry.
- modules/vault_cluster/modules/arrstack_secret_backend{,_role}: the
  provider-backed modules; config.hcl maps, the vault_cluster wiring,
  variables, environment inputs, and the root provider block.

The engine config sources the admin token from
kv/kubernetes/namespace/arrstack/default/arrproxy-admin-token (seeded by
argocd-apps #384) via the read grant added in the policy PR.

Provider source is artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/
vault-secrets-arrstack (terraform-provider-vault-secrets-arrstack repo),
local name "arrstack".

Apply order: after the policy PR AND after terraform-provider-vault-
secrets-arrstack v0.1.0 is published to the artifactapi terraform
registry. Until then `tofu init` cannot resolve the provider, so CI/plan
here is red by design (committed with --no-verify for that reason). Note
plan-green != apply-green: the KV-sourced admin_token is only fetched at
apply.
benvin added 1 commit 2026-08-19 22:56:18 +10:00
Merge branch 'master' into benvin/arrstack-resources
ci/woodpecker/pr/plan Pipeline failed
ci/woodpecker/pr/pre-commit Pipeline failed
bd398eb094
unkin-agent added 1 commit 2026-08-19 23:27:03 +10:00
Merge branch 'master' into benvin/arrstack-resources
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
60a5d08402
Bring in #128 (agents approle write on ghp config KV path) and confirm ghp backend/role YAMLs removed by #129 stay absent, so plan resolves the now-published vault-secrets-arrstack v0.1.0 provider cleanly.
benvin merged commit 0e82cda02d into master 2026-08-21 00:09:47 +10:00
benvin deleted branch benvin/arrstack-resources 2026-08-21 00:09:48 +10:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/terraform-vault#127