Repository navigation
Commit 32241af
committed
feat(gateway): drop tenant-* ban on gateway-attached-namespaces
Removes two gates that prevented child tenants from attaching to a
parent's publishing Gateway:
1. Render-time fail() in templates/gateway-hostname-policy.yaml that
refused to render the chart when _cluster.gateway-attached-
namespaces contained any tenant-* entry.
2. cozystack-gateway-attached-namespaces-policy VAP that enforced
the same rule at Package CR admission time.
The original rationale — 'a tenant in attachedNamespaces can hijack
the publishing tenant's hostnames' — assumed a static-name
allowedRoutes whitelist where adding tenant-* literally widened the
attach surface for arbitrary hostnames. Under the inheritance
refactor (Stage 1/3/5) the attach surface is governed by the
namespace.cozystack.io/gateway label selector, not by entries in
AttachedNamespaces; and hostname hijack is independently blocked by
three other layers:
* Layer 4 — cozystack-tenant-host-policy VAP on Tenant.spec.host
* Layer 5 — cozystack-namespace-host-label-policy VAP on the
namespace label
* Layer 7 — cozystack-route-hostname-policy VAP on HTTPRoute and
TLSRoute hostnames
Those three defend against the hijack vector regardless of what
sits in attachedNamespaces, and they apply uniformly to every
tenant (inheriting or owning a Gateway). The dropped gates added
no extra defence, while their presence broke the inheritance flow
kvaps reasonably asks for in the May 25 review.
Doc count for gateway-hostname-policy.yaml drops from 8 to 6 (one
VAP + one Binding removed); helm-unittest fixtures updated to
match, with a regression-guard test asserting the removed VAP name
no longer appears in any rendered document.
Signed-off-by: Aleksei Sviridkin <[email protected]>1 parent 99fe080 commit 32241af
2 files changed
Lines changed: 54 additions & 112 deletions
File tree
- packages/system/cozystack-basics
- templates
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 1 | | |
9 | 2 | | |
10 | 3 | | |
| |||
58 | 51 | | |
59 | 52 | | |
60 | 53 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 54 | | |
102 | 55 | | |
103 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
9 | 22 | | |
10 | | - | |
| 23 | + | |
11 | 24 | | |
12 | 25 | | |
13 | | - | |
| 26 | + | |
14 | 27 | | |
15 | 28 | | |
16 | 29 | | |
| |||
76 | 89 | | |
77 | 90 | | |
78 | 91 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 92 | | |
110 | 93 | | |
111 | | - | |
| 94 | + | |
112 | 95 | | |
113 | 96 | | |
114 | 97 | | |
115 | | - | |
| 98 | + | |
116 | 99 | | |
117 | 100 | | |
118 | 101 | | |
119 | | - | |
| 102 | + | |
120 | 103 | | |
121 | 104 | | |
122 | 105 | | |
123 | | - | |
| 106 | + | |
124 | 107 | | |
125 | 108 | | |
126 | 109 | | |
127 | | - | |
| 110 | + | |
128 | 111 | | |
129 | 112 | | |
130 | 113 | | |
131 | | - | |
| 114 | + | |
132 | 115 | | |
133 | 116 | | |
134 | 117 | | |
135 | | - | |
| 118 | + | |
136 | 119 | | |
137 | 120 | | |
138 | 121 | | |
139 | 122 | | |
140 | 123 | | |
141 | 124 | | |
142 | | - | |
| 125 | + | |
143 | 126 | | |
144 | 127 | | |
145 | 128 | | |
146 | 129 | | |
147 | 130 | | |
148 | 131 | | |
149 | | - | |
| 132 | + | |
150 | 133 | | |
151 | 134 | | |
152 | 135 | | |
153 | | - | |
| 136 | + | |
154 | 137 | | |
155 | 138 | | |
156 | 139 | | |
157 | | - | |
| 140 | + | |
158 | 141 | | |
159 | 142 | | |
160 | 143 | | |
161 | | - | |
| 144 | + | |
162 | 145 | | |
163 | 146 | | |
164 | 147 | | |
165 | 148 | | |
166 | 149 | | |
167 | 150 | | |
168 | | - | |
| 151 | + | |
169 | 152 | | |
170 | 153 | | |
171 | 154 | | |
172 | | - | |
| 155 | + | |
173 | 156 | | |
174 | 157 | | |
175 | 158 | | |
176 | 159 | | |
177 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
178 | 167 | | |
179 | 168 | | |
180 | 169 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 170 | | |
187 | 171 | | |
188 | | - | |
| 172 | + | |
189 | 173 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
199 | 177 | | |
200 | | - | |
201 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
0 commit comments