Skip to content

Commit 78a871f

Browse files
committed
docs/ioc-services: explain systemd hardening
1 parent 05dcd9a commit 78a871f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/nixos-services/user-guides/ioc-services.rst

+35
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,38 @@ and the man pages :manpage:`systemd.unit(5)`,
277277
and other related systemd documentation.
278278

279279
.. _systemd.services options: https://search.nixos.org/options?query=systemd.services.
280+
281+
Systemd hardening
282+
^^^^^^^^^^^^^^^^^
283+
284+
By default,
285+
the :nix:option:`services.iocs` module configures some systemd security hardening options.
286+
For example,
287+
the IOC can't change the system clock,
288+
or change the machine's hostname.
289+
290+
To see the list of the enabled systemd hardening options,
291+
examine the :file:`nixos/modules/iocs.nix` file in the EPNix source code.
292+
293+
You can turn off systemd hardening options by overriding the setting:
294+
295+
.. code-block:: nix
296+
:caption: Turning off a systemd hardening option
297+
298+
services.iocs.myIoc = {
299+
package = pkgs.myTop;
300+
workingDirectory = "iocBoot/iocMyIoc";
301+
};
302+
303+
# These options will modify the generated systemd service
304+
systemd.services.myIoc = {
305+
# In the [Service] section,
306+
# ProtectClock was enabled by default,
307+
# but we override it here
308+
# to allow the IOC to change the system clock:
309+
serviceConfig.ProtectClock = false;
310+
};
311+
312+
For more information about hardening options,
313+
examine the man pages :manpage:`systemd.exec(5)`
314+
and :manpage:`systemd.resource-control(5)`.

0 commit comments

Comments
 (0)