Commit 4ab4ade
committed
Harden untrusted mode after duplication and reuse review
Consolidate the private-IP classifier: the egress broker's dial
allowlist now uses networking.IsPrivateIP instead of a second local
table, gaining NAT64 embedded-IPv4 decoding (64:ff9b::/96,
64:ff9b:1::/48) so a crafted DNS answer can no longer smuggle the
cloud metadata endpoint past D7 on NAT64 networks. The shared
classifier absorbs the two benchmarking prefixes the egress table
had, making the merged set a strict superset.
Render the Envoy bootstrap as data: all config-derived values
(vhosts, routes, ext_authz address, scan posture) go through
yaml.Marshal instead of string substitution, matching the operator
side and removing the reliance on cross-package validation alone.
TokenMap rebuilt on hashicorp/golang-lru/v2 (already a dependency),
keeping consume-on-read semantics via Peek+Remove under the map
mutex; the hand-rolled container/list machinery is gone.
Converge tokenenc on pkg/secrets/aes: new EncryptWithAAD/
DecryptWithAAD helpers carry the nonce|ct|tag convention and size
bound; tokenenc deletes its duplicated GCM boilerplate and calls
them, keeping the redis-key AAD cut-and-paste defense.
Also: slices.Contains/Sort/ContainsFunc in the policy hot path, and
cross-referenced drift-guard comments between the operator and vMCP
secret-material gate test suites.1 parent 0cc06ff commit 4ab4ade
10 files changed
Lines changed: 388 additions & 179 deletions
File tree
- cmd/thv-operator/pkg/controllerutil
- pkg
- authserver/tokenenc
- egressbroker
- networking
- secrets/aes
- vmcp/session/untrusted
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
0 commit comments