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

custom-error-pages: Add an ability to disable "/metrics", "/healthz" and "/debug/vars" endpoints #9152

Open
ucinskij opened this issue Oct 13, 2022 · 9 comments · May be fixed by #10984
Open
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@ucinskij
Copy link

ucinskij commented Oct 13, 2022

The custom-error-pages backend does it job pretty well, however during a security scan it was detected that it exposes three endpoints:
/metrics
/healthz
/debug/vars

/metrics and /healthz are implemented by

/debug/vars at a first sight seems to be coming with github.com/prometheus/client_golang which includes expvar: https://pkg.go.dev/expvar

Especially the first and last ones expose information that might be considered as 'sensitive' by some organizations. Hence why I would like to ask for a feature toggle that would allow to disable those endpoints. It is to be considered if those should be exposed by default or not.

@ucinskij ucinskij added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 13, 2022
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Oct 13, 2022
@ucinskij ucinskij changed the title custom-error-pages: Add an ability to disable "/metrics" "/healthz" and "/debug/vars" endpoints custom-error-pages: Add an ability to disable "/metrics", "/healthz" and "/debug/vars" endpoints Oct 13, 2022
@longwuyuan
Copy link
Contributor

@rikatz seems like one reason to focus on this, like you had suggested. Will do as per your advise

@strongjz
Copy link
Member

/triage accepted
/priority backlog
/kind feature
/assign @strongjz

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Oct 13, 2022
@kubernetes kubernetes deleted a comment from Hexcles Oct 20, 2022
@Routhinator
Copy link

FYI I've just had this bug raised from a OpenBugBounty. None of the things exposed are overly sensitive here, but this does leave an operator unexpectedly exposed to any CVE related to these endpoints. They are exposed publicly and reachable from the internet as soon as someone uses the custom-error-pages container.

@Routhinator
Copy link

Defaults should definitely prevent these from being reachable by the internet. Scrapeable by internal services by default, sure - but never exposed to the internet by default.

@ucinskij
Copy link
Author

ucinskij commented Feb 9, 2023

Hi @strongjz,
I don't intend to put any pressure here but perhaps you know when we could expect this to be done? Unfortunately internal security scans within the company reqiure an action on this from our side, the security team simply complains too much about this.

@Hexcles
Copy link
Contributor

Hexcles commented Feb 9, 2023 via email

@strongjz
Copy link
Member

strongjz commented Feb 9, 2023

@ucinskij We are trying to find the best tool/practice to make sure things are getting addressed. Currently we are using the project board here to track our work and what needs to be worked on next or who is asking for feature/PR review.

https://github.com/orgs/kubernetes/projects/104

All new issues get added to the board but I have not added older ones. I will add this one to the board.

Another good way to keep this in our attention is to join the community meetings as well. We discuss issues, prs and open items like this to prioritize.

right now we have several CVE's we are trying to remediate and get updates out for ingress-nginx, then we can look to implementing features like this. If you are interested in taking the time and implementing it, we can discuss that 1x1.

Thank you,
James

@0xgui
Copy link

0xgui commented Mar 7, 2023

Any update on this ?

@ricardoapl
Copy link

I would like to work on this issue if that's OK

@ricardoapl ricardoapl linked a pull request Feb 14, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging a pull request may close this issue.

8 participants