···22with lib;
3344{
55- options = {
66- security.hideProcessInformation = mkEnableOption "" // { description = ''
77- Restrict access to process information to the owning user. Enabling
88- this option implies, among other things, that command-line arguments
99- remain private. This option is recommended for most systems, unless
1010- there's a legitimate reason for allowing unprivileged users to inspect
1111- the process information of other users.
55+ meta = {
66+ maintainers = [ maintainers.joachifm ];
77+ doc = ./hidepid.xml;
88+ };
1291313- Members of the group "proc" are exempt from process information hiding.
1414- To allow a service to run without process information hiding, add "proc"
1515- to its supplementary groups via
1616- <option>systemd.services.<name?>.serviceConfig.SupplementaryGroups</option>.
1717- ''; };
1010+ options = {
1111+ security.hideProcessInformation = mkOption {
1212+ type = types.bool;
1313+ default = false;
1414+ description = ''
1515+ Restrict process information to the owning user.
1616+ '';
1717+ };
1818 };
19192020 config = mkIf config.security.hideProcessInformation {
+33
nixos/modules/security/hidepid.xml
···11+<chapter xmlns="http://docbook.org/ns/docbook"
22+ xmlns:xlink="http://www.w3.org/1999/xlink"
33+ xmlns:xi="http://www.w3.org/2001/XInclude"
44+ version="5.0"
55+ xml:id="sec-hidepid">
66+77+ <title>Hiding process information</title>
88+99+ <para>
1010+ Setting
1111+ <programlisting>
1212+ security.hideProcessInformation = true;
1313+ </programlisting>
1414+ ensures that access to process information is restricted to the
1515+ owning user. This implies, among other things, that command-line
1616+ arguments remain private. Unless your deployment relies on unprivileged
1717+ users being able to inspect the process information of other users, this
1818+ option should be safe to enable.
1919+ </para>
2020+2121+ <para>
2222+ Members of the <literal>proc</literal> group are exempt from process
2323+ information hiding.
2424+ </para>
2525+2626+ <para>
2727+ To allow a service <replaceable>foo</replaceable> to run without process information hiding, set
2828+ <programlisting>
2929+ systemd.services.<replaceable>foo</replaceable>.serviceConfig.SupplementaryGroups = [ "proc" ];
3030+ </programlisting>
3131+ </para>
3232+3333+</chapter>