vault: add ghp engine config-write + consumer policies (pre-step)
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

Step 2 of the ordered ghp plugin add. policies/ghp/admin.yaml grants the
terraform apply identities (tf_vault approle, woodpecker_terraform_vault k8s
role) create/update on ghp/config and ghp/roles/*; policies/ghp/creds/agent.yaml
grants the agents approle read on ghp/creds/agent.

Must merge + apply BEFORE the engine resources (terraform-vault#121): an approle
token's capabilities are fixed at login, so the deployer needs this policy active
in a prior apply before it can write ghp/config.
This commit is contained in:
2026-08-16 14:44:15 +10:00
parent 9e7687fccb
commit a962a22416
2 changed files with 50 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
# Allow the vault deployer to manage the ghp token secrets engine: its
# connection config (seeded service token) and its token-minting roles.
#
# Scoped to ghp/* only, and deliberately excludes ghp/creds/* - minting tokens
# is for consumers, not the deployer. ghp has NO rotate endpoint, so unlike the
# gitea/netbox engines there is no config/rotate grant here. The plugin-catalog
# grant needed to import the plugin is the shared, sudo-protected wildcard in
# policies/sys/plugins/catalog/admin.yaml (already covers this plugin), and
# mounting the engine uses the deployer's existing sys/mounts/* access, so no
# new catalog/mount grant is added here (mirrors the gitea/netbox engines).
---
rules:
# Engine connection config (base_url, TLS, seeded service token).
- path: "ghp/config"
capabilities:
- create
- read
- update
- delete
# Token-minting roles.
- path: "ghp/roles/*"
capabilities:
- create
- read
- update
- delete
- list
- path: "ghp/roles"
capabilities:
- read
- list
auth:
approle:
- tf_vault
k8s/au/syd1:
- woodpecker_terraform_vault
+13
View File
@@ -0,0 +1,13 @@
# Lets the agents AppRole mint ephemeral ghp agent tokens, so AI coding agents
# authenticate to ghp as their own short-lived, least-privilege identity.
# Reading ghp/creds/agent returns a lease-bound token scoped by the role
# (token_type agent, contents:read). Mirrors the gitea/creds/unkin-agent binding.
---
rules:
- path: "ghp/creds/agent"
capabilities:
- read
auth:
approle:
- agents