10 steps to fortify the security of your MySQL installation by Espion

For those who wish to enhance or fortify the security of the MySQL installation the following technical 10 steps are a good start.
Step 1: Run MySQL in a chroot jail
Chroot creates a new root directory structure for an application and restricts the files it can access within the operating system. If your MySQL server gets hacked and the attacker gains a shell on your server all they will see is a restricted environment While chroot can be bypassed it does provide defence in depth and may prove to be invaluable in the event of a MySQL 0-day exploit. Most script kiddies will go for the low hanging fruit and the added difficulty of the chroot jail may just move them along to easier picking.
The steps involved in configuring a chroot jail for MySQL are outside the scope of this article but full details can be found in the article “Securing MySQL: step-by-step”.
Step 2: Restrict or disable remote access
MySQL runs on a default port of 3306. If you are running your MySQL server on a separate server from the application server then you should restrict access to this port using a host-based firewall such as IPTables.
If you are running both your application server and your MySQL server on the same server then you can disable networking completely in MySQL and use Unix sockets as the communication channel instead. This stop the MySQL server listening for network connections and further reduces the attack surface of the server.
Step 3: Change default root password and change root username
By default the root MySQL account contains an empty password. This should be changed as soon as your MySQL installation is complete.
It is also a good idea to change the name of the root account to something else. This will create an additional level of obfuscation if an attacker attempts to brute force the password for the root account.
Step 4: Remove anonymous accounts and accounts with empty passwords
MySQL creates accounts with anonymous access by default and, needless to say, these should be removed.
Step 5: Remove sample database
MySQL installs a sample database by default called “test”. Best practise dictates that we should remove this.
Step 6: Run MySQL as an unprivileged user
MySQL should always be run as an unprivileged user in order to reduce the potential damage to the operating system and other processes in the event of a successful attack against MySQL.
Step 7: Grant minimum privileges for database users
When making connections to the MySQL database from your application you should use an account with only the minimum permissions to perform its required actions. This is in line with the principle of least privilege.
Step 8: Enable MySQL logging and restrict access to logs
Almost all startup scripts for MySQL now have logging configured but you should always ensure that MySQL is logging to the /var/log/ directory to make analysis of logs easier in an incident response situation.
Step 9: Encrypt data stored in the database using MySQL built-in functions
If the data being stored in the database is sensitive then it should ideally be encrypted. MySQL provides inbuilt SQL functions to encrypt and decrypt data using the AES encryption protocol. The only problem with this method of encryption is that the password used to encrypt and decrypt the data must be hard coded into the SQL statements in the application. While this is a problem it does however keep the data safe if the database is backed up to a remote server. It also provides some degree of obfuscation in the event of an attacker gaining access to the operating system.
Step 10: Keep a look out for patches
While all these steps will help harden your MySQL server against attacks all your good work could go out the window if you don’t keep abreast of new vulnerabilities for MySQL.

2 responses to “10 steps to fortify the security of your MySQL installation by Espion”

  1. GORDON


    PillSpot.org. Canadian Health&Care.No prescription online pharmacy.Best quality drugs.Special Internet Prices. Low price pills. Buy pills online

    Buy:Female Pink Viagra.Lasix.Nymphomax.Zocor.Buspar.Acomplia.Amoxicillin.Aricept.Lipothin.Wellbutrin SR.Seroquel.Female Cialis.Lipitor.SleepWell.Prozac.Cozaar.Advair.Benicar.Ventolin.Zetia….

  2. ALBERTO


    MedicamentSpot.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. High quality pills. Order pills online

    Buy:Ventolin.Cozaar.Nymphomax.Female Pink Viagra.Female Cialis.Aricept.Zetia.Lipitor.Advair.Benicar.Seroquel.Buspar.Lipothin.Lasix.SleepWell.Amoxicillin.Zocor.Wellbutrin SR.Acomplia.Prozac….

Leave a Reply

Announcements from CritoTECH.com!!!

.

RSS MySQL

  • Abstracting Access to MySQL for an MVC-Based Framework in PHP 5
    In this third part of the series, I further enhance the functionality of this sample MVC framework by adding a class to it that takes care of interacting with MySQL in a simple manner. Youll see the importance of this abstraction class when I show you the definition of the corresponding model, which will aggregate an instance of “MySQL” to handle the data la […]
  • Plan a Good Database
    Organize a collection of data somehow for later usage and you will get a database. In the last couple of years, with the spread of the Internet, databases have become something you will come across everywhere on the World Wide Web. Most websites have a strong database behind them. With this phase of the web's evolution, if you work in software developme […]
  • Using SSH in HeidiSQL and MySQL Query Browser: Encrypting Sessions
    Using a MySQL GUI (Graphical User Interface) makes it easier, more efficient and user-friendly to work with a MySQL database. The two most popular MySQL GUIs, HeidiSQL and MySQL Query Browser, have their default connections to any MySQL server “unencrypted.” This is a problem, but we're going to fix it; just keep reading. - This tutorial will help you c […]
  • MySQL in SSH: Basic Guide
    There are some hosting companies that do not offer an SSL (Secure Socket Layer) environment for MySQL. It is important to have an SSL environment for MySQL, because your sessions are protected with “encryption.” Fortunately, if you can't get SSL with your hosting company, there is an alternative: SSH. - The Secure Socket Layer security feature protects […]
  • MySQL Security Tips
    If you are a web developer or administrator, aside from administering your web server, you should also be administering your MySQL database in terms of security. This database is open source and is commonly used with the PHP web server scripting language; tons of useful applications are being developed with this kind of setup. This is good, but it opens up i […]

Your Shopping Cart

Your cart is empty
Visit The Shop

Member Login

» Forgot Password?
» Join Us

What they say about ezNcrypt…

" Great tool, worked like a charm "

" Classy Operation! "

" consumed less than 1% of our system resources "

" My data is safe, I am happy "

" It worked! "

" I can encrypt the specific tables I want. "

" Excellent performance, less overhead than other products "

" I didn't have to make any changes to my app, not one line of code "

A little proverb never hurt

To love someone deeply gives you strength. Being loved by someone deeply gives you courage.
Lao Tzu
Quotes from Secret Chalice

Related Searches