kazumasama
Newbie
- Mar 10, 2012
- 28
- 2
Greetings BHW members! I have seen a few unfortunate members have had the pleasure of getting hacked and losing all their hard work, which equals money lost (nope, I'll pass). I wanted to share some settings and ideas that I use to protect my own site to try and help the less security savvy from losing money, as well as their hard work.
These are for a Linux Server and WHM/cPanel Servers. I will make one for Windows Servers in a later post.
Server side:
1.) If you have it and can afford it, force re-direct your site to your SSL with your htaccess file. Encrypted connection is safer (for the most part) and more trustworthy.
2.) Firewalls I use. Mod Security (Mod_Sec) and ConfigServer Security & Firewall (CSF). Mod Security for the SQL and Javascript injection protection, and CSF for the bruteforcing and port control. Both are free and open source as well as highly configurable.
3.) Disable root logins from SSH. Instead create a user, SSH in as that user, then switch to root if needed.
4.) Switch your SSH port. Keeps the bots at bay because they can't find SSH on the default port 22. Also keeps your blacklist from getting really big from these bots. (cough cough China)
5.) Install and create cronjobs for Malware Detect (Maldet) and ClamAV anti-virus software that will email you if it finds something suspect. These are also free and open source.
6.) Don't have insecure permissions like 777. Enough said here. If you have something that won't work without the 777 permission, check your error log and find out why and fix that problem. Don't just 777 permission it as you are welcoming a possible hack depending on what is 777'd.
7.) Remember to update. Usually there to fix errors or vulnerabilities, not because they like irritating you (although sometimes I wonder lol). If you have a lot to do, like say across (30) WordPress sites, see if you can make a script to do them all at once.
WHM/cPanel Side:
1.) Enable mod_userdir Protection:
"Apache's mod_userdir allows users to view their sites by entering a tilde(~) and their username as the uri on a specific host."
2.) Enable open_basedir Tweak
"PHP's open_basedir protection prevents users from opening files outside of their home directory with php."
3.) cPHulk Enable
Blocks IP's and sends them to the blacklist for trying to brute force your WHM or cPanel password.
4.) Disable Anonymous FTP Uploads
Pretty self explanatory why this is a good idea.
5.) Create Strong Passwords
I usually try to pick something that is at least (10) characters long, has a variation of upper & lowercase letters, includes numbers & special characters.
This is just a good start to some good, basic, security settings that I hope can help someone who is not-so-savvy in the security department. Losing money and hard work is never fun, especially when it can be prevented. Take care!
These are for a Linux Server and WHM/cPanel Servers. I will make one for Windows Servers in a later post.
Server side:
1.) If you have it and can afford it, force re-direct your site to your SSL with your htaccess file. Encrypted connection is safer (for the most part) and more trustworthy.
2.) Firewalls I use. Mod Security (Mod_Sec) and ConfigServer Security & Firewall (CSF). Mod Security for the SQL and Javascript injection protection, and CSF for the bruteforcing and port control. Both are free and open source as well as highly configurable.
3.) Disable root logins from SSH. Instead create a user, SSH in as that user, then switch to root if needed.
4.) Switch your SSH port. Keeps the bots at bay because they can't find SSH on the default port 22. Also keeps your blacklist from getting really big from these bots. (cough cough China)
5.) Install and create cronjobs for Malware Detect (Maldet) and ClamAV anti-virus software that will email you if it finds something suspect. These are also free and open source.
6.) Don't have insecure permissions like 777. Enough said here. If you have something that won't work without the 777 permission, check your error log and find out why and fix that problem. Don't just 777 permission it as you are welcoming a possible hack depending on what is 777'd.
7.) Remember to update. Usually there to fix errors or vulnerabilities, not because they like irritating you (although sometimes I wonder lol). If you have a lot to do, like say across (30) WordPress sites, see if you can make a script to do them all at once.
WHM/cPanel Side:
1.) Enable mod_userdir Protection:
"Apache's mod_userdir allows users to view their sites by entering a tilde(~) and their username as the uri on a specific host."
2.) Enable open_basedir Tweak
"PHP's open_basedir protection prevents users from opening files outside of their home directory with php."
3.) cPHulk Enable
Blocks IP's and sends them to the blacklist for trying to brute force your WHM or cPanel password.
4.) Disable Anonymous FTP Uploads
Pretty self explanatory why this is a good idea.
5.) Create Strong Passwords
I usually try to pick something that is at least (10) characters long, has a variation of upper & lowercase letters, includes numbers & special characters.
This is just a good start to some good, basic, security settings that I hope can help someone who is not-so-savvy in the security department. Losing money and hard work is never fun, especially when it can be prevented. Take care!