Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-04-2005, 06:53 PM
|
#1
|
Member
Registered: Sep 2002
Posts: 310
Rep: 
|
Securing MySQL
I have installed MySQL 5.0 onto my new server. Currently the server is in the process of being built so it is presently behind a firewall and router with its own iptables ruleset as well. I've searched around, but haven't found many helpful links on securing MySQL 5.0 outside of the post-installation and security tips suggested by MySQL.
So far I have:
1. Added a password for the root user (both from localhost and my host name)
2. Dropped the 'test' database
Other than that, I haven't found any suggestions or tips for additionally securing the MySQL software. Of course I am familiar with the concepts of (chroot) jails, but would like to work at the more proactive angle right now. Are there any additional actions I should take directly related to MySQL?
|
|
|
11-04-2005, 07:39 PM
|
#2
|
Member
Registered: Mar 2005
Posts: 141
Rep:
|
I blocked access to port 3306 at the firewall level to everything but one static ip I work from. When I need to access the db I either use the MySql control center from that machine or I ssh in and do it from the command line.
I'm also interested in hearing what other people do to secure MySQL
|
|
|
11-04-2005, 08:05 PM
|
#3
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
You could run MySQL in a chroot jail. If you Google around I think there are some guides, but I haven't actually tried it myself.
|
|
|
11-07-2005, 05:51 AM
|
#4
|
Member
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549
Rep:
|
You could bind tcp port 3306 only to localhost if you don't need to connect to mysql remotely.
|
|
|
11-07-2005, 07:54 AM
|
#5
|
Member
Registered: Sep 2002
Posts: 310
Original Poster
Rep: 
|
Thank you for the suggestions thus far. As mentioned, this server already has an iptables firewall ruleset. The default policy for input is to drop, and the port for MySQL (3306) is not included in the list that accepts input. I suppose there could be a rule in the output table to prevent it from making communication out through the internet facing interface, but I think there would have to be an assumption that it didn't fork to a different port when communicating.
As for the chroot jail, you can use the application makejail to help setup a jail for MySQL. In Debian, I just use apt-get to install it. It wouldn't surprise me if there was an emerge package for it in Gentoo. A jail is more of a post-incident utility that limits damage once the service has been compromised. I would like to focus on actions to prevent the service from being compromised.
Last edited by int0x80; 11-07-2005 at 07:56 AM.
|
|
|
11-07-2005, 10:55 AM
|
#6
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
You could always require the remote clients to use SSL.
|
|
|
11-23-2005, 05:47 PM
|
#8
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,184
|
The first order of business is to restrict access to MySQL, and the simplest ways to do that is the same stuff that would be true for any and all of the various daemons that are running on your system. Basic firewall rules can do this handily in most cases. Demilitarized zones and all that rot...
Perhaps the rules for who may and may not "reach" MySQL needs to be more elaborate even within your network. In that case, you might need to use technologies like VPN within your internal net. SSL is a reasonable alternative in some situations.
When you finally reach MySQL and are able to log in to it, the basic password management rules apply. I think the most important recommendation here is that you should never give any one MySQL user more privilege than it actually needs. The IDs used by web-sites, in particular, should be highly restricted.
|
|
|
All times are GMT -5. The time now is 11:19 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|