PHPDiscussion
Config file for phpMyAdmim

4739814Jan 22, 7:47am
Hi, i'm finally able to post in a forum at last!

firstly, i know it's not that safe to connect to a remote database from a local machine using phpMyAdmin but it came up recently in a discussion i had.

i wrote a brief blog displaying the bare minimum code to enable a connection. i wonder if any of you could have a look at it and post back on your thoughts as to its security and any thoughts on making it better, more secure etc thx.

it can be found here: config file for phpMyAdmin


Sponsor
BuntyJan 22, 8:10am
It's not really that unsafe...

Also the phpMyAdmin setup isn't really the place to secure it. That is far better done by creating the right grant privileges for the user on the MySQL database in the first place.

E.g.

Grant SELECT on Adatabase.* to 'ro-user'@'111.111.111.111' identified by 'passwd here';

The main security problem with remote connections is using '%' instead of a machine name or IP (or preferably just 'localhost'), which allows anyone on the internet to try and log in. [not that they can, unless they've managed to get your 20 digit fully alphanumeric+higher chars pass].

Personally I bypass all that by using persistent SSH tunnels to forward the MySQL ports on my servers to ports on my local machine.

4739814Jan 22, 8:40am
hmm, good answer.
ok but what, say for example, if you've written a control panel for staff to log in and add info through a 'friendly' user interface (not unlike this) from any location? i think they wouldn't be able to. i think the "20 digit fully alphanumeric+higher chars pass" is the safest way.. but staff never seem to remember those kind of passwords


Sponsor
BuntyJan 22, 9:21am
If they really do need to login from any location then there isn't really any way round using % as a host, although that would suggest that it would be better to look at the system as a whole and possibly create some sort of server-side API to modify they DB entries in a controlled fashion; that the clients could then connect to over SSL etc.

Also the passwords the staff use to login needn't (shouldn't) be the same as the one used to connect to the DB, otherwise they can just install their own copy of phpMyAdmin (or the Mysql client etc) and do what they want with the DB.

4739814Jan 22, 9:42am
i see. i thought u meant use that kind of password for staff logins. no, i would never allow the staff logins to be the same as for the db itself.

defining the requirements for a 'controlled fashion' can be an endless and complicated task. personally i would prefer to develop ip controlled logins but it always comes down to what the client wants.

i think though that developing some sort of class/object to plug into future projects is something i'll start getting on with. that way one can define clearly quite early on to their client what they are and arnt going to get.


Sponsor
BuntyJan 22, 9:44am
And never forget to always run perl with the -T option...

umm wait, wrong forum!

That's probably considered blasphemy round these parts :D

4739814Jan 22, 9:47am
what, you mean perl? security is security mate. and no one writes a full app with one single language.. do they?


Sponsor
BuntyJan 22, 10:26am
Haha yeah, just kiddin'

Although, just did a quick google, and this looks interesting

blog.php-security.org/archives/92-CORE-GRASP-PHP-Tainted-Mode.html [blog.php-security.org/archives/92-CORE-GRASP-PHP-Tainted-Mode.html]

4739814Jan 22, 10:55am
.


Config file for phpMyAdmim

You need to Sign-up for StumbleUpon to post to this forum