« Back to Settings for systemd units

ProcSubset setting

This article has last been updated at .

The property ProcSubset is a systemd unit setting used for sandboxing. It is available since systemd 247.

Purpose: define the subset of access by unit to /proc

New to securing and tuning systemd services? Start with the how to harden a systemd service unit article to learn tuning step-by-step, including the usage of relevant tools.

Why and when to use ProcSubset

The systemd unit setting ProcSubset controls the “subset” mount option of /proc for the unit. By using the option, top-level entries are hidden for the process and its children.

The ‘subset=pid’ was introduced in Linux 5.8.

Caveats

This function does not if the “subnet” option for procfs is not supported.

Generic advice

The Linux kernel shares information from various kernel APIs via /proc. When activating this setting, these kernel APIs are also made unavailable, which might break common software, unless it is a trivial process. So this option is to be used with care. Typically it may be better to implement the ProtectProc setting.

Values

Systemd unit setting ProcSubset expects a boolean (yes/no or true/false) or string value.

Values for systemd unit setting ProcSubset
ValueIntended actionAvailable since
systemd version
allno restriction of information from /proc - default
pidrestricts information from /proc that not directly associated with process management and introspection

Example to show the current value of ProcSubset for the ssh service:

systemctl show --property=ProcSubset ssh.service

Related hardening profiles

The systemd unit setting ProcSubset is used in the following systemd hardening profiles. These hardening profiles help improving security of common Linux services and usually require minimal tuning.

Frequently Asked Questions

How to use systemctl edit?

Run systemctl with the 'edit' subcommand and service.

systemctl edit UNIT.service

See full answer at How to use systemctl edit to change a service?

Feedback

Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

Mastodon icon

Related articles

Like to learn more? Here is a list of articles within the same category or having similar tags.