kubecost / kubectl-cost

CLI for determining the cost of Kubernetes workloads
Apache License 2.0
901 stars 60 forks source link

A potential risk of kubecost makes a worker node get the token of any Service Account #162

Closed sparkEchooo closed 9 months ago

sparkEchooo commented 9 months ago

Summary

  The Kubecost in GKE gave excessive authority when defining Service Account named "kubecost-1-cost-analyzer-serviceaccount-name-dff5" "kubecost-1-cost-analyzer-prometheus-serviceaccounts-server-name-e82d" and "kubecost-1-deployer-kvsqj". Besides, these Service Accounts are mounted into pod, witch makes it possible for attackers to raise rights to administrators.  

Detailed Analysis

Attacking Strategy

  If a malicious user controls a specific worker node which has the pod mentioned above, or steals one of the SA token mentioned above.He/She can raise permissions to administrator level and control the whole cluster. For example,

Mitigation Discussion

A few questions

Reporter list

Looking forward to your reply. Regards Xingyu Liu

michaelmdresser commented 9 months ago

Hi @sparkEchooo, this is the wrong repository for your report. Please open an issue on https://github.com/kubecost/cost-analyzer-helm-chart, that is the repository which controls this resources you are concerned about.

sparkEchooo commented 9 months ago

Hi, thanks for your reminder. I will resubmit this issue on the repository you mentioned. :)