Skip to content

Commit f41cef0

Browse files
committed
fix: skip_child_token in validate-vault-oidc (read-only role can't create child tokens)
The vault provider's default behavior calls auth/token/create to mint a child token, which the OIDC role's read-only policy (env0-access) doesn't permit (403). skip_child_token uses the OIDC-login VAULT_TOKEN directly — it's already short-lived.
1 parent da5b0a9 commit f41cef0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

misc/validate-vault-oidc/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ terraform {
1313
# step authenticates to Vault via the env0 OIDC token (logging into the JWT role provisioned by
1414
# tests/terraform/env0-oidc-trust-vault) and exports VAULT_TOKEN. This template validates that the
1515
# OIDC-obtained token works — it reads a secret the fixture seeded that the role's policy permits.
16-
provider "vault" {}
16+
# skip_child_token: use the OIDC token directly instead of minting a child token (auth/token/create),
17+
# which the read-only role policy doesn't permit; the OIDC login token is already short-lived.
18+
provider "vault" {
19+
skip_child_token = true
20+
}
1721

1822
# KV mount the OIDC role's policy permits. v1 uses secrets-for-env0 (default); the v2 entry passes
1923
# TF_VAR_secrets_mount=secrets-for-env0-v2. The v1/v2 difference is otherwise entirely on the

0 commit comments

Comments
 (0)