Skip to content

SecretStore with Hashicorp Vault v1 vs v2 #1333

@Sartigan

Description

@Sartigan

Hello,

End Goal
Ligthen the path (remoteRef.key) for users creating ExternalSecrets which always start with secret/data/k8s/${CLUSTER_NAME}

V1
It works properly, I can easily do this in my ClusterSecretStore

      server: "https://dev.vault.com:8200"
      path: "secret/data/k8s/mycluster"
      version: "v1"

ExternalSecret

  - secretKey: password
    remoteRef:
      key: mynamespace/secret_name
      property: data.password

This will fetch: secret/data/k8s/mycluster/mynamespace/secret_name which is exactly what we want.

V2
It does not work because the path will always append /data

      server: "https://dev.vault.com:8200"
      path: "secret/data/k8s/mycluster"
      version: "v2"

ExternalSecret

  - secretKey: password
    remoteRef:
      key: mynamespace/secret_name
      property: data.password

This will fetch secret/data/k8s/mycluster/data/mynamespace/secret_name (notice the extra /data in the middle)

Is there a way to use Vault V2 API while still avoiding k8s users to always enter the first part of the secret path: secret/data/k8s/${CLUSTER_NAME} ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/vaultIndicates an issue or PR related to Vault.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions