mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3492] Suggestion: add --nsswitch-file option to better control name resolution #2199
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#2199
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 @95440b97d on GitHub (Jul 4, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3492
Hello,
I'm trying to better control/isolate DNS requests.
Firejail offers the --dns option to set a custom DNS server which creates an appropriate resolves.conf file with a nameserver entry. However, this alone is not enough as the order in which name resolution services are engaged is controlled by the nsswitch.conf file.
Perhaps we can add a --nsswitch-file option (in the same sense as the --host-file option) to have a custom nsswitch.conf file to be copied into the sandbox?
What are your thoughts?
@rusty-snake commented on GitHub (Jul 16, 2020):
My concerns are that nsswitch.conf also controls things such as passwd.
@rusty-snake commented on GitHub (Dec 6, 2020):
--dns=1.2.3.4is broken on Fedora 33 if the sandbox has system-bus access (e.g. neitherdbus-system filternordbus-system noneis used). That's because systemd-resolve is now the default and nss-resolve is used by default (ubuntu still has nss-dns as default IIRC).nsswitch.conf hosts line now looks like this:
hosts: files mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] myhostname dnsWhich translate to this:
/etc/hosts, Zeroconf, systemd-resolved (via D-Bus), myhostname,/etc/resolv.confTherefore any call to getaddrinfo tries resolved first.
Workarounds:
dbus-system filterordbus-system noneresolve [!UNAVAIL=return]Suggestion:
We should remove
resolve [!UNAVAIL=return]inside the sandbox.@sak96 commented on GitHub (Feb 8, 2022):
We should remove resolve [!UNAVAIL=return] inside the sandbox.
can this be tested.
/etc/nsswitch.confis non editable file within the sandbox.