-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: manpage should explain precedence of CLI options vs profile settings #6358
Comments
Firejails options work by staring with a minimal sandbox and then adding stuff like mounts, seccomp filters, process attributes, …. The most options do not have an inverse, hence there is no precedence, either they are present somewhere or nowhere. There is only a small number of options that have any kind of inverse or an single value option (most are flags or collections):
The override behaviour of each of them has to be documented separately cause they do not follow any global logic. Secondly the usage of Documenting override behaviour is not limited to cli vs. profile. Also inside profiles (and include chains) it is non-intuitive. Given the following profile, how will a) blacklisted (ro/rw does not matter)
|
Not what I'm seeing: $ firejail --ignore=quiet --ignore='include disable-common.inc' echo "testing"
Reading profile /etc/firejail/default.profile
Reading profile /etc/firejail/globals.local
Reading profile /etc/firejail/disable-programs.inc
** Note: you can use --noprofile to disable default.profile **
firejail version 0.9.73
Parent pid 16527, child pid 16528
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Base filesystem installed in 52.42 ms
Child process initialized in 117.45 ms
testing
Parent is shutting down, bye... Observations: default.profile contains Do you have a reproducers for your assumed behaviour? I do agree this might need extra clarity in documentation, cfr. @rusty-snake's remarks. |
Thanks for the replies!
So what happens for collections without an inverse like e.g.
There is probably a way to say that in the manpage, too. Maybe something like:
@glitsj16 I arrived at that conclusion because I wasn't able to un-blacklist But given @rusty-snake's comment, it seems it's much more complicated than I thought. I'll write a PR with a draft of what I think might be an OK explanation, then we can refine it from there. |
Sorry, I only now saw that at least for
And searching for Then maybe just 1 sentence to explain the precedence for multiple or conflicting options is explained in the option's own docs, done. |
I can see the confusion. For the $ firejail --ignore=quiet --ignore='blacklist ${PATH}/nc' nc -h For overriding protocol you need (1) a new protocol option AND (2) stop that from being overriden by the profile via a additional HTH |
firejail/src/firejail/profile.c Lines 1959 to 1973 in e25596b
For the most collections it will be the union. But be careful what a collection is.
Think of
Every bit of clarity helps. Even if only the simple case are covered first.
That works. In general and for all options. |
Thanks for the replies again! @glitsj16 That makes sense. And I just saw that @rusty-snake I can see why this has been difficult to document 😮 The |
Is your feature request related to a problem? Please describe.
As far as I can tell, settings in a profile always take precedence over settings provided via CLI arguments. Is that right? And as far as I can tell, this isn't documented anywhere in the manpage. Even if I'm wrong, the inverse statement isn't documented in the manpage either (again: AFAICT).
Describe the solution you'd like
The precedence of profiles vs CLI options should be explained in the manpage. Probably in the section at the beginning, either just before or just after the profile discovery algorithm is explained.
Describe alternatives you've considered
None.
Additional context
None.
Relates to:
The text was updated successfully, but these errors were encountered: