So I'm building a GUI admin area for my site. I will be the only one to login and it will just show a clean (printable) layout of info from my db.
Here's what I'm doing for security. Let me know if you think this is good and how I can improve.
- headers on all pages check for
admin == true
or die/redirect - since i have a dedicated ip at home and i will only login from home. I made all pages including the login form page check for my IP
$_SERVER['REMOTE_ADDR'];
!= header redirect - My login script is in
dir
set700
in folder permissions. - my login and pw contain 10 total combo of letters, numbers and special chars. PW is stored as SHA2 HASH
- my login script checks for
regex
prior tosql
and my credentials are stored in a separate admin table - The entire site is on SSL.
So is this secure? Can I do more? Is this overkill? Please share your opinions and suggestions (especially regarding my IP check. Can that be circumvented?)
Used to escape bad data - in conjunction with regex
on every field
function escape_data ($data) {
if (function_exists(‘mysql_real_escape_string’)) {
global $dbc;
$data = mysql_real_escape_string (trim($data), $dbc);
$data = strip_tags($data);
} else {
$data = mysql_escape_string (trim($data));
$data = strip_tags($data);
}
return $data;
}