Skip to content
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: mention risk of SUID binaries and also firejail-users(5) #5290

Merged
merged 1 commit into from
Aug 14, 2022

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Aug 3, 2022

On the introduction of firejail(1), mention the main risk of SUID
binaries and that by default, only trusted users should be allowed to
run firejail (and how to accomplish that).

Note: The added comment line is completely discarded (so there is no
extraneous blank line); see groff_man(7) for details.

Suggested by @emerajid on #5288.

Relates to #4601.

@kmk3 kmk3 added the documentation Issues and pull requests related to the documentation label Aug 3, 2022
@kmk3
Copy link
Collaborator Author

kmk3 commented Aug 3, 2022

We could later expand on the tradeoffs as discussed on #4601; this is more just
to dispell a common misconception.

@@ -68,6 +68,17 @@ Each profile defines a set of permissions for a specific application or group
of applications. The software includes security profiles for a number of more common
Linux programs, such as Mozilla Firefox, Chromium, VLC, Transmission etc.
.PP
Firejail is currently implemented as an SUID binary, which means that if a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a native speaker, but shouldn't it be 'a' SUID binary... ?

Copy link
Collaborator Author

@kmk3 kmk3 Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glitsj16 on Aug 3:

Not a native speaker, but shouldn't it be 'a' SUID binary... ?

I'm fairly sure it depends on how you pronounce the word in question (at least
when spoken out loud; not sure about when writing manuals).

I personally read SUID spelled out as "S U I D" (that is, "ess you I d", in
which case "ess" starts with a vowel sound, and so "an" would be used), though
I can imagine someone saying it as "a soo'd binary" (that is, where "soo"
starts with a consonant sound and so "a" would be used). Not sure which one
would be the most common.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I happenend to be on IRC and asked around. Everyone agreed your version is the better, correct one :-) Thanks for the explanation, learned something today!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glitsj16 on Aug 3:

I happenend to be on IRC and asked around. Everyone agreed your version is
the better, correct one :-)

Good to know what the common usage is like :)

Thanks for the explanation, learned something today!

Anytime!

Copy link
Collaborator

@glitsj16 glitsj16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Firejail is currently implemented as an SUID binary, which means that if a
malicious or compromised user account manages to exploit a bug in Firejail,
that could ultimately lead to a privilege escalation to root.
To mitigate this, by default only the root user is allowed to run Firejail.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is only true if the file /etc/firejail/firejail.users exists.

@SkewedZeppelin
Copy link
Collaborator

by default only the root user is allowed to run Firejail

Most installations are not assumed to be used in this use-case, feels like an empty statement

@kmk3 kmk3 marked this pull request as draft August 3, 2022 15:01
that could ultimately lead to a privilege escalation to root.
To mitigate this, by default only the root user is allowed to run Firejail.
To allow more users, see firejail-users(5).
For more details on the security/usability tradeoffs of Firejail, see the
Copy link
Collaborator

@smitsohu smitsohu Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is maybe more a personal preference, but I think that ideally the man pages should be self contained, and references to the internet should remain an exception.

Your description of the issue is good, there is probably no need to refer to another place.

And btw, thank you for tackling this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smitsohu on Aug 3:

It is maybe more a personal preference, but I think that ideally the man
pages should be self contained, and references to the internet should remain
an exception.

Your description of the issue is good, there is probably no need to refer to
another place.

Misc: Do you mean avoiding "link-only" descriptions, or avoiding links in
general? If the latter, we could talk about it in a new discussion.

I agree that they should be self-contained as much as possible (and that
eventually parts of #4601 should be added), however I think that giving the
user a more detailed explanation is important in this case because being SUID
is arguably one of the key security aspects of firejail and so users might be
weary of using it after reading about the privilege escalation possibility.
Also, it is where I would point users to anyway if they have questions about it
(or if someone entirely dismisses firejail because of it).

Additionally, #4601 is kind of a meta-discussion (as it lists other related
discussions) and it contains a lot of the rationale and other (potentially
useful) information, which seems too long to fit in a man page.

I thought about later adding a "security considerations" section to the man
page to explain things such as when firejail should be used vs something else
(as noted on #4601). I made a brief attempt at that, but failed to make it
clear and concise, hence this briefer PR.

And also maybe create a "configuration" or "post-install" section to guide the
user (similar to --guide, but in text form).

And btw, thank you for tackling this.

No problem!

On the introduction of firejail(1), mention the main risk of SUID
binaries and that by default, only trusted users should be allowed to
run firejail (and how to accomplish that).

Note: The added comment line is completely discarded (so there is no
extraneous blank line); see groff_man(7) for details.

Suggested by @emerajid on netblue30#5288.

Relates to netblue30#4601.
@kmk3
Copy link
Collaborator Author

kmk3 commented Aug 5, 2022

@reinerh on Aug 3:

That is only true if the file /etc/firejail/firejail.users exists.

@SkewedZeppelin commented on Aug 3:

by default only the root user is allowed to run Firejail

Most installations are not assumed to be used in this use-case, feels like an
empty statement

Sorry; I failed on reading firejail-users(5) myself it seems.

I really thought that users had to be configured on the file (that's what I
always do at least).

Updated and force-pushed.

@kmk3 kmk3 marked this pull request as ready for review August 5, 2022 19:55
kmk3 added a commit to kmk3/firejail that referenced this pull request Aug 5, 2022
Since the man pages in src/man use a ".txt" file extension (rather than
".1" or ".5"), their filetype is detected by (neo)vim as "text".

So at the bottom of every man page, add a vim modeline in a comment and
set the filetype to "groff", to enable syntax highlighting.

Note: All of the generated ".man", ".1" and ".5" files are currently
being detected as "nroff".

Note2: Set the filetype to "groff" rather than "nroff" because at least
.UR and .UE are groff extensions.  These macros look the same with
either filetype, but there may be more extensions being used and the
nroff.vim syntax file (which is included by groff.vim) does things
differently based on which filetype is used.

Based on the following example from (neo)vim's filetype.txt:

    or add this modeline to the file:
            /* vim: set filetype=idl : */

See `:help groff.vim` and `:help filetype.txt` in (neo)vim.

See also groff_man(7) for the man page macros (including extensions).

Environment: neovim 0.7.2-3 on Artix Linux.

Misc: I noticed this on netblue30#5290.
@kmk3 kmk3 mentioned this pull request Aug 9, 2022
@netblue30 netblue30 merged commit e7dccf7 into netblue30:master Aug 14, 2022
@netblue30
Copy link
Owner

merged!

@kmk3 kmk3 deleted the docs-suid-firejail-users branch August 14, 2022 23:10
kmk3 added a commit that referenced this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues and pull requests related to the documentation
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

6 participants