-
Notifications
You must be signed in to change notification settings - Fork 687
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 in emissary-ingress can be leveraged to make a cluster-level privilege escalation #4914
Comments
Besides, I have checked the private security policy of the emissary-ingress and the official website of the emissary-ingress, and I don't find any mailing list to report this kind of problem. So I write a "security issue" by opening a public-accessible GitHub issue. I am sorry if it caused ethical considerations. |
Hi @younaman , thanks for raising these concerns. If you'd like to contribute or discuss these concerns further we do have a monthly contributor's meeting you're welcome to join. |
What exactly do you mean get access to a worker node? If an attacker can get access to the underlying host they can do a heck of a lot more than just use the Emissary permissions to read secrets within the cluster. So while you could say that maybe the RBAC rules should be tightened if possible, I don't think this is really a privilege escalation against Emissary (there are plenty of other components out there that have cluster roles giving ability to read secrets) as compromising a worker node pretty much opens you up to privilege escalation through many vectors. |
hello@cindymullins-dw, It's a pleasure to receive your invitation. By the way, can you ensure that the potential risk is a real issue? And could other contributors give me some more detailed suggestions? Besides, in monthly contributor's meeting you mentioned, I find there is a weekly troubleshooting, can we discuss this potential risk in detail in the weekly session and find out some mitigations? I am looking forward to hearing back from you. |
@cyrus-mc @cindymullins-dw Knock knock! Are there any updates? |
Hi @younaman , would you like to join the next weekly Emissary session to discuss? That would be on Thursday at 2:30pm ET. You can use the link you posted to join us. |
@cindymullins-dw a weekly troubleshooting,is a Invalid conference number. Is there any update adout the link of weekly troubleshooting in document? And the conference number is invalid, how can i join the meeting on Thursday at 2:30pm ET? |
Wiz is also flagging this for us as an issue. Note, the escalation path here isn't node compromise -> secret compromise as that would not involve emissary per se. The escalation path is emissary compromise -> secret compromise, and it's specifically imporant because emissary is an exposed service that, since it may handle most of an org's HTTP traffic, has a large exposed surface. What's unclear to me is why emissary needs read access to all secrets. I see based on an old issue/PR (#1365) that this was considered optional at some point. But I haven't found documentation on what the secret watch is for (nor is AMBASSADOR_NO_SECRETS in the documentation and it appears it may have been removed from code since then). |
@jasonstitt Thanks a lot! I am glad that this issue will still be noticed by someone after these days. So you mean that the secrets have been removed and this problem has been fixed secretly? |
No that was just some initial research. |
Does anyone know what secrets it actaully needs permissions for? I couldnt find what it was looking for in the codebase, and the only secret i could find thats related was the Ive also been looking at locking our emissary down and as mentioined above the I tried setting:
In my helm chart and deployed my own Role && RoleBinding in hopes that error logs would indicate what secrets I need to add in resourceNames but no luck, the erros logs when emissary cant acces secret just look like:
with no indication of what secrets its specifically looking for |
Summary
The emissary-ingress has two deployments in the namespace emissary. One of them is emissary-ingress, which has three pods running on worker nodes. These pods have cluster role emissary-ingress which has "get list watch" verb of "secret". Thus, if a malicious user controls one work node with the pod of deployment emissary-ingress, he/she can leverage the emissary-ingress deployment's pods to get the cluster admin's secret, making privilege escalation.
Details
In our local environment, we have a three-node cluster with Kubernetes v1.25, we deploy the emissary-ingress following its official guide(https://www.getambassador.io/docs/emissary/latest/tutorials/getting-started).
In our local environment:
The emissary-ingress deployment has three pods, one of them runs on worker A, and two of them run on worker B.
Thus, if a malicious user can access one worker node, he/she can leverage the related pods' token to get the cluster admin's secret, making a cluster-level privilege escalation.
Mitigation discussion:
Overall, the emissary-ingress should review its source code and restrain the secrets which its deployment can access. More specifically:
A few questions:
Impact
It is a privilege escalation, a malicious user can get the cluster admin's secret and do whatever he/she likes to other users' workloads.
The text was updated successfully, but these errors were encountered: