-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Other providers for the Secrets Store CSI driver leverage the CSI driver's (not the provider's) ability to obtain service account tokens for pods that use that CSI driver (see here). This way, the providers nor the driver need the create
serviceaccounts/token
role.
Code in question:
secrets-store-csi-driver-provider-aws/auth/auth.go
Lines 49 to 62 in b8df495
func (p authTokenFetcher) FetchToken(ctx credentials.Context) ([]byte, error) { | |
// Use the K8s API to fetch the token from the OIDC provider. | |
tokRsp, err := p.k8sClient.ServiceAccounts(p.nameSpace).CreateToken(ctx, p.svcAcc, &authv1.TokenRequest{ | |
Spec: authv1.TokenRequestSpec{ | |
Audiences: []string{tokenAudience}, | |
}, | |
}, metav1.CreateOptions{}) | |
if err != nil { | |
return nil, err | |
} | |
return []byte(tokRsp.Status.Token), nil | |
} |
Examples of this from other providers:
Without this, the AWS provider will continue to be over-privileged.
micahhausler
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request