You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The plugin does not seem to re-use the vault token generated and cached at ~/.avp/config.json.
To Reproduce
I have a custom sidecar using AVP in a volume downloaded from an init container in ArgoCD, I mounted a volume at the ~/.avp/config.json path of the container to allow argocd user (999) to read and write there.
I am using k8s auth-type and every time the plugin runs in the sidecar, it generates a new vault token and caches it in the file
Expected behavior
I would expect the plugin to re-use the token until the ttl is reached.
2023/08/14 13:09:15 reading configuration from config file /etc/argocd-vault-plugin/config.yaml, overriding any previous settings
2023/08/14 13:09:15 Setting VAULT_ADDR to https://XXX/ for backend SDK
2023/08/14 13:09:15 Setting VAULT_NAMESPACE to YYY for backend SDK
2023/08/14 13:09:15 reading configuration from environment, overriding any previous settings
2023/08/14 13:09:15 AVP configured with the following settings:
2023/08/14 13:09:15 avp_k8s_role: argocd-test
2023/08/14 13:09:15 avp_k8s_mount_path: auth/ZZZ
2023/08/14 13:09:15 avp_kv_version: 2
2023/08/14 13:09:15 avp_k8s_token_path: /var/run/secrets/tokens/vault-token
2023/08/14 13:09:15 vault_addr: https://XXX/
2023/08/14 13:09:15 vault_namespace: YYY
2023/08/14 13:09:15 avp_type: vault
2023/08/14 13:09:15 avp_auth_type: k8s
2023/08/14 13:09:15 Hashicorp Vault authenticating with Vault role argocd-test using Kubernetes service account token /var/run/secrets/kubernetes.io/serviceaccount/token read from REDACTED
2023/08/14 13:09:15 Hashicorp Vault authentication response: REDACTED
2023/08/14 13:09:15 found placeholder path:SECRET with modifiers [ base64encode]
2023/08/14 13:09:15 calling GetIndividualSecret for secret ****** from path SECRET at version
2023/08/14 13:09:15 Hashicorp Vault getting kv pairs from KV-V1 path SECRET
2023/08/14 13:09:15 Hashicorp Vault get kv pairs response: REDACTED
2023/08/14 13:09:15 processing modifier base64encode with args ["base64encode"]
apiVersion: v1
data:
TEST: ******
kind: Secret
metadata:
annotations: {}
labels:
name: test
name: test
namespace: test
type: Opaque
---
Additional context
I have checked multiple things already, the cache file is updated at every run of the plugin even though the vault backend role is configured for a TTL of 5 minutes (max ttl and explicit max ttl)
Describe the bug
The plugin does not seem to re-use the vault token generated and cached at
~/.avp/config.json
.To Reproduce
I have a custom sidecar using AVP in a volume downloaded from an init container in ArgoCD, I mounted a volume at the
~/.avp/config.json
path of the container to allow argocd user (999) to read and write there.I am using k8s auth-type and every time the plugin runs in the sidecar, it generates a new vault token and caches it in the file
Expected behavior
I would expect the plugin to re-use the token until the ttl is reached.
Screenshots/Verbose output
vault configuration configmap
avp container
logs with verbose-sensitive-output flag
Additional context
I have checked multiple things already, the cache file is updated at every run of the plugin even though the vault backend role is configured for a TTL of 5 minutes (max ttl and explicit max ttl)
I have tried to check inside the code (I am no Go expert) and found where the token is stored https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/pkg/utils/util.go#L62 but I couldn't find where the function to retrieve it is called (https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/pkg/utils/util.go#L20)
The text was updated successfully, but these errors were encountered: