You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return"", fmt.Errorf("failed to get service account secret: %w", err)
}
return"Bearer "+string(secret.Data["token"]), nil
But ideally, we should instead use corev1.TokenRequestSpec.
I think something like
// Define the token TTL
tokenTTL := int64(3600) // 1 hour
// Create the TokenRequest API client
tokenRequestClient := s.k8sClient.CoreV1().ServiceAccounts(serviceAccount.Namespace)
// Create a TokenRequest object
tokenRequest := &corev1.TokenRequest{
Spec: corev1.TokenRequestSpec{
Audiences: []string{"https://kubernetes.default.svc/"}, // Adjust based on your use case
ExpirationSeconds: &tokenTTL,
},
}
// Request the token
tokenResponse, err := tokenRequestClient.CreateToken(ctx, serviceAccount.Name, tokenRequest, metav1.CreateOptions{})
```
## Use Cases
When using SSO with RBAC. This prevents create a static secret.
---
<!-- Issue Author: Don't delete this message to encourage other users to support your issue! -->
**Message from the maintainers**:
Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.
<!--
**Beyond this issue**:
Are you a contributor? If not, have you thought about it?
Argo Workflows is seeking more community involvement and ultimately more [Reviewers and Approvers](https://github.com/argoproj/argoproj/blob/main/community/membership.md) to help keep it viable.
See [Sustainability Effort](https://github.com/argoproj/argo-workflows/blob/main/community/sustainability_effort.md) for more information.
-->
The text was updated successfully, but these errors were encountered:
Summary
A security review in our project flagged the static secret created for SSO.
When setting SSO, we read a static token of a Service Account, with no TTL.
argo-workflows/server/auth/gatekeeper.go
Lines 320 to 326 in f470fda
But ideally, we should instead use
corev1.TokenRequestSpec
.I think something like
The text was updated successfully, but these errors were encountered: