mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #730] Wishlist: easier way to allow additional system calls #495
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#495
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 @lheckemann on GitHub (Aug 18, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/730
For debugging software within jails, I like to be able to use tools like strace and gdb, which use the
ptracesystem call. However, I currently don't know of a way of allowing ptrace while keeping seccomp enabled without copying the default list of blocked system calls and removing ptrace, which makes for extremely unwieldy command lines. Something like--seccomp.blacklist=!ptraceor--seccomp.allow=ptracewould be nice (as opposed to--seccomp.keep=ptracewhich seems to allow nothing but ptrace...).Or would it make more sense to use gdb on firejail and skip ahead to the
execsystem call when doing this?@Fred-Barclay commented on GitHub (Aug 19, 2016):
Would
--seccomp.keep=ptracedo what you're looking for?@lheckemann commented on GitHub (Aug 19, 2016):
That results in the following seccomp filter:
Which allows nothing but ptrace, causing such things as executing a shell, opening a file, or even writing to a previously opened file to fail. I meant to write
--seccomp.keep, not--seccomp.whitelist(which doesn't exist) in the initial comment (fixed).@netblue30 commented on GitHub (Aug 20, 2016):
Unfortunately, just allowing ptrace syscall will not be enough. It also needs to be able to run SUID binaries inside the sandbox - strace is SUID. This is how you can run it:
Or you can just start a sandbox with --noprofile and run strace inside the sandbox:
I'll add a description in FAQ.
@lheckemann commented on GitHub (Aug 20, 2016):
strace isn't SUID on my system, and I don't see any reason why it would need to be.
firejail --ignore=seccomp --noblacklist=/usr/bin/strace strace echo helloworks just fine for me...@netblue30 commented on GitHub (Aug 20, 2016):
You are right, I forgot about the blacklist! I'll bring a command line flag in, something like "firejail --debug-ptrace [...] application"
@lheckemann commented on GitHub (Aug 22, 2016):
Wouldn't it be better to have a more generic option like
--seccomp.add=ptraceso that we can make use of the standard blacklist, unblocking individual calls?EDIT: would
--allow-debuggersmaybe be a better name for the option than--debug-ptraceif you decide to go with that route? Its function being allowing the ptrace syscall and disabling blacklisting for strace, gdb, ltrace, etc?@netblue30 commented on GitHub (Aug 22, 2016):
Probably, but it will complicate the code - we are still SUID, so we need to keep it as simple as possible.
OK, it will be --allow-debuggers
@netblue30 commented on GitHub (Aug 22, 2016):
All set, you can try it out.
@lheckemann commented on GitHub (Aug 23, 2016):
Great, thanks!