Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidecar agent in CSI can't estabish a TLS connection with an external vault using a custom CA #995

Open
Neferites opened this issue Jan 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Neferites
Copy link

Describe the bug
The CSI pod sidecar vault agent does not use a custom CA for connecting to an external vault.

To Reproduce
Steps to reproduce the behavior:

  1. Install chart with at least:
global:
  enabled: false
  tlsDisable: false
  externalVaultAddr: "https://external-vault.home"
csi:
  enabled: true
  extraArgs: 
    - -vault-tls-ca-cert=/vault/tls/ca.crt
  hmacSecretName: ""
  volumes:
  - name: tls
    secret:
      secretName: vault-ca-cert
  volumeMounts:
  - name: tls
    mountPath: "/vault/tls"
    readOnly: true

Agent pods log :

2024-01-26T21:01:58.757Z [INFO]  agent.apiproxy: received request: method=POST path=/v1/auth/prod-k8s/login
2024-01-26T21:01:58.757Z [INFO]  agent.apiproxy: forwarding request to Vault: method=POST path=/v1/auth/prod-k8s/login
2024-01-26T21:01:58.763Z [ERROR] agent.apiproxy.client: request failed: error="Post \"https://external-vault.home/v1/auth/prod-k8s/login\": tls: failed to verify certificate: x509: certificate signed by unknown authority" method=POST url=https://external-vault.home/v1/auth/prod-k8s/login

Expected behavior
Agent pod should use /vault/tls/ca.crt in order to execute a TLS connection.

Workaround
add csi.agent.enabled=false

Environment

  • Kubernetes version: 1.28
    • Distribution or cloud vendor (OpenShift, EKS, GKE, AKS, etc.): vanilla
  • vault-helm version: 0.27
@Neferites Neferites added the bug Something isn't working label Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant