b9a53a
From d11fdacaf3c804b60dfe8371062f34ac2b624ac9 Mon Sep 17 00:00:00 2001
b9a53a
From: Jan Synacek <jsynacek@redhat.com>
b9a53a
Date: Fri, 13 Sep 2019 09:23:32 +0200
b9a53a
Subject: [PATCH] man: document systemd-analyze security
b9a53a
b9a53a
(cherry-picked from commit ee93c1e664a7bbc59f1578e285c871999507b14d)
b9a53a
b9a53a
Resolves: #1750343
b9a53a
---
b9a53a
 man/systemd-analyze.xml | 29 +++++++++++++++++++++++++++++
b9a53a
 1 file changed, 29 insertions(+)
b9a53a
b9a53a
diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml
b9a53a
index 7aa10fc68e..f3b595880f 100644
b9a53a
--- a/man/systemd-analyze.xml
b9a53a
+++ b/man/systemd-analyze.xml
b9a53a
@@ -106,6 +106,12 @@
b9a53a
       <arg choice="plain">service-watchdogs</arg>
b9a53a
       <arg choice="opt"><replaceable>BOOL</replaceable></arg>
b9a53a
     </cmdsynopsis>
b9a53a
+    <cmdsynopsis>
b9a53a
+      <command>systemd-analyze</command>
b9a53a
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
b9a53a
+      <arg choice="plain">security</arg>
b9a53a
+      <arg choice="plain" rep="repeat"><replaceable>UNIT</replaceable></arg>
b9a53a
+    </cmdsynopsis>
b9a53a
   </refsynopsisdiv>
b9a53a
 
b9a53a
   <refsect1>
b9a53a
@@ -253,6 +259,29 @@ NAutoVTs=8
b9a53a
     <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
b9a53a
     The hardware watchdog is not affected by this setting.</para>
b9a53a
 
b9a53a
+    <para><command>systemd-analyze security</command> analyzes the security and sandboxing settings of one or more
b9a53a
+    specified service units. If at least one unit name is specified the security settings of the specified service
b9a53a
+    units are inspected and a detailed analysis is shown. If no unit name is specified, all currently loaded,
b9a53a
+    long-running service units are inspected and a terse table with results shown. The command checks for various
b9a53a
+    security-related service settings, assigning each a numeric "exposure level" value, depending on how important a
b9a53a
+    setting is. It then calculates an overall exposure level for the whole unit, which is an estimation in the range
b9a53a
+    0.0…10.0 indicating how exposed a service is security-wise. High exposure levels indicate very little applied
b9a53a
+    sandboxing. Low exposure levels indicate tight sandboxing and strongest security restrictions. Note that this only
b9a53a
+    analyzes the per-service security features systemd itself implements. This means that any additional security
b9a53a
+    mechanisms applied by the service code itself are not accounted for. The exposure level determined this way should
b9a53a
+    not be misunderstood: a high exposure level neither means that there is no effective sandboxing applied by the
b9a53a
+    service code itself, nor that the service is actually vulnerable to remote or local attacks. High exposure levels
b9a53a
+    do indicate however that most likely the service might benefit from additional settings applied to them. Please
b9a53a
+    note that many of the security and sandboxing settings individually can be circumvented — unless combined with
b9a53a
+    others. For example, if a service retains the privilege to establish or undo mount points many of the sandboxing
b9a53a
+    options can be undone by the service code itself. Due to that is essential that each service uses the most
b9a53a
+    comprehensive and strict sandboxing and security settings possible. The tool will take into account some of these
b9a53a
+    combinations and relationships between the settings, but not all. Also note that the security and sandboxing
b9a53a
+    settings analyzed here only apply to the operations executed by the service code itself. If a service has access to
b9a53a
+    an IPC system (such as D-Bus) it might request operations from other services that are not subject to the same
b9a53a
+    restrictions. Any comprehensive security and sandboxing analysis is hence incomplete if the IPC access policy is
b9a53a
+    not validated too.</para>
b9a53a
+
b9a53a
     <para>If no command is passed, <command>systemd-analyze
b9a53a
     time</command> is implied.</para>
b9a53a