|
1 | 1 | // This tailnet's ACLs are maintained in https://github.com/rajsinghtech/kubernetes-manifests |
2 | 2 | { |
3 | | - // ============================================================================ |
4 | | - // NETWORK CONFIGURATION |
5 | | - // ============================================================================ |
6 | | - |
7 | 3 | "randomizeClientPort": false, |
8 | | - |
9 | | - // ============================================================================ |
10 | | - // NETWORK DEFINITIONS |
11 | | - // ============================================================================ |
12 | | - |
13 | | - // IP sets for subnet routing and network segmentation |
14 | 4 | "ipsets": { |
15 | 5 | // Robbinsdale site networks |
16 | 6 | "ipset:robbinsdale": [ |
|
20 | 10 | "10.0.0.0/16", // Service network range |
21 | 11 | "10.1.0.0/16", // Pod network range |
22 | 12 | ], |
23 | | - |
24 | 13 | // Ottawa site networks |
25 | 14 | "ipset:ottawa": [ |
26 | 15 | "192.168.169.0/24", // Main LAN |
|
29 | 18 | "10.2.0.0/16", // Service network range |
30 | 19 | "10.3.0.0/16", // Pod network range |
31 | 20 | ], |
32 | | - |
33 | 21 | // St Petersburg site networks |
34 | 22 | "ipset:stpetersburg": [ |
35 | 23 | "192.168.73.0/24", // Main LAN |
36 | | - "10.69.3.0/24", // LB network range |
| 24 | + "10.73.3.0/24", // LB network range |
37 | 25 | "10.4.0.0/16", // Service network range |
38 | 26 | "10.5.0.0/16", // Pod network range |
39 | 27 | "fd7a:115c:a1e0:b1a:0:3::/96", // 4via6 subnet |
40 | 28 | ], |
41 | | - |
42 | | - // US West 2 site networks |
43 | | - "ipset:usw2": [ |
44 | | - "10.226.0.0/16", // Main VPC CIDR |
45 | | - "10.80.0.0/16", // Pod network range |
46 | | - "10.81.0.0/16", // Service network range |
47 | | - "fd7a:115c:a1e0:b1a:0:4::/96" // 4via6 subnet |
48 | | - ], |
49 | 29 | }, |
50 | | - |
51 | | - // ============================================================================ |
52 | | - // GROUPS |
53 | | - // ============================================================================ |
54 | | - |
55 | | - // Define user groups for access control |
56 | 30 | "groups": { |
57 | 31 | "group:superuser": [ |
58 | 32 | "kbpersonal@github", |
|
61 | 35 | |
62 | 36 | ] |
63 | 37 | }, |
64 | | - |
65 | | - // ============================================================================ |
66 | | - // TAG OWNERSHIP & MANAGEMENT |
67 | | - // ============================================================================ |
68 | | - |
69 | | - // Define who can assign and manage each tag |
70 | 38 | "tagOwners": { |
71 | 39 | // Core infrastructure tags |
72 | 40 | "tag:k8s-operator": [], |
73 | 41 | "tag:k8s": ["tag:k8s-operator", "autogroup:admin"], |
74 | | - "tag:k8s-recorder": ["tag:k8s-operator", "autogroup:admin"], |
75 | | - "tag:infra": ["autogroup:admin", "tag:infra"], |
76 | | - "tag:udm": ["autogroup:admin", "tag:infra"], |
77 | | - |
| 42 | + "tag:k8s-recorder": ["tag:k8s-operator"], |
| 43 | + "tag:udm": ["autogroup:admin"], |
78 | 44 | // Site-specific tags |
79 | | - "tag:keiretsu": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
80 | | - "tag:robbinsdale": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
81 | | - "tag:ottawa": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
82 | | - "tag:stpetersburg": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
83 | | - "tag:pittsburgh": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
84 | | - "tag:use1": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
85 | | - "tag:usw2": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
86 | | - "tag:kind": ["tag:k8s-operator", "autogroup:admin", "tag:infra"], |
87 | | - |
88 | | - // Site-specific infrastructure tags |
89 | | - "tag:ottawa-infra": ["autogroup:admin", "tag:infra"], |
90 | | - |
91 | | - // TCP-443-only tag |
92 | | - "tag:restricted-outbound": ["tag:k8s-operator", "autogroup:admin"], |
| 45 | + "tag:robbinsdale": ["tag:k8s-operator", "autogroup:admin"], |
| 46 | + "tag:ottawa": ["tag:k8s-operator", "autogroup:admin"], |
| 47 | + "tag:stpetersburg": ["tag:k8s-operator", "autogroup:admin"], |
93 | 48 | }, |
94 | | - |
95 | | - // ============================================================================ |
96 | | - // AUTO-APPROVAL RULES |
97 | | - // ============================================================================ |
98 | | - |
99 | 49 | // Automatically approve certain requests without manual intervention |
100 | 50 | "autoApprovers": { |
101 | 51 | "exitNode": ["tag:k8s"], |
102 | 52 | "routes": { |
103 | 53 | "0.0.0.0/0": ["tag:k8s"], // Default route (exit node) |
104 | 54 | "::/0": ["tag:k8s"], // IPv6 default route |
105 | 55 | "192.168.50.0/24": ["tag:robbinsdale"], // Robbinsdale LAN |
106 | | - "192.168.169.0/24": ["tag:ottawa", "tag:ottawa-infra"], // Ottawa LAN |
| 56 | + "192.168.169.0/24": ["tag:ottawa"], // Ottawa LAN |
107 | 57 | "192.168.73.0/24": ["tag:stpetersburg"], // St Petersburg LAN |
108 | | - "10.80.0.0/16": ["tag:ottawa-infra"], // US West 2 EKS Hybrid cluster control plane/Ottawa worker node pod cidr |
109 | | - "10.81.0.0/16": ["tag:ottawa-infra"], // US West 2 EKS Hybrid cluster control plane/Ottawa worker node pod cidr |
110 | | - "10.226.0.0/16": ["tag:usw2"], // US West 2 VPC cidr |
111 | 58 | }, |
112 | 59 | "services": { |
113 | | - "tag:keiretsu": ["tag:k8s"], |
114 | 60 | "tag:k8s": ["tag:k8s"], |
115 | 61 | }, |
116 | 62 | }, |
117 | | - |
118 | | - // ============================================================================ |
119 | | - // SSH ACCESS CONFIGURATION |
120 | | - // ============================================================================ |
121 | | - |
122 | 63 | // Define SSH access policies |
123 | 64 | "ssh": [ |
124 | 65 | { |
125 | 66 | "action": "accept", |
126 | 67 | "src": ["group:superuser"], |
127 | | - "dst": ["tag:ottawa", "tag:ottawa-infra", "tag:robbinsdale"], |
| 68 | + "dst": ["tag:ottawa", "tag:robbinsdale", "tag:stpetersburg"], |
128 | 69 | "users": ["root", "autogroup:nonroot"], |
129 | 70 | "recorder": ["tag:k8s-recorder"], |
130 | 71 | "enforceRecorder": true, |
131 | 72 | }, |
132 | 73 | ], |
133 | | - |
134 | | - // ============================================================================ |
135 | | - // ACCESS GRANTS (NETWORK & APPLICATION POLICIES) |
136 | | - // ============================================================================ |
137 | | - |
138 | 74 | "grants": [ |
139 | | - // ------------------------------------------------------------------------ |
140 | | - // BASIC NETWORK ACCESS |
141 | | - // ------------------------------------------------------------------------ |
142 | | - |
143 | | - // Allow Superuser to access all robbinsdale nodes |
144 | | - { |
145 | | - "src": ["group:superuser", "ipset:robbinsdale", "tag:robbinsdale"], |
146 | | - "dst": ["tag:robbinsdale"], |
147 | | - "ip": ["*"], |
148 | | - "app": { |
149 | | - "rajsingh.info/cap/tsdnsproxy": [ |
150 | | - { |
151 | | - "robbinsdale.k8s": { |
152 | | - "dns": ["10.0.0.10:53"], |
153 | | - "rewrite": "svc.cluster.local", |
154 | | - "translateid": 1 |
155 | | - } |
156 | | - } |
157 | | - ] |
158 | | - } |
159 | | - }, |
160 | | - |
161 | | - // Allow Superuser to access all ottawa nodes |
162 | | - { |
163 | | - "src": ["group:superuser", "tag:ottawa"], |
164 | | - "dst": ["tag:ottawa"], |
165 | | - "ip": ["*"], |
166 | | - "app": { |
167 | | - "rajsingh.info/cap/tsdnsproxy": [ |
168 | | - { |
169 | | - "ottawa.k8s": { |
170 | | - "dns": ["10.2.0.10:53"], |
171 | | - "rewrite": "svc.cluster.local", |
172 | | - "translateid": 2 |
173 | | - } |
174 | | - } |
175 | | - ] |
176 | | - } |
177 | | - }, |
178 | | - // Kubernetes operator internal networking |
| 75 | + // Allow members to access their own devices |
179 | 76 | { |
180 | | - "src": ["tag:k8s-operator"], |
181 | | - "dst": ["tag:k8s"], |
| 77 | + "src": ["autogroup:member"], |
| 78 | + "dst": ["autogroup:self"], |
182 | 79 | "ip": ["*"], |
183 | 80 | }, |
184 | | - |
| 81 | + // Allow Superuser to access all location nodes |
| 82 | + { |
| 83 | + "src": ["group:superuser", "tag:ottawa", "tag:robbinsdale", "tag:stpetersburg"], |
| 84 | + "dst": ["tag:ottawa", "tag:robbinsdale", "tag:stpetersburg"], |
| 85 | + "ip": ["*"], |
| 86 | + }, |
185 | 87 | // Allow members to reach k8s nodes and directly |
186 | 88 | { |
187 | | - "src": ["group:superuser", "tag:k8s", "tag:k8s-operator"], |
188 | | - "dst": ["tag:k8s",], |
| 89 | + "src": ["tag:k8s"], |
| 90 | + "dst": ["tag:k8s"], |
189 | 91 | "ip": ["*"], |
190 | 92 | }, |
191 | | - |
192 | 93 | // Allow members to reach udm nodes |
193 | 94 | { |
194 | 95 | "src": ["group:superuser", "tag:udm", "tag:k8s", "tag:k8s-operator"], |
|
198 | 99 | "tailscale.com/cap/relay": [], |
199 | 100 | }, |
200 | 101 | }, |
201 | | - |
202 | | - // Allow members to access their own devices |
203 | | - { |
204 | | - "src": ["autogroup:member"], |
205 | | - "dst": ["autogroup:self"], |
206 | | - "ip": ["*"], |
207 | | - }, |
208 | | - |
209 | 102 | // Allow members to use nodes as exit nodes and app connector |
210 | 103 | { |
211 | 104 | "src": ["group:superuser", "tag:k8s"], |
212 | 105 | "dst": ["autogroup:internet"], |
213 | 106 | "ip": ["*"], |
214 | 107 | "via": ["tag:robbinsdale", "tag:ottawa"], |
215 | 108 | }, |
216 | | - |
217 | | - // Allow tailscale logstream to access k8s nodes |
218 | | - { |
219 | | - "src": ["logstream@tailscale"], |
220 | | - "dst": ["tag:k8s"], |
221 | | - "ip": ["tcp:8088"], |
222 | | - }, |
223 | | - |
224 | | - // ------------------------------------------------------------------------ |
225 | | - // SUBNET ROUTE ACCESS |
226 | | - // ------------------------------------------------------------------------ |
227 | | - |
228 | 109 | // Access to subnets via subnet routers |
229 | 110 | { |
230 | | - "src": ["group:superuser", "tag:ottawa", "tag:usw2", "tag:robbinsdale"], |
| 111 | + "src": ["group:superuser", "tag:ottawa", "tag:stpetersburg"], |
231 | 112 | "dst": ["ipset:robbinsdale"], |
232 | 113 | "ip": ["*"], |
233 | 114 | "via": ["tag:robbinsdale"], |
234 | 115 | }, |
235 | 116 | { |
236 | | - "src": ["tag:ottawa-infra", "ipset:ottawa"], |
237 | | - "dst": ["ipset:usw2"], |
238 | | - "ip": ["*"], |
239 | | - "via": ["tag:usw2"], |
240 | | - }, |
241 | | - { |
242 | | - "src": ["group:superuser", "tag:robbinsdale", "tag:usw2", "tag:ottawa"], |
| 117 | + "src": ["group:superuser", "tag:robbinsdale", "tag:stpetersburg"], |
243 | 118 | "dst": ["ipset:ottawa"], |
244 | 119 | "ip": ["*"], |
245 | 120 | "via": ["tag:ottawa"], |
246 | 121 | }, |
247 | 122 | { |
248 | | - "src": ["group:superuser"], |
| 123 | + "src": ["group:superuser", "tag:robbinsdale", "tag:ottawa"], |
249 | 124 | "dst": ["ipset:stpetersburg"], |
250 | 125 | "ip": ["*"], |
251 | 126 | "via": ["tag:stpetersburg"], |
252 | 127 | }, |
253 | | - |
254 | | - // ------------------------------------------------------------------------ |
255 | | - // KUBERNETES |
256 | | - // ------------------------------------------------------------------------ |
257 | | - |
258 | 128 | // Admin access to Kubernetes API with system:masters privileges |
259 | 129 | { |
260 | 130 | "src": ["group:superuser", "tag:k8s"], |
261 | | - "dst": ["tag:k8s","tag:k8s-operator"], |
| 131 | + "dst": ["tag:k8s-operator", "tag:k8s"], |
262 | 132 | "ip": ["*"], |
263 | 133 | "app": { |
264 | 134 | "tailscale.com/cap/kubernetes": [ |
|
277 | 147 | ], |
278 | 148 | }, |
279 | 149 | }, |
280 | | - |
281 | 150 | // Member access to Kubernetes API with read-only privileges |
282 | 151 | { |
283 | 152 | "src": ["autogroup:member"], |
284 | | - "dst": ["tag:k8s","tag:k8s-operator"], |
| 153 | + "dst": ["tag:k8s-operator","tag:k8s"], |
285 | 154 | "ip": ["*"], |
286 | 155 | "app": { |
287 | 156 | "tailscale.com/cap/kubernetes": [ |
|
296 | 165 | }, |
297 | 166 | }, |
298 | 167 | ], |
299 | | - |
300 | | - // ============================================================================ |
301 | | - // NODE ATTRIBUTES & CAPABILITIES |
302 | | - // ============================================================================ |
303 | | - |
304 | 168 | "nodeAttrs": [ |
305 | 169 | { |
306 | 170 | "target": ["*"], |
|
346 | 210 | // "only-tcp-443", |
347 | 211 | ], |
348 | 212 | }, |
349 | | - |
350 | | - // Restricted outbound configuration |
351 | | - { |
352 | | - "target": ["tag:restricted-outbound"], |
353 | | - "attr": ["only-tcp-443"], |
354 | | - }, |
355 | 213 | ], |
356 | | - |
357 | | - // ============================================================================ |
358 | | - // Test ACLs |
359 | | - // ============================================================================ |
360 | | - |
361 | 214 | // Define test ACLs |
362 | 215 | "tests": [ |
363 | 216 | { |
|
378 | 231 | "rajsinghtech@github:53", |
379 | 232 | ] |
380 | 233 | }, |
381 | | - { |
382 | | - // K8s operator user test ACLs |
383 | | - "src": "tag:k8s-operator", |
384 | | - "accept": [ |
385 | | - "tag:k8s:443", |
386 | | - ] |
387 | | - }, |
388 | 234 | { |
389 | 235 | // K8s user |
390 | 236 | "src": "tag:k8s", |
|
398 | 244 | "src": "tag:robbinsdale", |
399 | 245 | "accept": [ |
400 | 246 | "192.168.169.1:443", |
401 | | - "192.168.50.1:443", |
402 | 247 | ], |
| 248 | + "deny": [ |
| 249 | + "192.168.50.1:443", |
| 250 | + ] |
403 | 251 | }, |
404 | 252 | { |
405 | 253 | // Ottawa cannot reach it's own LAN |
406 | 254 | "src": "tag:ottawa", |
407 | 255 | "accept": [ |
408 | 256 | "192.168.50.1:443", |
409 | | - "192.168.169.1:443", |
410 | | - "192.168.169.114:6443", |
411 | | - ], |
412 | | - }, |
413 | | - { |
414 | | - // Tailscale Access |
415 | | - "src": "logstream@tailscale", |
416 | | - "accept": [ |
417 | | - "tag:k8s:8088", |
418 | 257 | ], |
| 258 | + "deny": [ |
| 259 | + "192.168.169.1:443", |
| 260 | + ] |
419 | 261 | }, |
420 | 262 | ], |
421 | | - |
422 | | - |
423 | | - // ============================================================================ |
424 | | - // LEGACY CONFIGURATION (DEPRECATED) |
425 | | - // ============================================================================ |
426 | | - |
427 | 263 | // Legacy ACL rules (deprecated - using grants instead) |
428 | 264 | "acls": [{ |
429 | 265 | // Private log streaming enables audit and network logs to be directly |
|
0 commit comments