I want to know if there is a real security reason to not enable tools like git, WP-CLI or npm. I want to run a server (Centos/CPanel), but I want to be sure that enabling them would not be a risk.

The motivation behind this is to be more productive and stop deploying using a zip or FTP (i never use it, is insecure and slow).


Using git exposes you to some potential risk and gives you some substantial benefits.

If your users cannot login to the server today, and if you're going to compile their code on that server, then you're likely enabling them to run code in a way they cannot today. That's the risk. That's probably a small real increase in risk -- you were running their code already.

This is substantially mitigated by the existence of logging and potentially accountability: the code they run has to be checked into git, where you'll be able to see what they did.

The tradeoff is probably a substantial win for security.


You can definitely use tools like git on a shared server provided you follow some best practices and do not expose git metadata files over the web. Using well configured hooks that use strong authentication, this can be much safer than uploading files over SFTP, especially if you use it as read-only.

You would need to ensure that you isolate users correctly and use the principle of least privilege. You could use Unix accounts or Gitosis for access control to the repository. Here's a great serverfault post about setting permissions for a shared Git.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.