Commit 4278b27
committed
containers: Add experimental support for interceptOutboundHttps
`interceptOutboundHttps` is a way for users to intercept their own TLS
traffic.
The way this works is different from interceptOutboundHttp. In the first
one, we can decide which IP and port combinations should intercept HTTP
traffic, but HTTPS is more idiomatic to handle at the SNI level.
The reasoning behind this is that customers that want to intercept
TLS might want to only be triggering on certain SNIs being intercepted.
We do support currently other ports than 443 but that might change in the future by
extending the method to accept a port with the SNI. It's just the
use-case is clear to be SNI based only.
The glob format of the SNI that we accept is really simple, only '*' and the
domain (to support cases like *google.com and all its subdomains).
No plans on supporting regex here whatsoever.
The way local dev works is we generate the certificates in the
networking sidecar, we read it via exec, and write them to the
container to a known path
(/etc/cloudflare/certs/cloudflare-containers-ca.crt).
We could try to append the certificate to
known distro paths, but that might be a more controversial move, we can
discuss in the MR if it's worth doing.
The flow of the connection is:
```
[container] --> [proxy-everything] (tls) -->
[workerd container-client.c++] (processes configured egress policies) ->
[workerd subrequest channel]
```
The only way to make files being written consistently across distros is
by using the Docker /archive API. It can only accept a tar right now, so
we had to add a method that creates a simple tar file that contains a
single file that we want to add to the container (the CA).1 parent a68feff commit 4278b27
15 files changed
Lines changed: 53103 additions & 24 deletions
File tree
- .opencode
- images/container-client-test
- src/workerd
- api
- io
- server
- tests/container-client
- types/generated-snapshot
- experimental
- generated-snapshot
- experimental
- latest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
| |||
66 | 85 | | |
67 | 86 | | |
68 | 87 | | |
69 | | - | |
| 88 | + | |
| 89 | + | |
70 | 90 | | |
71 | 91 | | |
72 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
124 | 135 | | |
125 | 136 | | |
126 | 137 | | |
0 commit comments