Skip to content

Commit bef9cc3

Browse files
author
Andrei Zheregelia
committed
CLOS-3846: Document cagefsctl --enable/disable-cagefs-no-dev-log commands
Add the two new cagefsctl commands to the CLI reference table and update the CageFS Syslog section with usage instructions for the cagefs-no-dev-log feature flag.
1 parent 8094524 commit bef9cc3

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

docs/cloudlinuxos/cloudlinux_os_components/README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2919,17 +2919,35 @@ add <span class="notranslate"> `clean_user_php_sessions=false` line to _/etc/sys
29192919
#### Syslog
29202920
29212921
2922-
By default, <span class="notranslate"> _/dev/log_ </span> should be available inside end user's <span class="notranslate"> CageFS </span> . This is needed so that user's cronjobs and other things that user <span class="notranslate"> _dev/log_ </span> would get recorded in the system log files.
2922+
By default, <span class="notranslate"> _/dev/log_ </span> should be available inside end user's <span class="notranslate"> CageFS </span> . This is needed so that user's cronjobs and other things that use <span class="notranslate"> _/dev/log_ </span> would get recorded in the system log files.
2923+
2924+
##### Disabling /dev/log in CageFS
2925+
2926+
When <span class="notranslate"> _/dev/log_ </span> is available inside CageFS, jailed users can write arbitrary messages to the system log (e.g. via the <span class="notranslate"> `logger` </span> binary or by writing to the socket directly), which may be used to insert or spoof log entries. To prevent this, disable <span class="notranslate"> _/dev/log_ </span> inside CageFS using the <span class="notranslate"> `cagefs-no-dev-log` </span> feature flag:
29232927
2924-
This is controlled using file <span class="notranslate"> _/etc/rsyslog.d/schroot.conf_ </span> with the following content:
29252928
<div class="notranslate">
29262929
29272930
```
2928-
$AddUnixListenSocket /usr/share/cagefs-skeleton/dev/log
2931+
cagefsctl --enable-cagefs-no-dev-log
29292932
```
29302933
</div>
29312934
2932-
To remove presence of <span class="notranslate"> _dev/log_ </span> inside CageFS, remove that file, and restart rsyslog service.
2935+
This command removes <span class="notranslate"> _/dev/log_ </span> from the CageFS skeleton, updates the syslog configuration, and remounts all CageFS users. User processes inside CageFS will no longer be able to write to the system log via <span class="notranslate"> _/dev/log_ </span>.
2936+
2937+
To restore <span class="notranslate"> _/dev/log_ </span> in CageFS:
2938+
2939+
<div class="notranslate">
2940+
2941+
```
2942+
cagefsctl --disable-cagefs-no-dev-log
2943+
```
2944+
</div>
2945+
2946+
These commands automatically update the syslog configuration depending on the system setup:
2947+
2948+
* **Legacy syslog** (systems with <span class="notranslate"> _/etc/sysconfig/syslog_ </span>): the <span class="notranslate"> `-a /usr/share/cagefs-skeleton/dev/log` </span> option is removed from or added back to <span class="notranslate"> `SYSLOGD_OPTIONS` </span>, and the syslog service is restarted.
2949+
* **rsyslog** (systems with <span class="notranslate"> _/etc/rsyslog.conf_ </span>): the drop-in config file <span class="notranslate"> _/etc/rsyslog.d/cagefs-syslog-socket.conf_ </span> (containing <span class="notranslate"> `$AddUnixListenSocket /usr/share/cagefs-skeleton/dev/log` </span>) is deleted or recreated, and the rsyslog service is restarted.
2950+
* **systemd-journal** (systems where <span class="notranslate"> _/dev/log_ </span> is a symlink to <span class="notranslate"> _/run/systemd/journal/dev-log_ </span>): the socket is mounted directly into the CageFS skeleton as a hardlink; no syslog or rsyslog configuration changes are needed.
29332951
29342952
29352953
#### Excluding mount points

docs/cloudlinuxos/command-line_tools/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Options:
5050
| | <span class="notranslate"> --force-update </span> |force update of CageFS (ignore period of update)|
5151
| | <span class="notranslate"> --force-update-etc </span> |force update of _/etc_ directories for users in CageFS|
5252
| | <span class="notranslate"> --reconfigure-cagefs </span> |configure CageFS integration with other software (control panels, database servers, etc)|
53+
| | <span class="notranslate"> --enable-cagefs-no-dev-log </span> |stop creating <span class="notranslate"> _/dev/log_ </span> inside CageFS skeleton and remount all users (see [Syslog](/cloudlinuxos/cloudlinux_os_components/#syslog))|
54+
| | <span class="notranslate"> --disable-cagefs-no-dev-log </span> |restore <span class="notranslate"> _/dev/log_ </span> inside CageFS skeleton and remount all users (see [Syslog](/cloudlinuxos/cloudlinux_os_components/#syslog))|
5355

5456
Use the following syntax to manage users:
5557
<span class="notranslate"> `/usr/sbin/cagefsctl [OPTIONS] username [more usernames]` </span>

0 commit comments

Comments
 (0)