• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Ways to sandbox PHP-Fastcgi away from outgoing port 25

Miguel_Tellería

Basic Pleskian
[Plesk 12.0.18, CentOS 6.6]

Dear all,

I would like to ask for hints and ideas to restrict PHP and FastCGI processes to use port 25 directly.

Sometimes it is unavoidable, due to vulnerabilities in CMS systems, that attackers install an SMTP client bot that performs email sendings bypassing postfix, sendmail/mail() funcition and all limits imposed by Plesk.

Therefore we would like to restrict access to port 25 to web and PHP-Fastcgi applications beyond the mail() function and sending limits that Plesk already offers.

Here is our brainstorm of ideas. (Disclosure: SELinux comes first to my mind although being a complete newcomer I don't know if my SELinux proposal utterly make sense).

- Use SELinux to deny access to outgoing port 25 to php-cgi executables.
- Use SELinux to limit access to outgoing port 25 only to postfix executables.
- Use SELinux to limit access to outgoing port 25 only to postfix user (at least deny to all subscription users).
- Ban PHP API functions related to lowlevel socket handling.
- Closing outgoing port 25 completely with iptables and creating a tunnel with postfix to other host which would be email oriented.

Any ideas or hints would be welcome.
 
Back
Top