Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Limit Apiserver Proxy Redirects #95129

Closed
riaankleinhans opened this issue Sep 28, 2020 · 12 comments · Fixed by #95128
Closed

Bug: Limit Apiserver Proxy Redirects #95129

riaankleinhans opened this issue Sep 28, 2020 · 12 comments · Fixed by #95128
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.

Comments

@riaankleinhans
Copy link
Contributor

What happened:

As part of creating an e2e test for Pod ProxyOptions endpoints, it was found that the apiserver proxy server is processing a blank redirect for any method call for 21 endpoints across pods, services and nodes.

For a pod, redirecting for any method other than GET or HEAD is a bug, #94786 (comment)

What you expected to happen:

This is the current behaviour for the apiserver but with a minimal code change the redirect can apply to only the following endpoints;

  • GET /api/v1/namespaces/{namespace}/pods/{name}/proxy
  • HEAD /api/v1/namespaces/{namespace}/pods/{name}/proxy
  • GET /api/v1/namespaces/{namespace}/services/{name}/proxy
  • HEAD /api/v1/namespaces/{namespace}/services/{name}/proxy
  • GET /api/v1/nodes/{name}/proxy
  • HEAD /api/v1/nodes/{name}/proxy

How to reproduce it (as minimally and precisely as possible):

  • Create any standard pod and service in the default namespace

  • run kubectl proxy --port=8888 in another terminal

  • the response from running the following commands produces a HTTP/1.1 301 Moved Permanently

    curl -I -X GET -s http://localhost:8888/api/v1/namespaces/default/pods/{name}/proxy

    curl -I -X GET -s http://localhost:8888/api/v1/namespaces/default/services/{name}/proxy

    curl -I -X GET -s http://localhost:8888/api/v1/nodes/{name}/proxy

GET can be replaced with other http verbs DELETE, HEAD, OPTIONS, PATCH, POST and PUT which also produce 301 responses.

Anything else we need to know?:

/sig networking
/sig testing
/sig architecture

@k8s-ci-robot k8s-ci-robot added the sig/testing Categorizes an issue or PR as relevant to SIG Testing. label Sep 28, 2020
@k8s-ci-robot
Copy link
Contributor

@Riaankl: The label(s) sig/networking cannot be applied, because the repository doesn't have them

In response to this:

What happened:

As part of creating an e2e test for Pod ProxyOptions endpoints, it was found that the apiserver proxy server is processing a blank redirect for any method call for 21 endpoints across pods, services and nodes.

For a pod, redirecting for any method other than GET or HEAD is a bug, #94786 (comment)

What you expected to happen:

This is the current behaviour for the apiserver but with a minimal code change the redirect can apply to only the following endpoints;

  • GET /api/v1/namespaces/{namespace}/pods/{name}/proxy
  • HEAD /api/v1/namespaces/{namespace}/pods/{name}/proxy
  • GET /api/v1/namespaces/{namespace}/services/{name}/proxy
  • HEAD /api/v1/namespaces/{namespace}/services/{name}/proxy
  • GET /api/v1/nodes/{name}/proxy
  • HEAD /api/v1/nodes/{name}/proxy

How to reproduce it (as minimally and precisely as possible):

  • Create any standard pod and service in the default namespace
  • run kubectl proxy --port=8888 in another terminal
  • the response from running the following commands produces a HTTP/1.1 301 Moved Permanently

curl -I -X GET -s http://localhost:8888/api/v1/namespaces/default/pods/{name}/proxy

curl -I -X GET -s http://localhost:8888/api/v1/namespaces/default/services/{name}/proxy

curl -I -X GET -s http://localhost:8888/api/v1/nodes/{name}/proxy

GET can be replaced with other http verbs DELETE, HEAD, OPTIONS, PATCH, POST and PUT which also produce 301 responses.

Anything else we need to know?:

/sig networking
/sig testing
/sig architecture

Instructions 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. label Sep 28, 2020
@heyste
Copy link
Member

heyste commented Sep 28, 2020

@liggitt Does this issue and PR address your concerns about the apiserver proxy server doing a blanket direct of any http call to the root proxy endpoints?

@liggitt
Copy link
Member

liggitt commented Sep 30, 2020

commented on the associated PR, thanks

@BenTheElder
Copy link
Member

/remove-sig testing

@k8s-ci-robot k8s-ci-robot removed the sig/testing Categorizes an issue or PR as relevant to SIG Testing. label Nov 2, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 31, 2021
@riaankleinhans
Copy link
Contributor Author

/remove-lifecycle stale
Will be addressed late in 1.21

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 14, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 15, 2021
@riaankleinhans
Copy link
Contributor Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 16, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 14, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 13, 2021
@riaankleinhans
Copy link
Contributor Author

/remove-lifecycle stale

@liufangwai
Copy link

/remove-lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants