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

A potential risk of airflow makes a worker node get the token of any Service Account #2582

Open
sparkEchooo opened this issue Jan 19, 2024 · 0 comments
Labels
kind/k8s Related to the Kubernetes application needs-triage This wasn't investigate by the repo's owners yet

Comments

@sparkEchooo
Copy link

Summary

  The Airflow Operator in GKE gave excessive authority when defining Service Account named "airflow". Besides, this Service Account is mounted into deployments named "airflow-1-web" and "airflow-1-scheduler", witch makes it possible for attackers to raise rights to administrators in k8s.
 

Detailed Analysis

  • I deployed Airflow in the marketplace of Google's GKE cluster by default.
  • The Role named "airflow" defines the "create" verb of "pods". And this Role is bound to the Service Account named "airflow". The Service Account is mounted into two deployments named "airflow-1-web" and "airflow-1-scheduler". 

Attacking Strategy

  If a malicious user controls a specific worker node which has the deployments 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,

  • With the "create" verb of "pods", attacker can elevate privileges by creating a pod to mount and steal any Service Account he/she want OR mounting the "/etc/kubernetes/pki/*" of master node.

Mitigation Discussion

  • Developer could delete the "create" verb of StatefulSets and Pods.

A few questions

  • Is it a real issue in Airflow?
  • If it's a real issue, can Airflow mitigate the risks following my suggestions discussed in the "Mitigation Discussion"?
  • If it's a real issue, does Airflow plan to fix this issue?

Reporter List

@sparkEchooo sparkEchooo added kind/k8s Related to the Kubernetes application needs-triage This wasn't investigate by the repo's owners yet labels Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/k8s Related to the Kubernetes application needs-triage This wasn't investigate by the repo's owners yet
Projects
None yet
Development

No branches or pull requests

1 participant