Skip to content

Commit e487e6a

Browse files
feat: prepare 0.12.0 release (#58)
1 parent 1152deb commit e487e6a

46 files changed

Lines changed: 3504 additions & 1601 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-links.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Check Links
4+
5+
permissions: {}
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- "*"
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
linkChecker:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
- name: Check unrendered links
22+
id: lychee_unrendered
23+
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1
24+
env:
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
with:
27+
fail: true
28+
debug: false
29+
args: --github-token ${{secrets.GITHUB_TOKEN}} --config config/lychee.toml --max-concurrency 2 --max-retries 3 --retry-wait-time 5 --accept 200,429 --timeout 60 -E ./content

.lycheeignore

Whitespace-only changes.

config/lychee.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude_path = ["public/docs/reference/"]

content/en/docs/guides/use-fluxcd.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,18 @@ spec:
168168
In example, the cluster admin is supposed to apply this Kustomization, during the cluster bootstrap that i.e. will reconcile also Flux itself.
169169
All the remaining Reconciliation resources can be children of this Kustomization.
170170

171-
![bootstrap](./assets/kustomization-hierarchy-root-tenants.png)
171+
![bootstrap](/images/assets/kustomization-hierarchy-root-tenants.png)
172172

173173
### Namespace-as-a-Service
174174

175175
Tenants could have his own set of Namespaces to operate on but it should be prepared by higher-level roles, like platform admins: the declarations would be part of the platform space.
176176
They would be responsible of tenants administration, and each change (e.g. new tenant Namespace) should be a request that would pass through approval.
177177

178-
![no-naas](./assets/flux-tenants-reconciliation.png)
178+
![no-naas](/images/assets/flux-tenants-reconciliation.png)
179179

180180
What if we would like to provide tenants the ability to manage also their own space the GitOps-way? Enter Capsule.
181181

182-
![naas](./assets/flux-tenants-capsule-reconciliation.png)
182+
![naas](/images/assets/flux-tenants-capsule-reconciliation.png)
183183

184184
## Manual setup
185185

@@ -311,7 +311,7 @@ To deepen on this please go to [#Insights](#insights).
311311

312312
### How to setup Tenants GitOps-ready
313313

314-
Given that [Capsule](github.com/projectcapsule/capsule) and [Capsule Proxy](github.com/clastix/capsule-proxy) are installed, and [Flux v2](https://github.com/fluxcd/flux2) configured with [multi-tenancy lockdown](https://fluxcd.io/docs/installation/#multi-tenancy-lockdown) features, of which the patch below:
314+
Given that [Capsule](https://github.com/projectcapsule/capsule) and [Capsule Proxy](/docs/proxy) are installed, and [Flux v2](https://github.com/fluxcd/flux2) configured with [multi-tenancy lockdown](https://fluxcd.io/docs/installation/#multi-tenancy-lockdown) features, of which the patch below:
315315

316316
```yaml
317317
apiVersion: kustomize.config.k8s.io/v1beta1
@@ -351,21 +351,26 @@ patches:
351351

352352
this is the required set of resources to setup a Tenant:
353353
- `Namespace`: the Tenant GitOps Reconciler "home". This is not part of the Tenant to avoid a chicken & egg problem:
354+
354355
```yaml
355356
apiVersion: v1
356357
kind: Namespace
357358
metadata:
358359
name: my-tenant
359360
```
361+
360362
- `ServiceAccount` of the Tenant GitOps Reconciler, in the above `Namespace`:
363+
361364
```yaml
362365
apiVersion: v1
363366
kind: ServiceAccount
364367
metadata:
365368
name: gitops-reconciler
366369
namespace: my-tenant
367370
```
371+
368372
- `Tenant` resource with the above Tenant GitOps Reconciler's SA as Tenant Owner, with:
373+
369374
- Additional binding to *cluster-admin* `ClusterRole` for the Tenant's `Namespace`s and `Namespace` of the Tenant GitOps Reconciler' `ServiceAccount`.
370375
By default Capsule binds only `admin` ClusterRole, which has no privileges over Custom Resources, but *cluster-admin* has. This is needed to operate on Flux CRs:
371376
```yaml
@@ -531,42 +536,40 @@ This is because we need to make tenant reconciliation requests through Capsule P
531536

532537
### Threats
533538

534-
##### Bypass unprivileged impersonation
539+
#### Bypass unprivileged impersonation
535540

536541
The reason why we can't set impersonation to be optional is because, as each tenant is allowed to not specify neither the kubeconfig nor the impersonation SA for the Reconciliation resource, and because in any case that kubeconfig could contain whatever privileged credentials, Flux would otherwise use the privileged ServiceAccount, to reconcile tenant resources.
537542

538543
That way, a tenant would be capable of managing the GitOps way the cluster as he was a cluster admin.
539544

540545
Furthermore, let's see if there are other vulnerabilities we are able to protect from.
541546

542-
##### Impersonate privileged SA
547+
#### Impersonate privileged SA
543548

544549
Then, what if a tenant tries to escalate by using one of the Flux controllers privileged `ServiceAccount`s?
545550

546551
As `spec.ServiceAccountName` for Reconciliation resource cannot cross-namespace reference Service Accounts, tenants are able to let Flux apply his own resources only with ServiceAccounts that reside in his own Namespaces. Which is, Namespace of the ServiceAccount and Namespace of the Reconciliation resource must match.
547552

548553
He could neither create the Reconciliation resource where a privileged ServiceAccount is present (like flux-system), as the Namespace has to be owned by the Tenant. Capsule would block those Reconciliation resource creation requests.
549554

550-
##### Create and impersonate privileged SA
555+
#### Create and impersonate privileged SA
551556

552557
Then, what if a tenant tries to escalate by creating a privileged `ServiceAccount` inside on of his own `Namespace`s?
553558

554559
A tenant could create a `ServiceAccount` in an owned `Namespace`, but he can't neither bind at cluster-level nor at a non-owned Namespace-level a ClusterRole, as that wouldn't be permitted by Capsule admission controllers.
555560

556561
Now let's go on with the practical part.
557562

558-
##### Change ownership of privileged Namespaces (e.g. flux-system)
563+
#### Change ownership of privileged Namespaces (e.g. flux-system)
559564

560565
He could try to use privileged `ServiceAccount` by changing ownership of a privileged Namespace so that he could create Reconciliation resource there and using the privileged SA.
561566
This is not permitted as he can't patch Namespaces which have not been created by him. Capsule request validation would not pass.
562567

563-
For other protections against threats in this multi-tenancy scenario please see the Capsule [Multi-Tenancy Benchmark](/docs/general/mtb).
568+
For other protections against threats in this multi-tenancy scenario please see the Capsule [Multi-Tenancy Benchmark](/docs/overview/benchmark/).
564569

565570
## References
566571
- https://fluxcd.io/docs/installation/#multi-tenancy-lockdown
567572
- https://fluxcd.io/blog/2022/05/may-2022-security-announcement/
568-
- https://github.com/clastix/capsule-proxy/issues/218
573+
- https://github.com/projectcapsule/capsule-proxy/issues/218
569574
- https://github.com/projectcapsule/capsule/issues/528
570-
- https://github.com/clastix/flux2-capsule-multi-tenancy
571-
- https://github.com/fluxcd/flux2-multi-tenancy
572575
- https://fluxcd.io/docs/guides/repository-structure/

0 commit comments

Comments
 (0)