Comments (6)
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.
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.
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.
Yes, we will eventually need config file and (REST?) API to control flexible forwarding
from lima.
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.
PR: #283
from lima.
Related Issues (20)
- Unreliable permissions for lima with vz and writable virtiofs home directory mount HOT 1
- The QEMU-based VM registered with `limactl start-at-login` in `launchd` does not start. HOT 1
- chmod failed when `mountInotify` is enabled HOT 1
- chmod failed when `mountInotify` is enabled HOT 5
- lima examples missing image HOT 1
- [hostagent] Driver stopped due to error: \"usernet unable to resolve IP for SSH forwarding\"
- Provide standard values "default" and "none" for most options HOT 1
- Cross-compiler for building "darwin" target HOT 5
- Failed to start VM when I want to modify PATH env var from env section in yaml template HOT 1
- Error: msg="did not receive an event with the \"running\" status" HOT 2
- Lima VM will randomly lose network connectivity HOT 5
- Call `limadriver.Validate` as part of `limayaml.Validate` HOT 2
- v0.23.0 planning HOT 4
- Inconsistent {{.Home}} and {{.User}} values between guest and host templates HOT 2
- Bound ports are not released immediately when container is stopped/deleted HOT 10
- Figure out why archlinux CI is broken HOT 2
- nerdctl start fails 2 of 3 times with bridge errors HOT 2
- Dependabot wasn't able to update downloading
- cross-vm network connectivity issue when using socket_vmnet
- Lima fails to install on fedora 40 using homebrew HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lima.