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

kube-controllers: pprof is enabled on /metrics server port. #8936

Open
xinfengliu opened this issue Jun 24, 2024 · 0 comments
Open

kube-controllers: pprof is enabled on /metrics server port. #8936

xinfengliu opened this issue Jun 24, 2024 · 0 comments

Comments

@xinfengliu
Copy link

In kube-controllers/cmd/kube-controllers/main.go, there's an import _ "net/http/pprof", this causes /debug/pprof emerges in any started http server such as server for serving /metrics (default at port 9094) even if DebugProfilePort is not set.

Expected Behavior

/debug/pprof is not enabled on Calico kube-controllers's /metrics server port

Current Behavior

/debug/pprof is enabled on Calico kube-controllers's /metrics server port

Possible Solution

Not sure if import _ "net/http/pprof" is necessary, I see currently if DebugProfilePort is not zero, github.com/pkg/profile is used to write profile data to local disk.

Steps to Reproduce (for bugs)

  1. Deploy Calico and /metrics is enabled in kube-controllers (this is default).
  2. Access http://<calico-kube-controllers IP>:9094/debug/pprof

Context

Exposing pprof by default outside the host OS is considered a security issue by organizations which have high security requirements.

Your Environment

  • Calico version v3.27.0
  • Orchestrator version (e.g. kubernetes, mesos, rkt): kubernetes
  • Operating System and version: Rocky Linux 8.6
  • Link to your project (optional):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant