vault: ESO write grant for generated credentials (apps/<cluster>/generated/) #162

Merged
ginjiruu merged 1 commit from eso-generated-c1 into master 2026-11-19 04:31:01 +00:00
Owner

Closes #161. One policy block in modules/openbao-platform (applies to every cluster with Kubernetes auth, today c1). Test evidence in the issue. tofu validate: vault and vault/sim OK. Not merged: waiting for review.

Closes #161. One policy block in modules/openbao-platform (applies to every cluster with Kubernetes auth, today c1). Test evidence in the issue. tofu validate: vault and vault/sim OK. Not merged: waiting for review.
Create/read/update on infra/apps/<cluster>/generated/*, no delete or
destroy, for ClusterGenerator -> PushSecret (IfNotExists) credentials whose
source of truth is OpenBao (PowerDNS API key, UniFi passwords). Policy-only
write-once fails with ESO's call order (metadata first); tested on a
throwaway OpenBao dev server. Closes #161.
Collaborator

tf-controller plan output:


OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place (current -> planned)

OpenTofu will perform the following actions:

  # module.platform.vault_policy.external_secrets["c1"] will be updated in-place
  ~ resource "vault_policy" "external_secrets" {
        id     = "c1-external-secrets"
        name   = "c1-external-secrets"
      ~ policy = <<-EOT
            # ESO on c1 (ClusterSecretStore `openbao`, flux-clusters
          - # clusters/c1/external-secrets): read-only, c1's app subtree of the infra KV.
          + # clusters/c1/external-secrets): read c1's app subtree of the infra KV.
            path "infra/data/apps/c1/*" {
              capabilities = ["read"]
            }
            
            path "infra/metadata/apps/c1/*" {
              capabilities = ["read", "list"]
            }
          + 
          + # Generated credentials (PushSecret, IfNotExists): create and update,
          + # never delete or destroy.
          + path "infra/data/apps/c1/generated/*" {
          +   capabilities = ["create", "read", "update"]
          + }
          + 
          + path "infra/metadata/apps/c1/generated/*" {
          +   capabilities = ["create", "read", "update", "list"]
          + }
        EOT
    }

Plan: 0 to add, 1 to change, 0 to destroy.

To apply this plan, please merge this pull request.

tf-controller plan output: ```hcl OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: ~ update in-place (current -> planned) OpenTofu will perform the following actions: # module.platform.vault_policy.external_secrets["c1"] will be updated in-place ~ resource "vault_policy" "external_secrets" { id = "c1-external-secrets" name = "c1-external-secrets" ~ policy = <<-EOT # ESO on c1 (ClusterSecretStore `openbao`, flux-clusters - # clusters/c1/external-secrets): read-only, c1's app subtree of the infra KV. + # clusters/c1/external-secrets): read c1's app subtree of the infra KV. path "infra/data/apps/c1/*" { capabilities = ["read"] } path "infra/metadata/apps/c1/*" { capabilities = ["read", "list"] } + + # Generated credentials (PushSecret, IfNotExists): create and update, + # never delete or destroy. + path "infra/data/apps/c1/generated/*" { + capabilities = ["create", "read", "update"] + } + + path "infra/metadata/apps/c1/generated/*" { + capabilities = ["create", "read", "update", "list"] + } EOT } Plan: 0 to add, 1 to change, 0 to destroy. ``` To apply this plan, please **merge** this pull request.
ginjiruu merged commit 264681a3e6 into master 2026-11-19 04:31:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/iac!162
No description provided.