mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3720] Question about --dns option #2341
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#2341
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 @deb75 on GitHub (Nov 2, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3720
I launch firefox as follows :
br0 is a bridge with ip 10.10.1.1
I made a nameserver listen on 10.10.1.1:53 (checked with nmap). The same name server also listens on 127.0.0.1 (not the jail loopback).
The file /etc/resolv.conf contains
nameserver 127.0.0.1and that of the jailnameserver 10.10.1.1.I noticed that if I manually change the global file /etc/resolv.conf to 127.0.2.1, then firefox becomes unable to resolve urls.
Normally, it should not be affected as the file /etc/resolv.conf in the jail is not changed (checked from firefox itself).
So, why a manual change on the global resolv.conf file affects the browser ?
@deb75 commented on GitHub (Nov 3, 2020):
Ok, I think I did not understant how it works.
the dns option runs a dns server inside the jail at given address. But this server relies itself on the global
resolv.conffile.@rusty-snake commented on GitHub (Nov 8, 2020):
--dns=1.2.3.4modifies/etc/resolv.confinside the sandbox, but don't start a dnsserver in the sandbox. Check withfirejail --dns=9.9.9.9 ps -ef.@deb75 commented on GitHub (Jan 8, 2021):
My global
/etc/resolv.confonly contains :I run firefox as follows :
Inside the sandbox, I checked that the nameserver is still 127.0.2.1, however if inside the sandbox I scan 127.0.2.1 :
I get :
The same command outside of the sandbox shows that the port is opened.
So, How am I sure that firefox inside the sandbox really uses my local dns server ?
Regards
@rusty-snake commented on GitHub (Jan 8, 2021):
Use
--netfilter=and--netfilter6=to only allow whitelisted connections.You need to drop
--net=br0IIRC.@deb75 commented on GitHub (Jan 8, 2021):
Thanks,
But then, is my current configuration invalid ? that is to say it does not really do what I thought it could do ?
As a matter of fact, if I modify the global
resolv.conf, firefox inside the sandbox can no more access anything.If I cancel the modification, firefox works again as usual.
I would like to understand how this works. Apparently, firefox uses my local dns server, but I cannot access it manually in the sandbox.
@rusty-snake commented on GitHub (Jun 10, 2021):
Do you still have questions?
@rusty-snake commented on GitHub (Aug 4, 2021):
I'm closing here due to inactivity, please fell free to request to reopen if you have more questions.