Skip to content
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

--netlock #4848

Closed
netblue30 opened this issue Jan 12, 2022 · 1 comment
Closed

--netlock #4848

netblue30 opened this issue Jan 12, 2022 · 1 comment
Labels
enhancement New feature request

Comments

@netblue30
Copy link
Owner

netblue30 commented Jan 12, 2022

A short description of what's coming.

Several type of programs (email clients, multiplayer games etc.) talk to a very small number of IP addresses. The best example is tor browser. It only talks to a guard node, and there are two or three more on standby in case the main one fails. During startup it contacts all of them, after that it keeps talking to the main one... for weeks!

So I put in something I would call a network locker. The browser starts up, and for about one minute firejail captures the network traffic and extracts the IP addresses. Then, it configures netfilter firewall allowing only traffic to/from this addresses. If somebody takes control of the browser using a zero-day exploit and tries to bypass tor, the firewall will drop the traffic.

It looks like this:

$ firejail --name=tor --private=~/tor-browser_en-US --netlock --net=enp3s0 ./start-tor-browser.desktop
Reading profile /etc/firejail/start-tor-browser.desktop.profile
[...]

accumulating traffic for 60 seconds
.. 46.4.66.178  217.182.196.67 ..........................................................

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]

-A INPUT -s 127.0.0.0/8 -j ACCEPT
-A OUTPUT -d 127.0.0.0/8 -j ACCEPT

-A INPUT -s 46.4.66.178 -p tcp  -j ACCEPT
-A OUTPUT -d 46.4.66.178 -p tcp  -j ACCEPT

-A INPUT -s 217.182.196.67 -p tcp  -j ACCEPT
-A OUTPUT -d 217.182.196.67 -p tcp  -j ACCEPT

COMMIT
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

firewall deployed

He got two addressees and locked the network. To set the firewall you need a network namespace (--net=eth0), use "ip addr show" or "/sbin/ifconfg" to get the name of your interface. It has been working fine for me for at least one month. Today, it just auto-updated to a new browser version through the firewall.

I didn't see it changing the guard node yet. It should happen every few weeks. I assume the change takes place at startup, so we can detect it when we set the firewall. The default network monitoring time is one minute, I'll have to make it configurable. Give it a try, and let me know what you think, thanks.

@netblue30 netblue30 added the enhancement New feature request label Jan 12, 2022
@netblue30
Copy link
Owner Author

closed!

@kmk3 kmk3 changed the title --netlocker --netlock Feb 3, 2022
kmk3 added a commit that referenced this issue Feb 3, 2022
@kmk3 kmk3 added this to To do in Release 0.9.68 via automation Feb 3, 2022
@kmk3 kmk3 moved this from To do to Done (on RELNOTES) in Release 0.9.68 Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
No open projects
Release 0.9.68
  
Done (on RELNOTES)
Development

No branches or pull requests

1 participant