@@ -224,11 +224,14 @@ To enforce tenant isolation, cluster admins must configure Flux to reconcile
224224the ` Kustomization ` and ` HelmRelease ` kinds by impersonating a service account
225225from the namespace where these objects are created.
226226
227- [ Flux v0.26 ] introduced built-in [ multi-tenancy lockdown] features which enables tenant isolation
227+ Flux has built-in [ multi-tenancy lockdown] features which enables tenant isolation
228228at Control Plane level without the need of external admission controllers (e.g. Kyverno). The
229229recommended patch:
230230
231231- Enforce controllers to block cross namespace references.
232+ Meaning that a tenant can’t use another tenant’s sources or subscribe to their events.
233+ - Deny accesses to Kustomize remote bases, thus ensuring all resources refer to local files.
234+ Meaning that only approved Flux Sources can affect the cluster-state.
232235- Sets a default service account via ` --default-service-account ` to ` kustomize-controller ` and ` helm-controller ` .
233236 Meaning that, if a tenant does not specify a service account in a Flux ` Kustomization ` or
234237 ` HelmRelease ` , it would automatically default to said account.
@@ -243,19 +246,26 @@ This repository applies this patch automatically via
243246apiVersion : kustomize.config.k8s.io/v1beta1
244247kind : Kustomization
245248resources :
246- - gotk-components.yaml
247- - gotk-sync.yaml
249+ - gotk-components.yaml
250+ - gotk-sync.yaml
248251patches :
249252 - patch : |
250253 - op: add
251- path: /spec/template/spec/containers/0/args/0
254+ path: /spec/template/spec/containers/0/args/-
252255 value: --no-cross-namespace-refs=true
253256 target:
254257 kind: Deployment
255258 name: "(kustomize-controller|helm-controller|notification-controller|image-reflector-controller|image-automation-controller)"
256259 - patch : |
257260 - op: add
258- path: /spec/template/spec/containers/0/args/0
261+ path: /spec/template/spec/containers/0/args/-
262+ value: --no-remote-bases=true
263+ target:
264+ kind: Deployment
265+ name: "kustomize-controller"
266+ - patch : |
267+ - op: add
268+ path: /spec/template/spec/containers/0/args/-
259269 value: --default-service-account=default
260270 target:
261271 kind: Deployment
@@ -362,7 +372,6 @@ Other policies to explore:
362372- For `HelmRepository` and `GitRepository` consider which protocols should be allowed.
363373- For `Bucket`, consider restrictions on providers and regions.
364374
365-
366375# ### Make serviceAccountName mandatory
367376
368377The lockdown patch sets a default service account that is applied to any `Kustomization` and `HelmRelease`
@@ -602,5 +611,4 @@ This repository contains the following GitHub CI workflows:
602611 and tests the staging setup by running Flux in Kubernetes Kind
603612
604613
605- [Flux v0.26] : https://github.com/fluxcd/flux2/releases/tag/v0.26.0
606614[multi-tenancy lockdown] : https://fluxcd.io/flux/installation/configuration/multitenancy/
0 commit comments