cosmopolitan/tool/net
Justine Tunney 7cf66bc161 Prevent Make from talking to public Internet
This change introduces the nointernet() function which may be called to
prevent a process and its descendants from communicating with publicly
routable Internet addresses. GNU Make has been modified to always call
this function. In the future Landlock Make will have a way to whitelist
subnets to override this behavior, or disable it entirely. Support is
available for Linux only. Our firewall does not require root access.

Calling nointernet() will return control to the caller inside a new
process that has a SECCOMP BPF filter installed, which traps network
related system calls. Your original process then becomes a permanent
ptrace() supervisor that monitors all processes and threads descending
from the returned child. Whenever a networking system call happens the
kernel will stop the process and wakes up the monitor, which then peeks
into the child memory to read the sockaddr_in to determine if it's ok.

The downside to doing this is that there can be only one supervisor at a
time using ptrace() on a process. So this firewall won't be enabled if
you run make under strace or inside gdb. It also makes testing tricky.
2022-08-12 21:51:39 -07:00
..
demo Propagate nil in Lua APIs more often 2022-08-05 17:34:13 -07:00
tiny Fix bugs with recent change 2022-04-16 10:40:23 -07:00
.init.lua Add SSL to redbean 2021-06-24 13:20:50 -07:00
counters.inc Make some systemic improvements 2022-05-18 16:52:36 -07:00
dig.c Restart CI for New Technology and UBSAN hunting 2022-03-21 04:32:57 -07:00
echo.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
favicon.ico Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
help.txt Refactor pledge() to be more configurable 2022-08-11 11:35:30 -07:00
largon2.c WIP: Correct all typos (#498) 2022-07-20 14:01:15 -07:00
lfinger.c Add tcp syn packet fingerprinting to redbean 2022-07-17 02:43:49 -07:00
lfinger.h Add tcp syn packet fingerprinting to redbean 2022-07-17 02:43:49 -07:00
lfuncs.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
lfuncs.h Do some work on redbean 2022-07-22 20:44:24 -07:00
ljson.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
ljson.h Further improve JSON serialization 2022-07-11 23:06:49 -07:00
lmaxmind.c Unbloat the build 2022-08-11 00:15:29 -07:00
lpath.c Make improvements 2022-07-21 03:36:42 -07:00
lpath.h Make improvements 2022-07-21 03:36:42 -07:00
lre.c Unbloat the build 2022-08-11 00:15:29 -07:00
lsqlite3.c Unbloat the build 2022-08-11 00:15:29 -07:00
luacheck.h Fix reporting of Lua stack items from various hook calls (#395) 2022-04-27 21:57:52 -07:00
net.mk Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
redbean-original.c Remove plenty of makefile misconfigurations 2022-07-21 09:20:59 -07:00
redbean-static.c Remove plenty of makefile misconfigurations 2022-07-21 09:20:59 -07:00
redbean-unsecure.c Remove plenty of makefile misconfigurations 2022-07-21 09:20:59 -07:00
redbean.c Prevent Make from talking to public Internet 2022-08-12 21:51:39 -07:00
redbean.png Make improvements 2020-09-14 00:02:34 -07:00
sandbox.h Strengthen the pledge() polyfill 2022-06-27 13:02:17 -07:00
wb.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00