Skip to main content

suPHP and open_basedir together, for improved security.

Comments

12 comments

  • cPanelMichael
    Hello :) Thank you for taking the time to post this workaround. Please keep in mind that user-submitted workarounds are not reviewed by cPanel, so implement them at your own risk.
    0
  • likudio
    Hi Michael, Well, I'd like if cPanel representatives would take a look over my work around and see the issues that it solves, and the features that it brings. It would be nice to have these features already implemented in a future cPanel version, as they aren't so complicated to implement; and also, cPanel developers might find an even better way to implement them. Regards. A.
    0
  • cPanelMichael
    You are welcome to submit a feature request for the additional functionality via: Submit A Feature Request Feature requests are often viewed by developers upon submission. Thank you.
    0
  • likudio
    Hi Michael, Unfortunately, most of cPanel users aren't aware about the security vulnerabilities that using only suPHP or only open_basedir tweak brings, nor the benefits that such solution as one of the above has... so, it won't be such popular - therefore it won't get voted. But, I already did submit a feature request that should implement a part of the above work around, but is still "under moderation" (even though several days have passed). Anyway, I stopped bothering it. Whoever will want to get its server more secure, will implement the solution above. Is that simple. Thank you for your support anyway.
    0
  • Clouseau
    Hi likudio. Nice post but I don't know why is this needed because cPanel documentation states how to enable it, although it doesn't work:
    0
  • likudio
    Hi Clouseau. 1. cPanel states that suPHP with open_basedir tweak doesn't work. And it doesn't in the default configuration. 2. Copying the main ini from its source to users directory, doesn't help. And anyway, you shouldn't do that, as you want only new directives in the new ini file, not all directives. 3. It depends on how Apache + PHP is configured; this decides if the php.ini from UsersDir works or not. 4. Don't forget that if the php.ini file is in the user directory, the user might have access to it and modify it as needed (so it would get rid of your restrictions). 5. If you restrict user only to /home/user you will get your users into trouble, as they won't be able to access libs and tmps anymore, which might corrupt their websites. Be careful. 6. If you can still access /root /var /etc with PHP, you're definitely into trouble. You shouldn't allow such access... 7. Conclusion... your solution doesn't work :D I recommend to implement the solution from the tutorial I wrote above. Regards.
    0
  • Clouseau
    :D What about setting this in global php.ini file open_basedir = /home/:/usr/lib/php:/usr/local/lib/php:/tmp This is probably the same setting that is in Php configuration editor - Advanced - open_basedir? It is stated DEFAULT here but I could add above so the users would be locked to those directories, right? EDIT: yes, that's the option. But doesn't help. Crap. Your solution is a great find but its too much cumberstone for me, no ofense :)
    0
  • likudio
    Adding a general /home/ open_basedir setting will prevent users from accessing /root or other directories, indeed, PHP should load it, but you still can't prevent multiple separate domains from accessing one another's resources.
    ]:D Your solution is a great find but its too much cumberstone for me, no ofense :)

    Well... adding all users directories and domain paths to the main php.ini might be much more "cumberstone" :D and you have to do it every time a domain or subdomain is changed on the server, how can you possible monitor that, to add them, in a manual way? :D Anyway, I'm not trying to convince anyone here, free-will for everybody. But if I'd be your client, I'd like my files to be secured as hell :D and I'd question myself about my hosting solution, if my sysadmin's laziness would prevent him from implementing some security features | "cumberstone" (no offense also) :D
    0
  • Clouseau
    Agreed. I planed to migrate all those clients to ISPConfig but in the end was too resource and time intensive that I gave up. ISPConfig has all that fixed and supports php-fpm but I have to stay with cpanel...
    0
  • lorio
    ]Unfortunately, most of cPanel users aren't aware about the security vulnerabilities that using only suPHP or only open_basedir tweak brings, nor the benefits that such solution as one of the above has... so, it won't be such popular - therefore it won't get voted.

    That is an import topic. These feature voting is no silver bullet. This is a nice post with an elaborated solution and it would be nice if a statement from the developers of cpanel could be added. Perhaps suPHP is no longer the way to go? Too CPU demanding? @likudio: I wanted to add a link to your feature request. But I haven't found it in the database. I only found this one: [url=http://features.cpanel.net/responses/enable-auto-addition-of-open-base-directory-protection-in-to-suphp-mode]Enable auto addition of open base directory protection in to suphp mode. | cPanel Feature Requests I really wonder if suPHP isn't to CPU demanding for websites with x users/y connections? Is here anybody using suPHP on VPS with 4-8 cores (not sure how to compare them) and 8-16 GB for hosting e.g. a forum and can get a lot of users served?
    0
  • likudio
    ]That is an import topic. These feature voting is no silver bullet. @likudio: I wanted to add a link to your feature request. But I haven't found it in the database.

    That's because it hasn't been approved by cPanel moderators ... (I wonder why, rhetorical).
    0
  • cPanelMichael
    ]That's because it hasn't been approved by cPanel moderators ... (I wonder why, rhetorical).

    Could you verify the title of your feature request? Thank you.
    0

Please sign in to leave a comment.