Repository navigation
Commit 088381b
authored
atenet: Router checks the routed worker's SPIFFE ID on atunnel's cert (#2678)
Part of #2078 (Envoy dataplane, @EItanya @howardjohn for agw)
The router accepted any podidentity cert in the trust domain as atunnel,
so any pod in the cluster could pose as a worker. It now requires the
exact SPIFFE ID of the worker each request is routed to.
- atecontroller's syncer records the worker pod's SPIFFE ID on the
Worker (new `worker_spiffe_id`, built from the pod's namespace and
ServiceAccount), and ateapi copies it into the actor's worker
assignment. ateapi rejects a value that isn't a valid SPIFFE ID.
- ext_proc passes that ID to Envoy as is and refuses to route without
it. Envoy requires that exact SAN, on both the :443 and CONNECT paths.
`--upstream-spiffe-prefix` is removed; the cluster still checks the
trust domain.
- The Worker carries the SPIFFE ID rather than the ServiceAccount, so
the router doesn't need to know how the ID is built. A different ID
scheme only changes atecontroller.
- WorkerPools that don't set serviceAccountName now run as an
`ateworker` ServiceAccount the controller creates, instead of `default`,
so the worker's ID isn't shared with every other pod in the namespace.
Remaining gap: another pod running as the same ServiceAccount in the
same namespace can still pose as the worker. Closing it needs a signer
that puts the pod in the worker's SPIFFE ID; atecontroller would then
record that ID, with no router change.
#### Breaking change
- The router rejects workers registered before this change until their
pods are replaced. Pools on the default ServiceAccount roll
automatically; pools that set `spec.template.serviceAccountName` need a
restart. Upgrade atecontroller and ate-api-server before atenet-router.
- Workers now run as an `ateworker` ServiceAccount by default instead of
`default`. RBAC, Workload Identity bindings and imagePullSecrets
attached to `default` no longer apply to them; set `serviceAccountName:
default` or move those to `ateworker`.
- atenet-router no longer has `--upstream-spiffe-prefix`.
- atecontroller now needs create and patch on serviceaccounts (included
in the generated role).
> It's a good idea to open an issue first for discussion.
- [x] Tests pass
- [x] Appropriate changes to documentation are included in the PR1 parent ac296df commit 088381b
31 files changed
Lines changed: 485 additions & 71 deletions
File tree
- cmd
- ateapi/internal
- apivalidation
- controlapi
- atecontroller/internal
- controllers
- workersync
- atenet/internal/router
- ingress
- docs
- internal/installdefaults
- manifests/ate-install
- generated
- pkg
- api/v1alpha1
- proto/ateapipb
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
357 | 372 | | |
358 | 373 | | |
359 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
145 | 162 | | |
146 | 163 | | |
147 | 164 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| 613 | + | |
613 | 614 | | |
614 | 615 | | |
615 | 616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2689 | 2689 | | |
2690 | 2690 | | |
2691 | 2691 | | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
| 554 | + | |
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
908 | | - | |
| 908 | + | |
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
| |||
0 commit comments