|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
31 - 1 = ?
Subscribe to this entry?

 [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: Sun Apr 21 03:01:27 2024 UTC