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

kubeadm serves kube-scheduler and kube-controller metrics insecurely #2202

Closed
neolit123 opened this issue Jun 29, 2020 · 4 comments · Fixed by kubernetes/kubernetes#92720
Closed
Labels
area/ecosystem area/security priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone

Comments

@neolit123
Copy link
Member

neolit123 commented Jun 29, 2020

kubeadm serves kube-scheduler and kube-controller manager metrics insecurely outside of localhost, as reported here:
https://kubernetes.slack.com/archives/C2P1JHS2E/p1593237397449300

i need to double check this myself, but it feels like our --bind-address=127.0.0.1 is not sufficient to disable that.

for example:
curl http://public-ip:10252/metrics

flag refs:
https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/

@neolit123 neolit123 added area/ecosystem area/security priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Jun 29, 2020
@neolit123 neolit123 added this to the v1.19 milestone Jun 29, 2020
@neolit123
Copy link
Member Author

seems related: kubernetes/kubernetes#65869 (comment)

@neolit123
Copy link
Member Author

neolit123 commented Jun 29, 2020

the KCM docs are lacking some flags:

$ kube-controller-manager --help
...
Insecure serving flags:

      --address ip
                The IP address on which to serve the insecure --port (set to 0.0.0.0 for all IPv4 interfaces and :: for all
                IPv6 interfaces). (default 0.0.0.0) (DEPRECATED: see --bind-address instead.)
      --port int
                The port on which to serve unsecured, unauthenticated access. Set to 0 to disable. (default 10252)
                (DEPRECATED: see --secure-port instead.)

https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/

kubeadm has a couple of options to disable public metrics:

  • pass --port=0
  • pass --address=127.0.0.1

once these flags are removed, it's not clear how insecure metrics will be possible.

@neolit123 neolit123 added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Jun 29, 2020
@neolit123
Copy link
Member Author

xref kubernetes/kubernetes#91506

@neolit123
Copy link
Member Author

neolit123 commented Jul 1, 2020

we discussed that --port=0 might be a good option by default and the users can still override using "extraArgs".

PRs for master (1.19) and branches in the support skew:
kubernetes/kubernetes#92720
kubernetes/kubernetes#92723
kubernetes/kubernetes#92725
kubernetes/kubernetes#92726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ecosystem area/security priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant