Skip to content

Commit b10ec31

Browse files
authored
Merge pull request #6622 from powerjungle/chore/fix-whitelist-man
docs: improve whitelist and blacklist descriptions in man pages
2 parents 7bb4d7c + 08a2f0e commit b10ec31

File tree

2 files changed

+69
-14
lines changed

2 files changed

+69
-14
lines changed

src/man/firejail-profile.5.in

+42-8
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,21 @@ for more details.
248248
Examples:
249249
.TP
250250
\fBblacklist file_or_directory
251-
Blacklist directory or file. Examples:
251+
Blacklist directory or file. This makes a file or directory
252+
completely inaccessible. All other files and directories are unaffected.
253+
The blacklisted file or directory is still visible on the filesystem,
254+
even if it's inaccessible.
255+
.br
256+
257+
.br
258+
Symbolic link handling: Blacklisting a path that is a symbolic link will also
259+
blacklist the path that it points to.
260+
For example, if ~/foo is blacklisted and it points to /bar, then /bar will also
261+
be blacklisted.
262+
.br
263+
264+
.br
265+
Examples:
252266
.br
253267

254268
.br
@@ -452,16 +466,36 @@ Mount an empty tmpfs filesystem on top of directory. Directories outside user ho
452466
Blacklist violations logged to syslog.
453467
.TP
454468
\fBwhitelist file_or_directory
455-
Whitelist directory or file. A temporary file system is mounted on the top directory, and the
456-
whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent,
457-
everything else is discarded when the sandbox is closed. The top directory can be
458-
all directories in / (except /proc and /sys), /sys/module, /run/user/$UID, $HOME and
459-
all directories in /usr.
469+
Whitelist directory or file. A temporary file system is mounted on the top directory.
470+
In the context of firejail, top directory means, if the whitelisted file's path is
471+
for example /etc/somedir/somefile, then the top directory would be /etc.
472+
All other top directories like /opt, /usr and so on, haven't changed, so all files there
473+
are still accessible, unless a file or directory inside them is also whitelisted.
474+
This is why sometimes it's beneficial to use blacklist in combination with whitelist,
475+
if used for different top directories.
460476
.br
461477

462478
.br
463-
Symbolic link handling: with the exception of user home, both the link and the real file should be in
464-
the same top directory. For user home, both the link and the real file should be owned by the user.
479+
The whitelisted files are mount-binded inside. Modifications to whitelisted files are
480+
persistent, everything else in the same top directory is discarded when the sandbox is closed.
481+
.br
482+
483+
.br
484+
The top directory can be most directories in /, but there are some special cases.
485+
The /proc and /sys top directories aren't allowed, but /sys/module is allowed.
486+
Also /run/user/$UID, $HOME and all directories in /usr are treated as a top directory.
487+
.br
488+
489+
.br
490+
Symbolic link handling: Whitelisting a path that is a symbolic link will also
491+
whitelist the path that it points to.
492+
For example, if ~/foo is whitelisted and it points to ~/bar, then ~/bar will
493+
also be whitelisted.
494+
.br
495+
Restrictions: With the exception of the user home directory, both the link and
496+
the real file should be in the same top directory.
497+
For symbolic links in the user home directory, both the link and the real file
498+
should be owned by the user.
465499

466500
.TP
467501
\fBwhitelist-ro file_or_directory

src/man/firejail.1.in

+27-6
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ Example:
190190
# firejail \-\-bind=/config/etc/passwd,/etc/passwd
191191
.TP
192192
\fB\-\-blacklist=dirname_or_filename
193-
Blacklist directory or file. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
193+
Blacklist directory or file. This makes a file or directory
194+
completely inaccessible. All other files and directories are unaffected.
195+
The blacklisted file or directory is still visible on the filesystem,
196+
even if it's inaccessible.
194197
.br
195198

196199
.br
@@ -200,6 +203,10 @@ For example, if ~/foo is blacklisted and it points to /bar, then /bar will also
200203
be blacklisted.
201204
.br
202205

206+
.br
207+
File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
208+
.br
209+
203210
.br
204211
Example:
205212
.br
@@ -3116,18 +3123,32 @@ $ firejail \-\-net=br0 --veth-name=if0
31163123
#endif
31173124
.TP
31183125
\fB\-\-whitelist=dirname_or_filename
3119-
Whitelist directory or file. A temporary file system is mounted on the top directory, and the
3120-
whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent,
3121-
everything else is discarded when the sandbox is closed. The top directory can be
3122-
all directories in / (except /proc and /sys), /sys/module, /run/user/$UID, $HOME and
3123-
all directories in /usr.
3126+
Whitelist directory or file. A temporary file system is mounted on the top directory.
3127+
In the context of firejail, top directory means, if the whitelisted file's path is
3128+
for example /etc/somedir/somefile, then the top directory would be /etc.
3129+
All other top directories like /opt, /usr and so on, haven't changed, so all files there
3130+
are still accessible, unless a file or directory inside them is also whitelisted.
3131+
This is why sometimes it's beneficial to use blacklist in combination with whitelist,
3132+
if used for different top directories.
3133+
.br
3134+
3135+
.br
3136+
The whitelisted files are mount-binded inside. Modifications to whitelisted files are
3137+
persistent, everything else in the same top directory is discarded when the sandbox is closed.
3138+
.br
3139+
3140+
.br
3141+
The top directory can be most directories in /, but there are some special cases.
3142+
The /proc and /sys top directories aren't allowed, but /sys/module is allowed.
3143+
Also /run/user/$UID, $HOME and all directories in /usr are treated as a top directory.
31243144
.br
31253145

31263146
.br
31273147
Symbolic link handling: Whitelisting a path that is a symbolic link will also
31283148
whitelist the path that it points to.
31293149
For example, if ~/foo is whitelisted and it points to ~/bar, then ~/bar will
31303150
also be whitelisted.
3151+
.br
31313152
Restrictions: With the exception of the user home directory, both the link and
31323153
the real file should be in the same top directory.
31333154
For symbolic links in the user home directory, both the link and the real file

0 commit comments

Comments
 (0)