Skip to main content

Recommended PHP files owner for non-DSO

Comments

3 comments

  • cPMelaniel
    Security wise, it is likely better practice to have the PHP file owned as the user rather then nobody. While I understand the matter of scripts ran as nobody being limited, if you are using CloudLinux then you have actually already resolved this by putting the users in a caged environment. While not enabled by default, lsapi also offers an option called "lsapi_target_perm": CloudLinux Documentation "Check target PHP script permissions. If set to On, lsapi will check that script is owned by the same user, as user under which it is being executed. Return 503 error if they don't match." I'd probably go with throwing the users in cageFS, setting up the scripts to be owned by the user, and enforcing lsapi_target_perm. However you may want to review this further with your current needs and usage.
    0
  • rinkleton
    Yeah I have cageFS on and all that. But I'm not really worried about accounts affecting other accounts. The damage would always be limited to 1 account. But 'lsapi_target_perm' doesn't sound like it would protect the account from itself.... which is what I'm wondering if I even need to worry about. One bad php script could delete or modify all others on the account.
    0
  • cPanelMichael
    One bad php script could delete or modify all others on the account.

    Hello, A strong Mod_Security ruleset is useful to protect against the exploits themselves. You can search for the term "ModSecurity" on our forums to see a list of threads related to Mod_Security, including threads with ruleset discussion. Thank you.
    0

Please sign in to leave a comment.