Is there any reason prometheus should have nodes/proxy permissions in ClusterRole for kubernetes?

258 views
Skip to first unread message

Jesse Simpson

unread,
Feb 25, 2023, 3:36:41 AM2/25/23
to Prometheus Users
Hey all,

I'm investigating a security vulnerability reported by my company's security scanning software.  We were scanning a helm chart that we make use out of that has a prometheus server pod in it.

The threat is that a pod with node/proxy permission is vulnerable to privilege escalation.


As part of my investigation, I tried removing this nodes/proxy permission, and checked a number of prometheus metrics to see if they report different data, or no data when there previously was data.  But so far, I can't see any negative side effect to removing the nodes/proxy permission.

I've contacted the developers of the helm chart we scanned, and they cannot justify their need for this permission and insist that we do not remove it.

Is there a reason you all can think of that this permission might be required for prometheus to function?

Thanks,

Jesse

Ben Kochie

unread,
Feb 25, 2023, 4:08:13 AM2/25/23
to Jesse Simpson, Prometheus Users
It would help if you linked the specific helm chart and issue you filed. There are a lot of different charts out there maintained by different people.

But just a guess, you're talking about the prometheus-community/prometheus chart[0].

IIRC in some configurations the Prometheus server needs access to the proxy in order to scrape data from the kubelet. I think this may be a legacy mode of operation, but it used to be the default.


--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/29001ead-8ac6-414a-9d0c-76631c253acen%40googlegroups.com.

Jesse Simpson

unread,
Feb 27, 2023, 9:59:03 AM2/27/23
to Prometheus Users

Hey Ben,

Sorry for not initially specifying the helm chart, I was under the impression that the repo was private and found out recently that it's public.

repo name: kubecost
chart version: 1.99.0


And I think that prometheus chart inside kubecost may have been copied from the prometheus-community helm chart you linked.  They seem similar enough.

The security tool that reported the vulnerability is Trivy, so other users of Trivy probably report the same vulnerability.

Your insight into the historical use of prometheus scraping data from kubelet is helpful. If this is no longer required, perhaps I can suggest removing this dependency in prometheus-community/helm-charts and request that the kubecost maintainers update their version of this helm chart.

Jesse

Ben Kochie

unread,
Feb 27, 2023, 11:04:49 AM2/27/23
to Jesse Simpson, Prometheus Users
Please be aware, security scanners are highly prone to false positives. You need to verify there is an actual exploitable path here before worrying too much. Don't blindly believe security scanners.



Ben Kochie

unread,
Feb 27, 2023, 11:49:32 AM2/27/23
to Jesse Simpson, Prometheus Users

Jesse Simpson

unread,
Feb 27, 2023, 12:14:08 PM2/27/23
to Prometheus Users
Thank you for the PR!

Jesse
Reply all
Reply to author
Forward
0 new messages