mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #639] allow empty --protocol= list #442
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#442
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 @vn971 on GitHub (Jul 17, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/639
Could an empty protocol list be allowed for firejail?
Like this:
firejail --noprofile --protocol=I think it may make sense in some scenarions. If it's not too difficult, please add such an ability?
(Sorry, I don't feel myself confident with C, therefore I can only raise issues & make some tests.. No code changes since I'd probably leak something or worse.)
Relates to:
@netblue30 commented on GitHub (Jul 18, 2016):
I'll bring a fix in this week, thanks!
@Fred-Barclay commented on GitHub (Jul 18, 2016):
I'm afraid I'm in the dark here (which is my fault) and I can't quite figure out what this would accomplish. Would
--protocol=be the same as--protocol=*i.e. would it allow all protocols (unix, inet, inet6...)? In which case I would suggest either--protocolor (preferably)--protocol=allas the syntax. To me at any rate,--protocol=looks like it's missing an argument on the end. 😃Or would it deny access to any protocols? In which case, why use it? Wouldn't the absence of the protocol filter, in and of itself deny access to the filtered protocols?
Or am I missing the point entirely?
Like I said, I don't mean to indicate that I think this is a bad idea in any way; I just can't quite figure out what it does.
@vn971 commented on GitHub (Jul 18, 2016):
Hi @Fred-Barclay, by
--protocol=I mean an empty set of allowed protocols. Same as an empty set in Math, or[]as empty arrays in programming.An empty protocol list means the application cannot use unix sockets, inet interfaces and so on. But it still has access to the filesystem, so it can be a perfectly fine CLI/terminal program.
I guess @netblue30 will decide for naming.
--protocol=nonecould work for some users. I'm perfectly fine with--protocol=because it matches my expectations as a programmer.@Fred-Barclay commented on GitHub (Jul 18, 2016):
Thanks @vn971
Like you, I'm not very confident with C (though I'm practising!) so I'm not really able to dig into the source code to understand these things. 😉
What would be the difference between this (which seems to basically be
--protocol=none, am I correct?) and simply not having a protocol filter at all? Wouldn't the lack of a protocol argument deny access to the unix sockets, inet interfaces, and so on?@vn971 commented on GitHub (Jul 18, 2016):
@Fred-Barclay I think it can be the whitelist/blacklist story that is confusing you. The
--protocoldirective is whitelist, not blacklist. And the absence of--protocolmeans to allow everything there is. If you think about it, it really is a little bit strange (at least semantically).--protocol=and the absence of a--protocoldirective having the opposite meaning.It's probably because of the history of firejail and that it tries to be "simple" for end users, therefore favoring "blacklisting" instead of "whitelisting". So adding new directives makes the container boundaries stronger, and some of the directives are whitelist-like.
@Fred-Barclay commented on GitHub (Jul 19, 2016):
Aha, that does make more sense! Thanks, mate.
In that case, might I suggest using the syntax
--protocol=noneto minimise confusion and make its purpose clear?@netblue30 commented on GitHub (Jul 20, 2016):
Yes, it will be --protocol=none, I'll have a fix in this week.
@vn971 commented on GitHub (Dec 30, 2016):
@netblue30 ping :)
@chiraag-nataraj commented on GitHub (Aug 19, 2018):
I might try working on this, since I don't think it's in yet.
@chiraag-nataraj commented on GitHub (Aug 19, 2018):
Oh right...I tried working on this a while back and couldn't really figure out how to safely do it... @netblue30 can you take care of this? 🙂
@rusty-snake commented on GitHub (Aug 11, 2021):
protocol unixreturnsEOPNOTSUPPfor every call tosocket(2)except forsocket(AF_UNIX, ...). Therefore would an emptyprotocolreturnEOPNOTSUPPfor every call tosocket(2)(without exceptions).The only difference between
seccomp socketand an emptyprotocolis thatseccompdefaults toEPERM(and does what ever is specified inseccomp-error-actionif set) whileprotocolalways returnsEOPNOTSUPP.I'd suggest to close where as wontfix as the difference is so small and the only use case I can see are cli programs which do not need any sockets.
(In that case update pngquant.profile)