Skip to content

Commit bc9c6ff

Browse files
committed
docs(admin/policy): document ReadWritePaths for logging to files
The default Anubis systemd configuration is very restrictive in order to prevent any possible compromise of Anubis to be useful by threat actors. As such, it assumes all logs will be pushed to the system journal. Some administrators do not want Anubis' logs to be pushed to the system journal and want Anubis to log to a file instead. This change documents how to set up ReadWritePaths in the Anubis systemd configuration such that Anubis can lot to a file as administrators expect. Closes: #1468 Signed-off-by: Xe Iaso <[email protected]>
1 parent 35b5e78 commit bc9c6ff

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

docs/docs/admin/policies.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,32 @@ logging:
393393

394394
When files are rotated out, the old files will be named after the rotation timestamp in [RFC 3339 format](https://www.rfc-editor.org/rfc/rfc3339).
395395

396+
:::note
397+
398+
If you are running Anubis in systemd via a native package, the default systemd unit settings are very restrictive and will forbid writing to folders in `/var/log`. In order to fix this, please make a [drop-in unit](https://www.flatcar.org/docs/latest/setup/systemd/drop-in-units/) like the following:
399+
400+
```text
401+
# /etc/systemd/[email protected]/50-var-log-readwrite.conf
402+
[Service]
403+
ReadWritePaths=/run /var/log/anubis
404+
```
405+
406+
Once you write this to the correct place, reload the systemd configuration:
407+
408+
```text
409+
sudo systemctl daemon-reload
410+
```
411+
412+
And then restart Anubis:
413+
414+
```text
415+
sudo systemctl restart anubis@instance-name
416+
```
417+
418+
You may be required to make drop-ins for each Anubis instance depending on the facts and circumstances of your deployment.
419+
420+
:::
421+
396422
### `stdio` sink
397423

398424
By default, Anubis logs everything to the standard error stream of its process. This requires no configuration:

0 commit comments

Comments
 (0)