Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16741 from enj/enj/i/unsafeproxy_reqinfo/16619
Automatic merge from submit-queue (batch tested with PRs 16741, 16692). Move browser safe proxy logic into an authorizer This change moves the browser safe proxy verification from a request info resolver to an authorizer. It is required because we moved to the upstream filters in 689cdee. The upstream handler chain resolves request info, then authentication and then authorization. Our old chain would mutate request info after authentication and before authorization. This meant that we had access to the user info data. Since the upstream handler chain does any mutation to the request info before authentication, our browser safe proxy request info resolver would never see any user data. This meant that it would incorrectly identify safe proxy requests as unsafe. To continue using the upstream chain, we must move this logic into an authorizer that wraps our existing authorizers. This will guarantee that it has access to the authentication information it requires. Since the authorizer only has access to authorization attributes, it cannot make any decisions based on the context or request info. In this case, it means that we can no longer honor the X-CSRF-Token header as a way of confirming that the request is not originating from a browser. This is an acceptable break from legacy behavior as that header was never documented as a way of passing the browser check. The most likely user of this feature is the proxy command, which is easy to use in an authenticated manner with either oc or kubectl. Administrators can continue to grant the unsafe verb to unauthenticated users should they desire to bypass this safety check entirely. Signed-off-by: Monis Khan <mkhan@redhat.com> Fixes #16619 Fixes #16710 /assign @liggitt @deads2k @openshift/sig-security cc @jwendell @DirectXMan12 since you guys encountered this issue.
- Loading branch information