Commit 6bb85ba
authored
certificate selector: on demand SDS (#42072)
Commit Message: add an extension to load certs via SDS on-demand instead
of warming SDS secret
Additional Description: the following objects are involved:
- `AsyncSelector` is the handshake override that pauses the handshake
with a callback;
- `SecretManager` maintains the set of TLS context configurations and
realized SSL objects;
- `AsyncContextConfig` maintains an active SDS subscription and emits
update events to `SecretManager` on SDS updates;
- `AsyncContext` converts SDS certificate into SSL objects using the
outer TLS configuration context;
- `SelectionHandle` a callback registration into `SecretManager` from
`AsyncSelector`.
A basic flow is as follows:
- `AsyncSelector` is invoked when a TLS handshake happens on the worker;
- It queries `SecretManager` thread-local storage for an active
`AsyncContext` for a mapped secret name;
- If it finds one, it latches onto it, and supplies its inner SSL
objects;
- If it doesn't find one, it forwards the handshake callback to
`SecretManager` on the main thread;
- `SecretManager` responds by creating an active SDS subscription. It's
possible a thread local did not make it to the worker, so it can
immediately answer the callback. More likely, it needs to save the
callback into a queue.
- When a `SecretManager` receives an SDS response, it tries creating
`AsyncContext` from it. If it succeeds, it can drain the callback queue
and post a thread local update.
- `SelectionHandle` is held as a weak_ptr to detect interrupted
handshakes and avoid responding to them.
Note that there is no locking involved, and at the steady state,
certificates are available on all workers.
Risk Level: low, new extension, secret code refactor should not impact
current behavior
Testing: added integration tests
Docs Changes: yes
Release Notes: yes
Issue: #30600
---------
Signed-off-by: Kuat Yessenov <kuat@google.com>1 parent 2c20937 commit 6bb85ba
96 files changed
Lines changed: 2564 additions & 776 deletions
File tree
- api
- envoy/extensions/transport_sockets/tls
- cert_mappers
- sni/v3
- static_name/v3
- cert_selectors/on_demand_secret/v3
- v3
- versioning
- changelogs
- contrib/postgres_proxy/filters/network/test
- docs/root
- api-v3/config
- certificate_mappers
- certificate_selectors
- configuration/security
- envoy
- secret
- ssl
- mobile/test/common/integration
- source
- common
- quic
- secret
- tls
- extensions
- transport_sockets/tls
- cert_mappers
- sni
- static_name
- cert_selectors/on_demand
- test
- common
- grpc
- quic
- secret
- tls
- cert_selector
- cert_validator
- extensions
- config_subscription/grpc
- filters/http/router
- transport_sockets
- starttls
- tls/cert_selectors/on_demand
- integration
- mocks
- secret
- ssl
- tools
- code_format
- extensions
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
389 | 392 | | |
390 | 393 | | |
391 | 394 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
| |||
0 commit comments