20
20
- [ Modify Application Image by Copy] ( #modify-application-image-by-copy )
21
21
- [ Node Troubleshooting with Privileged Containers] ( #node-troubleshooting-with-privileged-containers )
22
22
- [ Debugging Profiles] ( #debugging-profiles )
23
- - [ Default Profile and Automation Selection] ( #default-profile-and-automation-selection )
24
- - [ Profile: debug] ( #profile-debug )
23
+ - [ Profile: general] ( #profile-general )
25
24
- [ Profile: baseline] ( #profile-baseline )
26
25
- [ Profile: restricted] ( #profile-restricted )
27
26
- [ Profile: sysadmin] ( #profile-sysadmin )
28
27
- [ Profile: netadmin] ( #profile-netadmin )
28
+ - [ Default Profile and Automation Selection] ( #default-profile-and-automation-selection )
29
+ - [ Future Improvements] ( #future-improvements )
29
30
- [ User Stories] ( #user-stories )
30
31
- [ Operations] ( #operations )
31
32
- [ Debugging] ( #debugging )
@@ -312,9 +313,9 @@ Examples:
312
313
Since launching ` kubectl debug ` we've received feedback that more configurability
313
314
is needed for generated pods and containers.
314
315
315
- * [ kubernetes/kubernetes #97103 ] : ability to set capability ` SYS_PTRACE `
316
- * [ kubernetes/kubectl #1051 ] : ability to set privileged
317
- * [ kubernetes/kubectl #1070 ] : strip probes on pod copy
316
+ * [ kubernetes/kubernetes #97103 ] ( https://issues.k8s.io/97103 ) : ability to set capability ` SYS_PTRACE `
317
+ * [ kubernetes/kubectl #1051 ] ( https://github.com/kubernetes/kubectl/issues/1051 ) : ability to set privileged
318
+ * [ kubernetes/kubectl #1070 ] ( https://github.com/kubernetes/kubectl/issues/1070 ) : strip probes on pod copy
318
319
* (various): ability to set ` SYS_ADMIN ` and ` NET_ADMIN ` capabilities
319
320
320
321
These requests are relevant for all debugging journeys. That is, a user may want to
@@ -330,10 +331,10 @@ The available profiles will be:
330
331
331
332
| Profile | Description |
332
333
| ------------ | --------------------------------------------------------------- |
333
- | debug | A reasonable set of defaults tailored for each debuging journey |
334
+ | general | A reasonable set of defaults tailored for each debuging journey |
334
335
| baseline | Compatible with baseline [ Pod Security Standard] |
335
336
| restricted | Compatible with restricted [ Pod Security Standard] |
336
- | auto | Automatically choose between debug , baseline, and restricted |
337
+ | auto | Automatically choose between general , baseline, and restricted |
337
338
| sysadmin | System Administrator (root) privileges |
338
339
| netadmin | Network Administrator privileges. |
339
340
| legacy | Backwards compatibility with 1.22 behavior |
@@ -343,43 +344,20 @@ enforced by the [PodSecurity] admission controller. The baseline and restricted
343
344
profiles will generate configuration compatible with the corresponding security
344
345
level.
345
346
346
- It might be possible to support user-configurable profiles, but it's not a goal of
347
- this KEP, and we have no plans to implement it.
348
-
349
347
[ Pod Security Standards ] : https://kubernetes.io/docs/concepts/security/pod-security-standards/
350
348
[ PodSecurity ] : http://kep.k8s.io/2579
351
349
352
- #### Default Profile and Automation Selection
353
-
354
- The profile named "debug" will generate the best configuration for a particular
355
- debugging journey, for example including ` SYS_PTRACE ` for ephemeral containers
356
- so that a debugging container may signal and attach to other processes.
357
-
358
- The profile named "auto" will choose between "debug", "baseline", and "restricted"
359
- by looking ` pod-security.kubernetes.io/enforce ` annotation on the namespace and
360
- choosing the most permission of "debug", "baseline", and "restricted" that will
361
- be allowed by default. In this way it will choose a default that's always
362
- compatible with the current security policy.
363
-
364
- When not ` --profile ` is not specified it will default to "legacy" to be backwards
365
- compatible with the current behavior and print a warning that the behavior will
366
- change starting with release 1.25. Starting with 1.25 the default will be "auto".
367
-
368
- Even with automatic selection it's still desirable to be able to specify "debug",
369
- "baseline", and "restricted" explicitly. In the future there will be an optional
370
- "break glass" mechanism to bypass the current security policy for debugging.
371
-
372
- #### Profile: debug
350
+ #### Profile: general
373
351
374
352
| Journey | Debug Container Behavior |
375
353
| ------------------- | -------------------------------------------------------------------------- |
376
354
| Node | empty securityContext; uses host namespaces, mounts root partition |
377
355
| Pod Copy | sets ` SYS_PTRACE ` in debugging container, sets shareProcessNamespace |
378
356
| Ephemeral Container | sets ` SYS_PTRACE ` in ephemeral container |
379
357
380
- This profile is intended to be a useful default . For pod debugging it sets ` SYS_PTRACE ` and uses
381
- pod-scoped namespaces. Probes and labels are stripped from Pod copies to ensure the copy isn't
382
- killed and doesn't receive traffic during debugging.
358
+ This profile prioritizes the debugging experience for the general case . For pod debugging it sets
359
+ ` SYS_PTRACE ` and uses pod-scoped namespaces. Probes and labels are stripped from Pod copies to
360
+ ensure the copy isn't killed and doesn't receive traffic during debugging.
383
361
384
362
Node debugging uses host-scoped namespaces but doesn't otherwise request escalated privileges.
385
363
@@ -391,8 +369,10 @@ Node debugging uses host-scoped namespaces but doesn't otherwise request escalat
391
369
| Pod Copy | empty securityContext; sets shareProcessNamespace |
392
370
| Ephemeral Container | empty securityContext |
393
371
394
- This profile eliminates the privileges from "debug" that are disallowed under the baseline security
395
- profile, such as host namespaces, host volume mounts and ` SYS_PTRACE ` .
372
+ This profile is identical to "general" but eliminates privileges that are disallowed under the
373
+ baseline security profile, such as host namespaces, host volume, mounts and ` SYS_PTRACE ` .
374
+
375
+ Probes and labels continue to be stripped from Pod copies.
396
376
397
377
#### Profile: restricted
398
378
@@ -402,8 +382,10 @@ profile, such as host namespaces, host volume mounts and `SYS_PTRACE`.
402
382
| Pod Copy | empty securityContext; sets shareProcessNamespace |
403
383
| Ephemeral Container | empty securityContext |
404
384
405
- This profile adds configuration to "baseline" that's required under the restricted security profile,
406
- such as requiring a non-root user and dropping all capabilities.
385
+ This profile is identical to "baseline" but adds configuration that's required under the restricted
386
+ security profile, such as requiring a non-root user and dropping all capabilities.
387
+
388
+ Probes and labels continue to be stripped from Pod copies.
407
389
408
390
#### Profile: sysadmin
409
391
@@ -415,6 +397,8 @@ such as requiring a non-root user and dropping all capabilities.
415
397
416
398
This profile offers elevated privileges for system debugging.
417
399
400
+ Probes and labels are be stripped from Pod copies.
401
+
418
402
#### Profile: netadmin
419
403
420
404
| Journey | Debug Container Behavior |
@@ -425,6 +409,29 @@ This profile offers elevated privileges for system debugging.
425
409
426
410
This profile offers elevated privileges for network debugging.
427
411
412
+ Probes and labels are be stripped from Pod copies.
413
+
414
+ #### Default Profile and Automation Selection
415
+
416
+ In order to provide a seamless experience and encourage use of [ PodSecurity] , the "auto"
417
+ profile will automatically choose a profile that's compatible with the current security profile
418
+ by examining the ` pod-security.kubernetes.io/enforce ` annotation on the namespace and
419
+ selecting the most permissive of "general", "baseline", and "restricted" that the
420
+ controller will allow.
421
+
422
+ This will become the default behavior, but in order to maintain backwards compatibility
423
+ the "legacy" profile will be the default profile until the 1.25 release. When ` --profile `
424
+ is not specified ` kubectl debug ` will print a warning about the upcoming change in behavior.
425
+
426
+ #### Future Improvements
427
+
428
+ It might be possible to support user-configurable profiles, but it's not a goal of
429
+ this KEP, and we have no plans to implement it.
430
+
431
+ The [ PodSecurity] KEP mentions a couple of options for "break glass" functionality to allow
432
+ bypassing security policy for debugging purposes. If a standard emerges for break glass, `kubectl
433
+ debug` should be updated to support it.
434
+
428
435
### User Stories
429
436
430
437
#### Operations
0 commit comments