mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4339] Enhancement hardened internet sandbox needed #2628
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2628
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @osevan on GitHub (Jun 5, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4339
i want start on my host machine squid proxy inside firejail with hardened config.
what i want next is, allowing internet access only from "firejail squid ip address containerjail" ;everything outside of firejail squid jail container should not have internet access - for both ingress and egress.
i know its possible with iptables on hostside.. but how to tell iptables to allow only from firejail container internet and NOTHING ELSE.
i want connect with my browser to internet over squid proxy or other proxy and want start like this one:
firejail --proxy="idofsquidjail/or ip" --x11=xpra firefox
after than every application what i want should run with this command above --proxy.... should have internet access , but all other apps should not have access.
benefits:
everything on hostside cannot access to internet
kernel modules havent any internet access -big attack surface solved
whole /usr/bin havent any internet access - big attack surface solved
every binary not started with firejail --proxy command or proxychains functions in combination with firejail, cannot have access to internet ,because binary dont know how to route traffic out ....
only the admin know the way out and starting firejail smart and tidy :-)
Thanks and
Best Regards
@topimiettinen commented on GitHub (Jun 6, 2021):
I've implemented something similar with a combination of SELinux policies, NFTables firewall rules and NetLabel configuration. The unprivileged user
user_u:user_r:user_t:s0isn't allowed to use network, but for exampleuser_u:user_r:mozilla_t:s0can connect to TCP ports 80 and 443 anduser_u:user_r:ssh_t:s0can connect to TCP port 22. This may not be airtight considering various methods how processes could influence others but it's something.I don't know how to implement this with Firejail, but it would surely be great addition. If the user's shell would be firejailed and no way to escape firejailing, maybe everything could be run with 'network=none`, except for the explicitly allowed applications? In your proxy setup, the address of the proxy or crypto key to access it could be disclosed in a file, which would not be accessible by unprivileged applications and only the explicitly allowed applications could be allowed access via Firejail config?
@osevan commented on GitHub (Jun 6, 2021):
Im experimenting with additional user creation and grepping id.
I plant userid here:
ID 1001 for user with internet access.
iptables -A OUTPUT -m owner --uid-owner 1001 -j ALLOW
0 for root and other IDs what I want block :
iptables -A OUTPUT -m owner --uid-owner 0 -j REJECT
iptables -A OUTPUT -m owner --uid-owner 1000 -j REJECT
But my problem is, I cannot start firejail with different user and Firefox.
Sudo su -m internetaccessuser -c "firejail --debug Firefox" wont start - even when internetaccessuser are in sudoers group. ...
Maybe netblue can help
@rusty-snake commented on GitHub (Jun 6, 2021):
Do you get any error? Does firefox start w/o firejail? Do you can start
firejail curlor so? If you have a/etc/firejail/firejail.usersis internetaccessuser in it? Do you use X11 or Wayland?@osevan commented on GitHub (Jun 6, 2021):
Woow, Thanks for reply.
I can start Firefox with firejail with my default user and root.
I did not know about firejail.users file.
I will test this tomorrow.
Im using x11 and Firefox will be x11 sandboxed with xpra latest from xpra owns repository.
@osevan commented on GitHub (Jun 7, 2021):
firejail curl inside user shell works fine
EDIT by @rusty-snake: code-block
@osevan commented on GitHub (Jun 7, 2021):
here when i try to start
firejail --debug firefoxEDIT by @rusty-snake: code-block and details-summary
@osevan commented on GitHub (Jun 7, 2021):
firefox.profile works everything with success with default user:
EDIT by @rusty-snake: code-block
@osevan commented on GitHub (Jun 7, 2021):
i did xhost +local:internet
and than sudo -u internet -H firejail --debug firefox
this do this magic trick now all works very well...
please update documents and changelog for this fix