mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2321] netfilter-default in firejail.config does not appear to be working #1548
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#1548
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 @sta-c0000 on GitHub (Dec 28, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2321
Environment:
firejail version 0.9.56
Linux buster 4.18.0-3-amd64 #1 SMP Debian 4.18.20-2 (2018-11-23) x86_64 GNU/Linux
If a
netfilter-defaultentry is infirejail.config, it does not take effect whennetfilteris not specified or whennetfilteris specified without file argument (profile or command line). Instead we get no rules or firejail's hardcoded iptables rules are applied by default.Line added in firejail.config:
netfilter-default /etc/firejail/dropall.netI was expecting
netfilter-defaultto take effect whenever there was nonetfilterspecified or whennetfilterwas specified without a file argument (as most profiles do). That's also how I interpret the comment infirejail.configabove# netfilter-default….Ideally, I would have liked root controlled whitelisted network access for everything.
So nothing would have access by default, then each app could get limited network namespace access (e.g. Mail client would have its own netfilter rules to reach mail server and specific ports only; Client-server app would have access to specific ports at database server only, etc.).
So basically an "application firewall"; we can nearly achieve this using firejail.
Unfortunately, user has full control over sandbox netfilter rules, so breaking out is easy with firejail the moment you allow
restricted-network no.But at least it would be nice to have control over the default netfilter rules.
Thank you!
@netblue30 commented on GitHub (Jan 9, 2019):
Thanks for the bug. I have a fix in:
314dde5d94It is a little bit different. Without a --netfilter on the command line or in the profile file, the sandbox will not attempt to set iptables. It also needs you to configure a network namespace (--net command) because it cannot change iptables config for the main network namespace.
You can make the command global by adding it to /etc/firejail/globals.local:
globals.local file is included from all profile files, including the default one.