Preflight Checklist
Vault Secrets Webhook Version
1.21.0
Installation Type
Official Helm chart
Bank-Vaults Version
No response
Kubernetes Version
1.23
Kubernetes Distribution/Provisioner
EKS
Expected Behavior
Deployment where annotations to enable consul-template were added should run consul template and retrieve secrets from vault, as it did on vault-secrets-webhook 0.17.0.
In 1.17.0, we saw the following two injected containers:
consul-template: hashicorp/consul-template:0.24.1-alpine
vault-agent: vault:1.6.2
Actual Behavior
gitlab-agent ran flawlessly, but consul-template only got 403 back from vault. On closer inspection, it turns out that /vault/.vault-token was owned by root, and could only be read by root.
As the new consul-template container used ran as uid 100, this made things not work.
On 1.21.0 we see the following two injected containers:
consul-template: hashicorp/consul-template:0.32.0
vault-agent: hashicorp/vault:1.14.1
Manual inspection shows that the consul-template container now runs as uid 100.
Steps To Reproduce
No response
Configuration
No response
Logs
│ consul-template 2024-01-19T15:51:27.589Z [WARN] (view) vault.read(database/creds/energycounter-timeperiod-review): vault.read(database/creds/energycounter- │
│ consul-template │
│ consul-template URL: GET https://ext-vault.vault:8200/v1/database/creds/energycounter-timeperiod-review │
│ consul-template Code: 403. Errors: │
│ consul-template │
│ consul-template * permission denied (retry attempt 10 after "1m0s")
Additional Information
Adding annotation:
vault.security.banzaicloud.io/run-as-user: "100"
Fixes the problem.
This should preferrably be part of the default configuration pushed by the webhook.
Preflight Checklist
Vault Secrets Webhook Version
1.21.0
Installation Type
Official Helm chart
Bank-Vaults Version
No response
Kubernetes Version
1.23
Kubernetes Distribution/Provisioner
EKS
Expected Behavior
Deployment where annotations to enable consul-template were added should run consul template and retrieve secrets from vault, as it did on vault-secrets-webhook 0.17.0.
In 1.17.0, we saw the following two injected containers:
consul-template: hashicorp/consul-template:0.24.1-alpine
vault-agent: vault:1.6.2
Actual Behavior
gitlab-agent ran flawlessly, but consul-template only got 403 back from vault. On closer inspection, it turns out that /vault/.vault-token was owned by root, and could only be read by root.
As the new consul-template container used ran as uid 100, this made things not work.
On 1.21.0 we see the following two injected containers:
consul-template: hashicorp/consul-template:0.32.0
vault-agent: hashicorp/vault:1.14.1
Manual inspection shows that the
consul-templatecontainer now runs as uid 100.Steps To Reproduce
No response
Configuration
No response
Logs
Additional Information
Adding annotation:
Fixes the problem.
This should preferrably be part of the default configuration pushed by the webhook.