KEP-6051: CRI Streaming Authorization Hook#6052
KEP-6051: CRI Streaming Authorization Hook#6052mattsu2020 wants to merge 1 commit intokubernetes:masterfrom
Conversation
Add a KEP proposing an optional AuthorizeStream hook in the CRI streaming server config for stream-time authorization of exec, attach, and port-forward requests. KEP: 6051
|
Welcome @mattsu2020! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mattsu2020 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @mattsu2020. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
I'm unclear on how this works with the current kubernetes setup, IIRC the decision to split the streaming bits from cri was to simplify dependencies. |
Thanks, that is a fair point. My intent was to add a stream-time authorization point for CRI streaming server embedders, but I agree the current proposal does not clearly show how this fits into the current kubelet/CRI flow. In the current Kubernetes setup, kubelet authorizes the original exec/attach/port-forward request and then proxies to the URL returned by the runtime; kubelet does not directly construct the cri-streaming server config in the usual path. Given that, the proposal is currently underspecified. I need to either describe a concrete kubelet-facing integration, including what identity/authorization context would be propagated to the runtime stream server, or narrow/withdraw the proposal if this is only a generic library hook without an in-tree Kubernetes use case. I will revisit the KEP with that in mind. |
Summary
Adds a KEP proposing an optional
AuthorizeStreamhook to the CRI streaming server configuration (k8s.io/cri-streaming). The hook is invoked after a short-lived stream URL token is validated and before exec, attach, or port-forward streams are served.Enhancement issue: #6051
Code PR: kubernetes/kubernetes#138616
Motivation
The CRI streaming package currently relies entirely on a single-use, short-lived random token for stream request security. There is no authentication or authorization at the streaming server level, as noted by the long-standing TODO:
This KEP addresses that gap by providing a stream-time authorization hook that CRI runtime implementers can use for:
Key Design Decisions
AuthorizeStream func(http.ResponseWriter, *http.Request) erroradded tostreaming.Confignil(default), existing behavior is preserved — fully backward-compatible403 ForbiddenSIG Node Discussion
Initial feedback from @mikebrow on kubernetes/kubernetes#138616 requested a KEP with solid use cases and comprehensive integration tests. This KEP addresses those requirements.