Current location: Hot Scripts Forums » Other Discussions » Other Topics » Security » Recommended security practices for a newbie?


Recommended security practices for a newbie?

Reply
  #1 (permalink)  
Old 11-30-09, 02:24 AM
ichsie2036's Avatar
ichsie2036 ichsie2036 is offline
Newbie Coder
 
Join Date: Nov 2009
Location: kavoir.com
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Recommended security practices for a newbie?

I tried to start managing my own VPS servers recently and after setting up Debian at one of the hosting providers, I followed everything I can find on the web to consolidate the server against security breaches.

What would you recommend a newbie to do to secure a server of websites? The MySQL database is hosted on the same server.
Reply With Quote
  #2 (permalink)  
Old 11-30-09, 06:24 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Move SSH off port 22, block direct root access (require user to log in through a user account, then su to root).
Use a WAF (web application firewall) like mod_security.
Refer to PHP Security Consortium (they have a great audit), SANS: Computer Security Training, Network Security Research, InfoSec Resources (lots of resources)
Validate and sanitize all data on the server side, optionally on the client side.
Keep all applications and other software up to date, upgrade.
Avoid duplicate instances of code, so a single upgrade will resolve issues.
Monitor the server - including new files.
Block access to MySQL from external sources.
Be especially wary of contact email forms and any other opportunities where users can post data.
Check applications for security vulnerabilities at http://secunia.com before installing them.
Reply With Quote
  #3 (permalink)  
Old 12-01-09, 08:29 PM
ichsie2036's Avatar
ichsie2036 ichsie2036 is offline
Newbie Coder
 
Join Date: Nov 2009
Location: kavoir.com
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by wirehopper View Post
Move SSH off port 22, block direct root access (require user to log in through a user account, then su to root).
Use a WAF (web application firewall) like mod_security.
Refer to PHP Security Consortium (they have a great audit), SANS: Computer Security Training, Network Security Research, InfoSec Resources (lots of resources)
Validate and sanitize all data on the server side, optionally on the client side.
Keep all applications and other software up to date, upgrade.
Avoid duplicate instances of code, so a single upgrade will resolve issues.
Monitor the server - including new files.
Block access to MySQL from external sources.
Be especially wary of contact email forms and any other opportunities where users can post data.
Check applications for security vulnerabilities at Secunia.com before installing them.
Thanks for some great insights. A few questions:

1. I use this line to install apache2:

aptitude install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert

How do I modify it to include mod_security. As I checked /etc/apache2/mods-available, there isn't anything called *security* there.

2. Which way is better to upgrade my server software? (Debian 5.0)

aptitude safe-upgrade or aptitude full-upgrade or aptitude dist-upgrade

I have no idea of their differences from each other.

3. Is running chkrootkit enough to monitor the change of critical files?

Thanks!
Reply With Quote
  #4 (permalink)  
Old 12-01-09, 08:53 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
I don't know if you can use aptitude to install mod_security. You might have to go to ModSecurity: Open Source Web Application Firewall.

I'm not a sysadmin - I either use leased servers, or development servers - for the leased machines, they are managed by WebHostManager and the hosting company, the development servers are off the 'net, so I can do whatever I want. As a rule, server upgrades should be done carefully to ensure they don't break anything that's already running.

I haven't worked with chkrootkit.
Reply With Quote
  #5 (permalink)  
Old 04-26-10, 02:48 AM
Thechecker12 Thechecker12 is offline
Newbie Coder
 
Join Date: Apr 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks

Now I do have the same situation ichsie hat a time ago. Really helpful, that the questions are answered already. So I can directly start working on it. Great, that such a forum exists. Otherwise I wouldn't know how to solve problems and whom to ask.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FYI: Shout goes out over PHP security bugs nugensoftware PHP 0 11-01-05 11:43 PM


All times are GMT -5. The time now is 11:08 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.