hashicorp / hashicorp/vault-helm

PSP Binding service account name is not correct.

Open
#606 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
1.3k
Forks
898
Avg merge
3d 1h
Merged PRs (30d)
1

Description

**Describe the bug**
PSP Binding service account name is not correct:
https://github.com/hashicorp/vault-helm/blob/master/templates/server-psp-rolebinding.yaml#L18

**To Reproduce**
Steps to reproduce the behavior:
Install chart with:
```yaml
global:
psp:
enable: true
server:
serviceAccount:
create: false
name: "vault-sa"
```
**Expected behavior**
PSP Binds to the supplied SA, I assume it should be:

```
subjects:
- kind: ServiceAccount
name: {{ template "vault.serviceAccount.name" . }}
```
**Environment**
* Kubernetes version:
* Distribution or cloud vendor (OpenShift, EKS, GKE, AKS, etc.): GKE, with workload identity thus SA created prior installation.
* Other configuration options or runtime services (istio, etc.):
* vault-helm version: Master

Chart values:

```yaml
global:
psp:
enable: true
ha:
enabled: true
raft:
enabled: true
config: |
ui = true
listener "tcp" {
tls_disable = 1
address = "[::]:8200"
cluster_address = "[::]:8201"
}
storage "raft" {
path = "/vault/data"
}
service_registration "kubernetes" {}
seal "gcpckms" {
project = "gcp-vault"
region = "global"
key_ring = "vault-keyring"
crypto_key = "vault-init"
}
server:
extraEnvironmentVars:
GOOGLE_REGION: global
serviceAccount:
# Specifies whether a service account should be created
create: false
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: "vault-sa"
ui:
# True if you want to create a Service entry for the Vault UI.
#
# serviceType can be used to control the type of service created. For
# example, setting this to "LoadBalancer" will create an external load
# balancer (for supported K8S installations) to access the UI.
enabled: true
serviceType: "LoadBalancer"
```
**Additional context**

In order to use autounsealing with google KMS we create workload identity SA before installing vault. Therefore we need to supply SA to helm chart but PSP is designed o work with the only specific name of SA

Contributor guide

Open the contributing guide

Research direction

Start with templates/server-psp-rolebinding.yaml and the server.serviceAccount values shown in the issue. Render the chart with the supplied configuration and inspect the PSP RoleBinding subject. Done means the binding targets the configured existing service account name, such as vault-sa.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
devops, infrastructure, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.