Commit c48340e
committed
rpc: enable debugzip user for privileged access
This commit introduces support for the debug_user certificate as a privileged
user for RPC authentication, similar to the existing root and node users. The
`debug_user` is specifically designed for collecting debug information (debug
zip) and requires privileged access to `serverpb` admin and status endpoints.
Modified `pkg/rpc/auth.go` to allow `debug_user` scope in
`checkRootOrNodeInScope()`, treating it as a privileged user alongside root and
node. Enhanced `pkg/rpc/auth_test.go` with comprehensive test cases for
`debug_user` authentication and authorization across various scenarios.
The `debug_user` is not subject to the `disallow-root-login` flag and should
always be allowed for debugging purposes unless it contains root in SAN field.
Fixes: #150845
Epic: CRDB-49035
Release note (security update): A new `debug_user` certificate can now be used
for privileged RPC access to collect debug information. The debug_user must be
created manually using the `CREATE USER` command and can be audited using the
`SHOW USERS` command. This user has privileged access to `serverpb` admin and
status endpoints required for debug zip collection.1 parent 9a14037 commit c48340e
File tree
6 files changed
+68
-31
lines changed- pkg
- cli
- rpc
- security
- username
6 files changed
+68
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
566 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
567 | 568 | | |
568 | 569 | | |
569 | 570 | | |
| |||
1156 | 1157 | | |
1157 | 1158 | | |
1158 | 1159 | | |
1159 | | - | |
| 1160 | + | |
1160 | 1161 | | |
1161 | 1162 | | |
1162 | 1163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| 494 | + | |
494 | 495 | | |
495 | 496 | | |
496 | 497 | | |
| |||
507 | 508 | | |
508 | 509 | | |
509 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
510 | 515 | | |
511 | 516 | | |
512 | 517 | | |
513 | | - | |
| 518 | + | |
514 | 519 | | |
515 | | - | |
| 520 | + | |
516 | 521 | | |
517 | 522 | | |
518 | 523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| 174 | + | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| 183 | + | |
| 184 | + | |
179 | 185 | | |
180 | 186 | | |
181 | 187 | | |
| |||
209 | 215 | | |
210 | 216 | | |
211 | 217 | | |
| 218 | + | |
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
215 | 222 | | |
216 | | - | |
217 | | - | |
| 223 | + | |
| 224 | + | |
218 | 225 | | |
219 | 226 | | |
220 | 227 | | |
| |||
1326 | 1333 | | |
1327 | 1334 | | |
1328 | 1335 | | |
1329 | | - | |
1330 | | - | |
| 1336 | + | |
| 1337 | + | |
1331 | 1338 | | |
1332 | 1339 | | |
1333 | 1340 | | |
| |||
1348 | 1355 | | |
1349 | 1356 | | |
1350 | 1357 | | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1351 | 1371 | | |
1352 | 1372 | | |
1353 | 1373 | | |
1354 | | - | |
| 1374 | + | |
1355 | 1375 | | |
1356 | 1376 | | |
1357 | 1377 | | |
| |||
1363 | 1383 | | |
1364 | 1384 | | |
1365 | 1385 | | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
1382 | 1405 | | |
1383 | | - | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
1384 | 1409 | | |
1385 | 1410 | | |
1386 | 1411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| |||
0 commit comments