You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update kuberc KEP with credential plugin allowlist
Currently, the kubeconfig may specify arbitrary binaries to run as
client-go credential plugins. Due to the fact that kubeconfig files are
often generated, and because they contain a lot of noise, there is
significant friction in manually inspecting the kubeconfig for
suspicious binaries after it is generated.
To encourage secure behavior, we want to introduce an allowlist to the
kuberc, which will describe the conditions under which a binary plugin
may be run. Currently the only condition is the name (absolute path or
basename of a binary found in `PATH`).
* Revise based on feedback
- Describe behavior when allowlist is `nil`
- Describe behavior when allowlist is empty
- Describe future plans for field additions
* Add SIG Auth as participating SIG
* Update TOC for KEP 3104
* Correct `os.LookPath` to `exec.LookPath`
* Add note about when the allowlist will not apply
* Avoid confusion between nil list and empty list
In the credential plugin allowlist, consider nil and empty lists an
error. Jordan Liggitt has pointed out that treating them differently is
generally avoided in APIs, as it can confuse users.
In order to make the user's intention more explicit, an additional
field, `credentialPluginPolicy` has been added. Its value must be one of
`EnableAll | DisableAll | Allowlist`. `EnableAll` and `DisableAll` are
self-explanatory and do not require an allowlist. `Allowlist` will use
the allowlist as defined in the KEP.
* Note that this change considers the following cases to be errors:
- a policy of `EnableAll` with an allowlist provided
- a policy of `DisableAll` with an allowlist provided
- a policy of `Allowlist` with no allowlist provided (i.e. a `nil`
- allowlist`
- a policy of `Allowlist` with an explicitly empty allowlist provided
* Clarify v1beta1 and kubectl v1.35 only (allowlist)
* Update kep.yaml
- Add sig-api-machinery as participating SIG
- Add enj as reviewer
- Update latest milestone to v1.35
* Allowlist: rename `name` field to `command`
* Clarify meaning of "the operation will fail"
* Specify appropriate api group and version
* Move detail to new section under `Design Details`
* Add table showing `command` comparison
Signed-off-by: Peter Engelbert <[email protected]>
| kubeconfig lists full path; `my-binary` is in both `/usr/local/bin` and `/usr/bin`|`PATH=/usr/local/bin:/usr/bin:<...>`| my-binary | /usr/local/bin/my-binary | /usr/bin/my-binary | /usr/bin/my-binary | false |
494
+
| kubeconfig lists full path; `my-binary` is only in `/usr/local/bin`|`PATH=/usr/local/bin:/usr/bin:<...>`| my-binary | /usr/local/bin/my-binary | /usr/bin/my-binary | /usr/bin/my-binary | false |
495
+
| kubeconfig lists full path; `my-binary` is only in `/usr/bin`|`PATH=/usr/local/bin:/usr/bin:<...>`| my-binary | /usr/bin/my-binary | /usr/bin/my-binary | /usr/bin/my-binary | true |
496
+
| kubeconfig lists full path; `my-binary` is only in `/usr/bin`|`PATH=/usr/local/bin:/usr/bin:<...>`| /usr/bin/my-binary | /usr/bin/my-binary | /usr/bin/my-binary | /usr/bin/my-binary | true |
497
+
| kuberc lists full path; `my-binary` is only in `/usr/bin`|`PATH=/usr/local/bin:/usr/bin:<...>`| /usr/bin/my-binary | /usr/bin/my-binary | my-binary | /usr/bin/my-binary | true |
498
+
| kuberc lists full path; `my-binary` is in `/usr/local/bin`|`PATH=/usr/local/bin:/usr/bin:<...>`| /usr/bin/my-binary | /usr/bin/my-binary | my-binary | /usr/local/bin/my-binary | false |
499
+
| neither lists full path; `my-binary` is in `/usr/bin`; equivalent to basename match |`PATH=/usr/local/bin:/usr/bin:<...>`| my-binary | /usr/bin/my-binary | my-binary | /usr/bin/my-binary | true |
500
+
501
+
If `credentialPluginPolicy` is set to `Allowlist`, but a
502
+
`credentialPluginAllowlist` is not provided, it will be considered an
503
+
configuration error. Rather than guess at what the user intended, the operation
504
+
will be aborted just before the `exec` call. An error describing the
505
+
misconfiguration will be returned. This is because the allowlist is a security
506
+
control, and it is likely the user has made a mistake. Since the output may be
507
+
long, it would be easy for a security warning to be lost at the beginning of
508
+
the output. An explicitly empty allowlist (i.e. `credentialPluginAllowlist: []`),
509
+
in combination with `credentialPluginPolicy: Allowlist` will be considered an
510
+
error for the same reason. The user should instead use `credentialPluginPolicy:
511
+
DisableAll` in this case.
512
+
513
+
Commands that don't create a client, such as `kubectl config view` will not be
514
+
affected by the allowlist. Additionally, commands that create but do not *use*
515
+
a client (such as commands run with `--dry-run`) will likewise remain
516
+
unaffected.
517
+
518
+
In future updates, other allowlist entry fields MAY be added. Specifically,
519
+
fields allowing for verification by digest or public key have been discussed.
520
+
The initial design MUST accommodate such future additions.
0 commit comments