Giter VIP home page Giter VIP logo

Comments (6)

AkihiroSuda avatar AkihiroSuda commented on August 23, 2024 1

Or maybe we don't need any SETUID stuff. Just bind 0.0.0.0:80, and reject connections from non-loopback addresses.

from lima.

AkihiroSuda avatar AkihiroSuda commented on August 23, 2024

Another way is to replace ssh -L with a home-made port forwarder, and set SETUID bit on its binary.
(We could just set SETUID on ssh binary, but perhaps it may cause some unexpected side effect)

Most parts of the port forwarder could be executed without the SETUID bit. It will receive sockfd from a SETUID helper via SCM_RIGHTS cmsg.
https://github.com/apple/darwin-xnu/blob/xnu-7195.101.1/tests/fd_send.c

from lima.

jandubois avatar jandubois commented on August 23, 2024

reject connections from non-loopback addresses

Maybe make the rejection configurable? I think it can be useful to expose an app running in lima to the local network, so you can test it e.g. as a service from another machine.

from lima.

AkihiroSuda avatar AkihiroSuda commented on August 23, 2024

Yes, we will eventually need config file and (REST?) API to control flexible forwarding

from lima.

markomitranic avatar markomitranic commented on August 23, 2024

Until
this gets done, I hope this old little snippet helps someone :)

alias port80="sudo ifconfig lo0 127.0.0.1 alias
echo \"rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 8080\" | sudo pfctl -ef -"

To revert the mappings back to their original state, just empty the file.

sudo pfctl -f /etc/pf.conf

Same for 443

from lima.

AkihiroSuda avatar AkihiroSuda commented on August 23, 2024

PR: #283

from lima.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.