I'm working on implimenting some security measures on a control panel app that my company is building. I know that it's pretty much impossible to prevent a skilled cracker from getting in if they really want to, but we're looking at doing our best. If anyone can give me some feedback on our plans, that would be very helpful.
The main focus right now is on the login area of the control panel. The login page is pretty much a simple form with a username field and a password field. When the form is submitted the script will check the username against a database. If a match is found, then the password will be hashed using the MD5 algorithm to check agaist the hashed password in the database. If they both match, then the user gets access. If not, then they get a generic message stating that the login was unsuccessful. No matter what the reason is for the failed attempt, the same message will be sent back so that if a person was trying to hack in, they wouldn't have any idea that they guessed on a valid username.
The first security measure that we're taking is to prevent automatic attempts to hack into the control panel. If there are 2 unsuccessful attempts on a username, then a CAPTCHA image will be used. On following attempts, if the form field for the CAPTCHA image isn't given, then no attempt will be made to verify the username or password and the generic login failed message will be returned. This won't prevent someone from using a program to try and gain access, but it should prevent them, or make it more difficult for them to get in. I guess that we could use the CAPTCHA image on every login attempt, but we're trying to make is as user-friendly as possible.
The next method would be used if it is a human still trying to login and they are giving the correct CAPTCHA text. If there are 3 more (a total of 5) unsuccessful login attempts then the account will be locked and will need to be unlocked by a administrator. A email will be sent to the user telling them that their account is locked. This way if it wasn't them, then they can notify an administrator that someone tried to hack into the control panel.
A third method would be to create a session id and store it in the database when the user first gets to the control panel. Their IP address will also be stored. A cookie with the session id will also be stored on the users computer. Each time the user tries to login, the script will check to see if the cookie session id matches the session stored in the database, and if the referring URI is correct. If none of these pass, then the generic login failed attempt will show. Otherwise, the script will try to validate the user.
These are just a few ideas that we have. If anyone has and suggestions, or better ideas on how to make an authorization system more secure, please share them.
Thank you