mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #362] seccomp, --user, caps, setcap not working together #259
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#259
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 @aliascc on GitHub (Mar 10, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/362
Hi,
I have the following script:
I run the commands (as root):
And it gives me the following error:
if I run the command without --seccomp it works correctly:
Is this expected behavior or an issue?
@netblue30 commented on GitHub (Mar 10, 2016):
It is clear seccomp doesn't like something there. Check your system log (/var/log/syslog on Debian) for seccomp messages such as this:
It will tell you what system call killed the process.
@aliascc commented on GitHub (Mar 10, 2016):
I look at syslog, kern.log, auth.log, nothing is been log when the error occurs :S
@netblue30 commented on GitHub (Mar 10, 2016):
I think the problem is with the port number, use something above 1000. The order of operation is this: first the user is switched to carlos, then secomp and caps are set, then the program is run. Your program is running as carlos, so it will not be able to bind to that port.
@aliascc commented on GitHub (Mar 10, 2016):
Yes, but adding the CAP_NET_BIND_SERVICE, CAP_NET_ADMIN to the executable should allow the process to run. Are you saying that seccomp filters go first and then the CAPs are applied?
@netblue30 commented on GitHub (Mar 10, 2016):
A root user without CAP_NET_BIND cannot bind to ports below 1024. A regular user can never bind to ports below 1024, regardless what the value of CAP_NET_BIND is. Your program is running as user carlos.
@aliascc commented on GitHub (Mar 11, 2016):
Yes it is running as user carlos. But the python interpreter has the "setcap" for CAP_NET_BIND_SERVICE. If I do
It works correctly.
the command
@netblue30 commented on GitHub (Mar 11, 2016):
So basically you allow any program running under python to rise privileges and become root for networking purposes. You were right, --seccomp is the problem. It disables the privilege rise, so actually your program is prevented from becoming root, and it will fail to bind to that specific port.
@aliascc commented on GitHub (Mar 13, 2016):
So it is an expected behavior from seccomp. I guess we can close the issue. Thank you very much!