|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72510 systemd service should be hardened
Submitted: 2016-06-28 20:05 UTC Modified: 2018-12-12 16:14 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: candrews at integralblue dot com Assigned: cmb (profile)
Status: Closed Package: FPM related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: candrews at integralblue dot com
New email:
PHP Version: OS:


 [2016-06-28 20:05 UTC] candrews at integralblue dot com
The php-fpm systemd service, php-fpm.service, should use be hardened as much as possible against potential attacks. Besides reducing the likelihood of an attack, if php does get compromised, there will be less damage possible.

I suggest these features be added to the systemd units:
# Required for dropping privileges and running as a different user
CapabilityBoundingSet=CAP_SETGID CAP_SETUID

I tested these settings and didn't experience any problems in my (admitted limited) setup. I think they should be fine for anyone except for exceptional and odd situations (ex, php-fpm is setup to read files from /tmp that another services writes to /tmp). For the (very rare) impacted user, they can always override the systemd service - but a secure configuration should be the default.

Test script:

Expected result:

Actual result:


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-12 16:14 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-12-12 16:14 UTC]
This feature request has been implemented as commit 40c4d7f[1].

[1] <;a=commit;h=40c4d7f1820df1872a71ab07fd26da45a203e37f>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 16:01:28 2024 UTC