MySQL security
#1
Posted 24 July 2009 - 01:19 PM
#2
Posted 24 July 2009 - 02:04 PM
#3
Posted 24 July 2009 - 02:39 PM
Sam G, on 24 July 2009 - 02:04 PM, said:
This is only a risk when user input is sent to the db though right?
What I'm thinking is having one db for stored info that is only going to be displayed on a page (such as product info) with read-only permissions. And having a seperate db for any user input I may require. What I'm concerned about is data from the stored db being changed before it reaches the user.
#4
Posted 24 July 2009 - 06:23 PM
#5
Posted 25 July 2009 - 11:07 AM
#6
Posted 25 July 2009 - 12:16 PM
Also on Unix based servers never login or use root from a script (if you have access to the root account). You should also try to avoid logging in as root generally.
Connetu_C, on 25 July 2009 - 11:07 AM, said:
Good post. Although most servers are configured pretty well by default, and things such as packet sniffing applies in general, what you said will vary depending on the operating system. I know your talking about Unix-based servers but it's different for the likes of Windows (certainly is desktop level).
#7
Posted 25 July 2009 - 01:40 PM
Gibbs, on 25 July 2009 - 12:16 PM, said:
Which is why sudo is very useful for those select few executables which need to use setuid or elevate themselves to root. Then a script can run only those executables which require root and which the admin has personally vetted as being "safe" to run with elevated privileges. Even if someone gains unauthorised access to the script, they shouldn't be able to do any real harm with its root permissions. This is pretty off topic for this thread though!
#8
Posted 25 July 2009 - 06:55 PM
#9
Posted 25 July 2009 - 07:14 PM
taylor223, on 25 July 2009 - 06:55 PM, said:
Yep, that's precisely it! In MySQL you can grant permissions on individual databases, tables and even fields for each user, so you should try to give your script user only the permissions they really need. Many financial institutions also use stored procedures (basically the same as functions you find in any other language) and grant EXECUTE permissions on these. The result is that most calculation is done inside the database server returning only the results required (thus minimising bandwidth usage), and that you can lock down the actions a specific user can perform as opposed to the raw data they can access/modify. A little off-topic, but hopefully informative.
Help



















