Hashicorp

Prev Next

The HashiCorp Vault Store allows secure retrieval of secrets from a Vault instance, supporting both token-based and Kubernetes authentication. This store is ideal for organizations already using Vault to manage sensitive credentials such as private keys, OAuth secrets, or database passwords. Configuration supports flexible path structuring and secure access control.

HashiCorp Vault Secret Store-specific Parameters

The following parameters are required to configure the HashiCorp Vault Secret Store:

Parameter Value Description
details.skipVerify true Indicates whether to prefix the Secret Store URL with https:// or http://.
details.url The Secret store URL.
details.timeout 3s The timeout value for connecting to the Secret store.
details.enginePath secret Specifies the root folder in the HashiCorp Vault Engine from which the Secret Management Service should access Secrets.

Note: When configuring Vault information in the Scope in the Scope Details in the Environment Settings for JWT signing, do not include the enginePath in the Path to Key parameter.
details.pathPrefix environments/production The prefix for all paths when accessing Secrets in this store.
auth Authentication details for accessing the Secret store. Add relevant Attributes based on the auth.method (Kubernetes or Token).
auth.method Kubernetes The authentication method used for accessing the Secret store. Available methods:
- Kubernetes
- Token
auth.mountPath kubernetes Optional, used for Kubernetes. The Vault auth mount path of the Kubernetes auth method. The PAA sends the service account token to Vault at auth/<mountPath>/login. If you omit this parameter, the PAA uses Vault's standard mount, kubernetes, so existing stores keep working without changes.
auth.path /var/run/secrets/kubernetes.io/serviceaccount/token Optional, used for Kubernetes. The service account token (JWT) file. If you leave it empty, the PAA uses /var/run/secrets/kubernetes.io/serviceaccount/token.
auth.role used for Kubernetes Vault authorization role name.
auth.tokenValue used for token The token value used for authentication when accessing the Secret store.
auth.tokenFilePath used for token File path holding the token.

Example

The following example is based on the general store and store-specific parameters:

secretStore:
  - id: hashicorp-vault
    type: Vault
    isDefault: true
    decoder: Base64
    details:
      url: https://vault.example.com
      defaultPath: secret/data/
      enginePath: kv
      pathPrefix: myapp/
      timeout: 5s
      skipVerify: false
    auth:
      method: Token
      tokenValue: s.1234567890abcdef
#    tokenFileName: ${VAULT_TOKEN}  # Optional: path to file containing the token
#
#  auth:
#    method: Kubernetes
#    path: /var/run/secrets/kubernetes.io/serviceaccount/token
#    role: secrets-role

Kubernetes authentication with a custom auth mount

secretsMgmt:
  enabled: true
  plainIDConfig:
    config.yaml:
      log:
        level: debug            # prints "configuring k8s mount path: <value>"
      secretStore:              # Helm replaces lists, so this replaces the default fileSecret store
        - id: vault-k8s
          type: Vault
          isDefault: true
          decoder: None
          details:
            url: https://vault.customer.com:8200
            enginePath: secret
            pathPrefix: ""
            timeout: 5s
            skipVerify: false
            # namespace: admin   # Vault Enterprise/HCP only
          auth:
            method: Kubernetes
            role: vault_plainid_stg
            mountPath: kube_plainid_stg_aus
            # path: /var/run/secrets/kubernetes.io/serviceaccount/token   # optional

Using a Non-default Kubernetes Auth Mount

Vault's Kubernetes auth method can be mounted at any custom path, not only the default kubernetes. A single Vault instance commonly has multiple Kubernetes auth mounts enabled, one per cluster or Environment (for example kube_plainid_dev/, kube_plainid_stg_aus/, and kube_plainid_stg_clt/). Roles only need to be unique within a mount, so two mounts can use the same role name.

To target a specific mount, set auth.mountPath to that mount and auth.role to the role in that mount. If you omit auth.mountPath, the PAA uses the default kubernetes mount.

To confirm which mount the PAA uses, set log.level to debug. The Secret Management Service then logs configuring k8s mount path: <value>.

Service Account Token File

The PAA reads the service account token (JWT) from the token file and sends it to Vault at auth/<mountPath>/login. Because the PAA sends the file's contents to the store's Vault URL, stores created in the UI may only use token file paths listed in VAULT_KUBERNETES_ALLOWED_TOKEN_PATHS on the PAA. Stores defined in the PAA YAML are not restricted.

The PAA allows the following paths by default:

Token file Notes
/var/run/secrets/kubernetes.io/serviceaccount/token Kubernetes default. If you leave the token file empty, the PAA uses this path
/var/run/secrets/eks.amazonaws.com/serviceaccount/token EKS IRSA. The Vault role needs audience=sts.amazonaws.com.
/var/run/secrets/azure/tokens/azure-identity-token AKS

The PAA rejects any other path, such as /var/run/secrets/plainid/token, with a token path ... is not allowed error until you add it to VAULT_KUBERNETES_ALLOWED_TOKEN_PATHS. The allowlist accepts exact paths, /dir/*, and *.

The PAA resolves path traversal before checking the allowlist. For example, it resolves .../../../../etc/passwd to /var/etc/passwd, rejects it, and sends nothing to Vault.

© 2026 PlainID LTD. All rights reserved.