mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #5870] dhclient-script: cannot update resolv.conf with read-only /etc #3113
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#3113
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 @kris7t on GitHub (Jun 27, 2023).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5870
Originally assigned to: @kris7t on GitHub.
Description
It looks like since
d1124df32d, the default ISCdhclient-scriptis broken inside the sandbox, because it is not allowed to create a newresolv.conf.Falling back to
--writable-etcis not desirable, because ordinarily, configuring DNS in the sandbox via DHCP should not cause changes to the configuration of the host machine. Instead, we should provide an/etc/dhclient-enter-hooks(by mounting an appropriate one) that relays DNS settings back to firejail or otherwise makes the changes private to the sandbox.I could try working of this if I have some free time.
Steps to Reproduce
Run firejail with
--net=<some bridge interface> --ip=dhcp ip6=dhcpoptions, but without specifying--writable-etc.Expected behavior
The ISC
dhclientconfigures domain name resolution according to the DHCP server.Actual behavior
DNS servers are not configured within the sandbox. This means that, unless the system default DNS server is reachable from within the sandbox, domain name resolution within the sandbox will fail.
This can be worked out somewhat by manually specifying the DNS server address with the
--dnsflag. This is feasible where the user completely controls the network (e.g., the network is a bridge interface managed by Libvirt, NetworkManager, or similar, and the DNS server runs on the host machine). However, it might be a challenge in setups where the DHCP or DNS server address might change.Even if the
--dnsflag is specified to fix domain name resolution, warnings such aswill be printed to the terminal.
If
dhclientis not in ordinary use on the host machine (e.g., DHCP is usually handled by NetworkManager or systemd-networkd), removingresolv.confupdate altogether from the purview ofdhclient(and relying entirely on--dns) can be a sufficient workaround. According todhclient-script(8),/sbin/dhclient-scriptshould not be modified directly. Instead, I created/etc/dhclient-enter-hookswith the following contentsto override
make_resolv_confbehavior with a no-op.Behavior without a profile
Nothing changes, as the
--ip=dhcp --ip6=dhcpflags are not set by any profile.Additional context
I am using ISC
dhclient 4.4.3.P1-2with the default/sbin/dhclient-script.Environment
firejail --version):firejail-git 0.9.72.r9473.524902401-1was compiled (
git rev-parse HEAD):5249024013Checklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)Log
The relevant portion of the
firejail --net=<some bridge interface> --ip=dhcp --ip6=dhcp --debuglog is as follows (details of the network and DHCP responses were redacted for privacy):