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

Use ServiceAccount for Workload Identity clientID and tenantId #1316

Open
dkirrane opened this issue Sep 27, 2023 · 2 comments
Open

Use ServiceAccount for Workload Identity clientID and tenantId #1316

dkirrane opened this issue Sep 27, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dkirrane
Copy link

dkirrane commented Sep 27, 2023

Feature Request
Currently for Workload Identity the SecretProviderClass requires clientID and tenantId.
However this detail is already available from the application's ServiceAccount

apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-app
  namespace: default
  labels:
    azure.workload.identity/use: 'true'
  annotations:
    azure.workload.identity/client-id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    azure.workload.identity/tenant-id: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: my-app
spec:
  provider: azure
  parameters:
    usePodIdentity: "false"
    clientID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    keyvaultName: my-kv
    tenantId: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

Proposal

Instead can the SecretProviderClass just use the ServiceAccount for clientID and tenantId?
for example

apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: my-app
spec:
  provider: azure
  parameters:
    usePodIdentity: "false"
    serviceAccountName: my-app
    keyvaultName: my-kv
@dkirrane dkirrane added the enhancement New feature or request label Sep 27, 2023
@rbtz-openai
Copy link

@aramase Can we bump the priority for this, or should we go through Azure Support to escalate?

@wenzel-felix
Copy link

#1443 I just opened this PR trying to adjust it similarly to your request.
Currently, it only takes care of the clientID, not the tenantID as the latter one is theoretically optional for the service account. I don't see it as big of an issue as the clientID, which potentially changes for every SPC. The tenantID is rather static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants