Pull to refresh

Comments 14

Читал с большим интересом. Ожидал, что будет использование veth'а или что-то подобное. slirp не выглядит как полноценное решение.

Slirp автор выбрала, я так понимаю, именно с упором на то, чтобы можно было всё запускать исключительно от непривилегированного пользователя, включая сеть.

Если рутом махать, то, конечно, есть более широкий набор решений — ссылку в примечании в тексте добавили на этот счет)

Вот это как раз и есть интересный вопрос. В linux почему-то (до сих пор) нельзя взять и отдать сетевой интерфейс на растерзание непривилегированной программе.

Half the problem comes from an arbitrary restriction I put on myself. I wanted this to work from a completely unprivileged Docker container. Normally Docker doesn't give guest containers things like CAP_NET_ADMIN, which is needed to do things with TUN/TAP devices. I wanted to make the container image so that all you needed to do was:


docker run --rm -it xena/docker-uml

and then you'd suddenly have an entirely working user mode linux system right there. I mainly want to see how far the rabbit hole goes from a completely user level. TUN/TAP devices require CAP_NET_ADMIN, so they are not allowed in this case. Thus I chose Slirp.

Да, так я про это и говорю. CAP_NET_ADMIN — это не "отдать интерфейс на растерзание", а "отдать сеть всего сервера на растерзание". Вот если бы можно было дать CAP_NET_ADMIN для одного-единственного сетевого интерфейса (например, veth'а), или даже создать сетевой интерфейс в непривилегированном режиме.

I'd absolutely love if that was the case. It's a shame that we live in a world where we can't do that.

Maybe namespaces can be a solution? Yes, it's not good solution, but it works and provides some kind of isolation?
The last time I checked it out — slirp was seriously leaking memory when I tried to push lots of traffic through it. Additionally, user-mode slip/ppp is invisible on the host in terms of interfaces — so you can't route or connect in reverse direction (AFAIR it's possible to reverse-proxy tcp connections). Typical use of slirp was to get slirp/ppp without pap/chap authorization — like login via modem to a host via tty and either have terminal session or launch slirp and get internet access — way simpler&easier than configuring radius/tacacs and a ton of ppp/slip interfaces.
Этот же вопрос можно продублировать самому автору Cadey. Правда в Монреале пока 4 утра, так что ответы от нее будут после обеда.
Hi, author of the post here. Sorry I'm not the best with Russian, so I'll be using Google Translate to understand comments here and I'll answer questions in English.

Hi. Hopefully this won't sound like an advertisement, but the recently-released DeepL machine translation works way better for ru<->eng than Google Translate in my experience. Just in case.

После этой статьи было бы ещё интересно прочесть статью о том, как, используя уязвимости в гостевом и/или хостовом ядре, можно таки попасть из user mode в материнскую систему.
Sign up to leave a comment.