Relational Databases

Document Sample
Relational Databases Powered By Docstoc
					Database Security 3

Database Security Principles
Areas of Vulnerability (Database Security)

 The system (server) level
        Lock down the physical server and operating system with
         a least-privilege mentality
             Who has access to your system? What level of access?
             Understand methods of access to your system
                –   Remote Desktop and Terminal Services
                –   Web applications
                –   Published shares
                –   Have IT run a test to see what ports are open on the system
             Disallow visibility of your database server to the “outside”

 It is important to keep in mind that other layers of security apply when
  hosting a database, such as network and operating system security.
 The good news is that the makers of MySQL have an excellent
  documentation area on their Web site that, although sometimes cumbersome
  to navigate, is well stocked with information for the MySQL developer and

6/28/2011                             Presentation                            page 2
Areas of Vulnerability (Database Security)

 Database connections
        What accounts are used for creating database
             Carefully plan service accounts and their level of access
              control between the application layer and the database
        Always be cautious when allowing users to pass SQL
         queries to your database server through the use of a Web
         front-end or ODBC connection

6/28/2011                          Presentation                           page 3
Areas of Vulnerability (Database Security)

 Access Control
        Document who should
         have read and write
         access to databases and
         their table data
        Ensure database reports
         only display the right data
         to the people who need
         that data

6/28/2011                          Presentation   page 4
Areas of Vulnerability (Database Security)

 Auditing
        Auditing describes the process of monitoring changes to
         the database and who made those changes
        Assume you have a Web site that allows modifications to
         be made to user accounts. These user accounts are
         stored in a database. You can create an auditing table
         that monitors whenever a change has been made to an
            AuditId   Column     OldValue         NewValue       ModifiedBy   ModifiedDate

            1         Email   34           2008-01-05

            2         Email   34           2008-01-06

            3         Lastname   Reynolds         Green          56           2008-01-06

6/28/2011                              Presentation                                          page 5
Database Attacks (Cases)

 Let‟s review some of the recent database


6/28/2011                         Presentation                     page 6
Database Attacks (Types)

 Brute-Force Password Hacking
        What it is
             Manually or programmatically trying all possible
              combinations of a password or default passwords in order
              to gain access to a system
        How to protect against it
             Avoid using default or blank passwords
             Institute clear password creation policies and a calendar to
              update those passwords periodically

6/28/2011                          Presentation                         page 7
Database Attacks (Types)

 Stolen Backup Tapes
        What it is
             Most organizations store backups of their databases on
              backup tape or on solid state drives. Backup tapes or large
              datasets can be easily obtained by stealing backups that
              are unencrypted and often-times not password protected
        How to protect against it
             Secure the data
             Physically secure the information by keeping it locked
             Encrypt the data when possible

6/28/2011                          Presentation                        page 8
Database Attacks (Types)

 Targeting databases that are not patched with the
  latest security updates
        What it is
             Database vendors do issue patches for their DBMS
              software. The problem is that database administrators often
              times cannot shut down operations to test and install the
              patches or cannot do so in a timely manner, making the
              system vulnerable.
        How to protect against it
             Research the latest security vulnerabilities for the database
              platform you are running
             Plan a monthly system outage time (at minimum) to update
              the database as necessary

6/28/2011                           Presentation                        page 9
Database Attacks (Types)

 SQL Injection
        What is it?
             When prompted with form data on a Web site, a SQL
              injection can occur when a user types “rogue” SQL
              commands into the form and the information is not correctly
              filtered before hitting the database server
        How to protect against it
             Make sure your data types are strongly typed when
             Verify and format your user‟s form data before sending to
              the database server
                – Example mysql_real_escape($_POST[„userid‟]);

6/28/2011                          Presentation                       page 10
Security Analysis on Final Project:

 If these tools are not kept up-to-date (just as with the OS), then
  possible exploits may apply, and the server may be vulnerable to
       Make sure your data types are strong when possible
       The MySQL Permission Model :
               In order to fully implement a secure MySQL database, it is necessary to learn the MySQL access control system (your friends the
                GRANT and REVOKE commands). There are four privilege levels that apply:
                   –     Global: these privileges apply to all databases on a server.
                   –     Database: these privileges apply to all tables in a database.
                   –     Table: these apply to all columns within a table.
                   –     Column: these apply to individual columns in a table.
               The types of privileges include:
                   –     Alter
                   –     Delete
                   –     Create
                   –     Drop
                   –     Execute
                   –     Select
                   –     Update
               Once a database is completely set up, these privileges should be reviewed prior to going to any usage of the database to ensure that
                the privileges were set up appropriately.
               Document who should have access to your databases and tables their table data.

6/28/2011                                                                   Presentation                                                    page 11
Security Analysis on Final Project:

 Ensure database reports only display the right data to the people who
  need that data.
 Database Backups
        Another key ingredient in database design is data
         integrity, or ensuring that the data that is stored in the
         database is in fact valid and accurate.
        Making regular backup copies, backup and recovery

6/28/2011                         Presentation                        page 12

6/28/2011      Presentation   page 13