Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-09-2010, 01:49 AM   PM User | #1
johnnnn
New Coder

 
Join Date: May 2009
Location: Pennsylvania, United States
Posts: 54
Thanks: 16
Thanked 0 Times in 0 Posts
johnnnn is an unknown quantity at this point
Exclamation Best admin panel security for CMS?

I'm currently making a check list of ALL possible security checks I can use for writing my own custom CMS. As far as the control panel/admin panel goes, I've been speculating the following to provide the best security I can (bear in mind, a 100% secure system is a virtual impossibility.)

Here's what I thought of thus far:
  1. .htpasswd (outside of /public_html)
  2. Block access to any files starting with .ht via htaccess
  3. Database based login
  4. Password protect the admin directory
  5. "Sanitize" any user input, run checks, etc.
  6. General consideration, place any config files outside of /public_html/, no sensitive data in .inc.php files
  7. Record errors/warnings

What do you think?

Last edited by johnnnn; 08-09-2010 at 01:31 PM..
johnnnn is offline   Reply With Quote
Old 08-09-2010, 05:56 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Looks pretty good to me.
The two on there that most people 'forget' about are the recording of errors (specifically auditing ones like failing to login), and the moving of anything unpublished outside of the public_html (or whatever your published directory is).
One thing to note, I don't think .htaccess would have any affect outside of a published directory though. This shouldn't really be a problem, Apache itself has a directive to deny reading on .ht* files, and I believe it is configured by default.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
johnnnn (08-09-2010)
Old 08-09-2010, 01:30 PM   PM User | #3
johnnnn
New Coder

 
Join Date: May 2009
Location: Pennsylvania, United States
Posts: 54
Thanks: 16
Thanked 0 Times in 0 Posts
johnnnn is an unknown quantity at this point
Smile

Quote:
Originally Posted by Fou-Lu View Post
Looks pretty good to me.
The two on there that most people 'forget' about are the recording of errors (specifically auditing ones like failing to login), and the moving of anything unpublished outside of the public_html (or whatever your published directory is).
One thing to note, I don't think .htaccess would have any affect outside of a published directory though. This shouldn't really be a problem, Apache itself has a directive to deny reading on .ht* files, and I believe it is configured by default.
Yeah, that just came to mind about the .htaccess not working outside of the root directory. I could simply just place the .htaccess in the /admin folder since Apache can deny reading files that begin with .ht. Thanks for the advice! Much appreciated.
johnnnn is offline   Reply With Quote
Old 08-10-2010, 08:53 AM   PM User | #4
sitNsmile
Regular Coder

 
sitNsmile's Avatar
 
Join Date: Dec 2009
Location: Charlotte, NC
Posts: 354
Thanks: 19
Thanked 2 Times in 2 Posts
sitNsmile is an unknown quantity at this point
I have built 2 types of CMS admins before, my first one, was

a user/pass which you would have 3 tries until it blocks your ip
and the 2nd is what I currently use. where you have to enter a passcode (of course using teh random md5) after that, it also needs to be accepted by the main ip (ip address acts as your user, new ip.. have to relog) so it wont allow anyone to actually try to attempt a login, because it has to be approved by an existing ip. I build that on my iphone as well, so if my boss is out of town, he can txt me to approve his new ip..etc works out pretty well so far.

(before the cms, we would just lock the directory to only our office ip, but that restricts too much)
sitNsmile is offline   Reply With Quote
Reply

Bookmarks

Tags
admin, cms, htacces, htpasswords

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:51 AM.


Advertisement
Log in to turn off these ads.