-
Notifications
You must be signed in to change notification settings - Fork 922
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
kubectl proxy --accept-hosts
appears to filter destination, not source.
#142
Comments
I don't know who knows about proxy. @liggitt ? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
/sig cli |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
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. |
Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT
Kubernetes version:
Environment:
What happened:
In my development VM [10.0.1.100] I started kubectl proxy to provide full access to the Dashboard UI to my workstation [10.0.2.200], but not everyone else in the office. The command used was:
as well as many variants of the regular expression with/without
\.
,^
, and$
Which yielded the following for all endpoints:
It was suggested in the
#kubernetes-users
Slack channel that it may be running the regex against a hostname, but I've double-checked and we do not have reverse lookups enabled for our network, and I don't think thatkubectl
would be looking up NetBIOS info.It can be made to work with
--accept-hosts='^.*$'
as you would expect, however I also decided to try--accept-hosts='^10\.0\.1\.100$'
on a hunch, which ended up working the same as the wildcard, allowing anyone on the network access to the proxy.What you expected to happen:
--accept-hosts='^10\.0\.2\.200$'
should allow only the stated IP access to the proxy.--accept-hosts='^10\.0\.1\.100$'
should allow only local requests, similar to the127.0.0.1
defaults.How to reproduce it:
With two hosts attached to the same network:
kubectl proxy --port=8080 --address=HOST_A_IP --accept-hosts='^HOST_B_IP$'
curl http://HOST_A_IP:8080/
Anything else we need to know:
This has wider implications than me simply being paranoid about my local network. In searching for solutions to this problem I found pages upon pages of people stating
--accept-hosts='^.*$'
and--disable-filter=true
as general solutions, even in the face of machines with public-facing interfaces. The supposed workarounds for this issue are causing people to unwittingly expose very sensitive information and APIs to potentially the entire world unless they take additional action to prevent it, eg: firewall rules.eg: See the discussion in kubernetes/dashboard#692
The text was updated successfully, but these errors were encountered: