@@ -224,11 +224,14 @@ To enforce tenant isolation, cluster admins must configure Flux to reconcile
224
224
the ` Kustomization ` and ` HelmRelease ` kinds by impersonating a service account
225
225
from the namespace where these objects are created.
226
226
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
228
228
at Control Plane level without the need of external admission controllers (e.g. Kyverno). The
229
229
recommended patch:
230
230
231
231
- 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.
232
235
- Sets a default service account via ` --default-service-account ` to ` kustomize-controller ` and ` helm-controller ` .
233
236
Meaning that, if a tenant does not specify a service account in a Flux ` Kustomization ` or
234
237
` HelmRelease ` , it would automatically default to said account.
@@ -243,19 +246,26 @@ This repository applies this patch automatically via
243
246
apiVersion : kustomize.config.k8s.io/v1beta1
244
247
kind : Kustomization
245
248
resources :
246
- - gotk-components.yaml
247
- - gotk-sync.yaml
249
+ - gotk-components.yaml
250
+ - gotk-sync.yaml
248
251
patches :
249
252
- patch : |
250
253
- op: add
251
- path: /spec/template/spec/containers/0/args/0
254
+ path: /spec/template/spec/containers/0/args/-
252
255
value: --no-cross-namespace-refs=true
253
256
target:
254
257
kind: Deployment
255
258
name: "(kustomize-controller|helm-controller|notification-controller|image-reflector-controller|image-automation-controller)"
256
259
- patch : |
257
260
- 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/-
259
269
value: --default-service-account=default
260
270
target:
261
271
kind: Deployment
@@ -362,7 +372,6 @@ Other policies to explore:
362
372
- For `HelmRepository` and `GitRepository` consider which protocols should be allowed.
363
373
- For `Bucket`, consider restrictions on providers and regions.
364
374
365
-
366
375
# ### Make serviceAccountName mandatory
367
376
368
377
The 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:
602
611
and tests the staging setup by running Flux in Kubernetes Kind
603
612
604
613
605
- [Flux v0.26] : https://github.com/fluxcd/flux2/releases/tag/v0.26.0
606
614
[multi-tenancy lockdown] : https://fluxcd.io/flux/installation/configuration/multitenancy/
0 commit comments