Context:
- running on EKS, using IRSA and pod-identity-webhook
- multiple tenants should be onboarded onto the cluster
- we're enforcing
spec.serviceAccountName
- one tenant should not be able to decrypt secrets of other tenants
Problem:
Right now, kustomize-controller uses a local set of credentials that are defined by environment variables. These credentials allow the controller to make API calls against AWS.
I want to onboard multiple tenants and they should not be able to decrypt the secrets of other tenants. However, since they share the same set of credentials they can decrypt secrets of other tenants.
With GPG we have a better tenant isolation due to the fact that Kind=Kustomization is namespaced and it stores a local reference to a gpg private key. (i.e. one gpg-key per namespace).
Proposed solutions:
(1) use multiple flux instances
This is meh for obvious reasons. Question: can i have multiple kustomize-controllers ? Would you support having sth. similar to ingressClassName to shard responsibilities between controllers?
(2) use serviceAccount/TokenRequest API
Since the Kustomization refers to an spec.serviceAccountName we could implement sth. similar to the service account token volume projection API in Kubelet (docs).
We can feed those tokens into the aws sdk to do a sts:assumeRoleWithWebIdentity this needs to be implemented in the sops repo, of course.
With that we basicially mimic the behavior of the eks-pod-identity-webhook but have the ability to assume multiple roles within one pod. I'm not sure yet what implications that has to elevate the privileges to use the token request api.
Context:
spec.serviceAccountNameProblem:
Right now,
kustomize-controlleruses a local set of credentials that are defined by environment variables. These credentials allow the controller to make API calls against AWS.I want to onboard multiple tenants and they should not be able to decrypt the secrets of other tenants. However, since they share the same set of credentials they can decrypt secrets of other tenants.
With GPG we have a better tenant isolation due to the fact that
Kind=Kustomizationis namespaced and it stores a local reference to a gpg private key. (i.e. one gpg-key per namespace).Proposed solutions:
(1) use multiple flux instances
This is meh for obvious reasons. Question: can i have multiple
kustomize-controllers? Would you support having sth. similar toingressClassNameto shard responsibilities between controllers?(2) use serviceAccount/TokenRequest API
Since the Kustomization refers to an
spec.serviceAccountNamewe could implement sth. similar to the service account token volume projection API in Kubelet (docs).We can feed those tokens into the aws sdk to do a
sts:assumeRoleWithWebIdentitythis needs to be implemented in the sops repo, of course.With that we basicially mimic the behavior of the eks-pod-identity-webhook but have the ability to assume multiple roles within one pod. I'm not sure yet what implications that has to elevate the privileges to use the token request api.