Cross-namespace references #497
Replies: 3 comments 10 replies
-
I would create a PAT per repository or per tenant, then you can place the pull secret, source and kustomization in the tenant namespace. You would then need a validation webhook that rejects kustomizations and helmreleases that have |
Beta Was this translation helpful? Give feedback.
-
I have to say going around RBAC makes me distinctly uncomfortable too. Is the motivating use case for cross-namespace references the one @simongottschlag described -- people want to be able to define a |
Beta Was this translation helpful? Give feedback.
-
The proposed "security model for impersonation" assumes cross-namespace references to sources are kept, but restricts their use by requiring everything using them to impersonate a user local to its namespace (Stefan also mentioned this idea in a comment, above, I believe). So, if your GitRepository is in flux-system, but you want a Kustomization that refers to it, your Kustomization must be given a local user that has access to the GitRepository in flux-system. This mitigates some of my unease around subverting RBAC. I think the strongest argument for cross-namespace references is that it means you can grant access to a source without giving away the secrets it uses. There's other ways of doing this -- the Cluster @simongottschlag See what you think of the impersonation proposal linked above, if you get a chance. |
Beta Was this translation helpful? Give feedback.
-
Hi!
We’re migrating our Kubernetes service for our customers from Flux v1 to v2 now and I’m starting to understand the new concepts better.
I’ve been thinking about a case that may be an issue for us:
The issue here is that there’s no obvious way of using RBAC to limit what GitRepositories can be used by different namespaces. team1 can in theory point to team2 repository. This should also be the case if the GitRepository is created in the team namespace, if I’m not wrong.
Our issue here is that we are using the Azure DevOps which doesn’t have deploy keys like all other providers. This means we use a key (PAT) for Azure DevOps with very high permissions for all repositories in all projects.
If we placed GitRepository object in the team namespace, they would have access to the PAT. In our case, we use the same PAT for each GitRepository, which means that cross-namespace references actually help us here - but causes a problem that other teams in theory can point to other GitRepositories.
My thought here is that we shouldn’t care about the limitations with Azure DevOps and think about all the other use cases, where team1 would be able to point their Kustomization to team2 GitRepository in team2 namespace.
That shouldn’t be possible, in my opinion - it breaks RBAC.
We are able to solve our use case with opa-gatekeeper limiting a Kustomization / HelmRelease in the team namespace to only use a GitRepository in flux-system namespace with the same name as the namespace. But this feels like a hack and something that shouldn't be needed, as Flux should be secure out of the box and not break RBAC.
What are other peoples thoughts on this? Am I missing something obvious?
Regards,
Simon
Beta Was this translation helpful? Give feedback.
All reactions