-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Is your feature request related to a problem? Please describe.
Currently its not possible to use Kubernetes Service Account Tokens to authenticate to Harbor - instead you have long life tokens which are "insecure" and hard to maintain.
Describe the solution you'd like
Use of a kubelet-credential-provider (https://kubernetes.io/docs/tasks/administer-cluster/kubelet-credential-provider/) in combination with Service Account Token for Image Pulls to authenticate to Harbor with short-life tokens on Service level.
Describe the main design/architecture of your solution
(we can also throw everything out the window i'm fully open to other ideas)
- We need a possibility to verify Kubernetes Service Account Tokens
1.1 I propose to use the same oidc-workflow which vault/bao uses: Use Kubernetes for OIDC authentication
1.2 I'm not sure but maybe this is already more or less possible with the current Harbor OIDC-Integration - maybe there are only some minor changes needed
1.3 Maybe changes in the UI/API would be needed - to show the KSAT not as a User instead as a "federated Robot" - We need to write a kubelet-credential-provider
2.1 The Provider tests the Service Account Token to authenticate to Harbor and then passes it to kubelet
2.2 Similar Example
Describe the development plan you've considered
This needs help.
Additional context
Not sure if we really need to use the KSAT to authenticate to Harbor for image-pulls or maybe a Token exchange is better. (Provider Plugin uses the KSAT to get/generate a short-life image-pull-token which is then used by the kubelet) I think cleaner would be to use the KSAT directly - but i'm not sure how big this change would be.