Database Security. Principle of Least Privilege. DBMS Security. IT420: Database Management and Organization. Database Security.



Similar documents
IT360: Applied Database Systems. Database Security. Kroenke: Ch 9, pg PHP and MySQL: Ch 9, pg

Livezilla How to Install on Shared Hosting By: Jon Manning

Installing Drupal on Your Local Computer

MySQL Quick Start Guide

SIMIAN systems. Setting up a Sitellite development environment on Windows. Sitellite Content Management System

Setting Up Specify to use a Shared Workstation as a Database Server

NNT CIS Microsoft SQL Server 2008R2 Database Engine Level 1 Benchmark Report 0514a

Configuring an Alternative Database for SAS Web Infrastructure Platform Services

MySQL Security: Best Practices

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

SIMIAN systems. Setting up a Sitellite development environment on Mac OS X. Sitellite Content Management System

MySQL Quick Start Guide

Installation Tutorial Script: The Real Estate Script. 1. Please login to download script. On PHP Classifieds Script web site.

Alert Notification of Critical Results (ANCR) Public Domain Deployment Instructions

Database Administration with MySQL

Product: DQ Order Manager Release Notes

Avatier Identity Management Suite

WordPress Security Scan Configuration

MAMP 3 User Guide! March 2014 (c) appsolute GmbH!

SQL Injection Attack Lab

LABSHEET 1: creating a table, primary keys and data types

Oracle Database 10g Express

SQL Server Setup for Assistant/Pro applications Compliance Information Systems

Release Notes For Versant/ODBC On Windows. Release

Advanced Digital Imaging

CSCI110 Exercise 4: Database - MySQL

Using Internet or Windows Explorer to Upload Your Site

Upgrading MySQL from 32-bit to 64-bit

QUANTIFY INSTALLATION GUIDE

Using MailStore to Archive MDaemon

The Web Pro Miami, Inc. 615 Santander Ave, Unit C Coral Gables, FL T: info@thewebpro.com

Usage Tracking for IBM InfoSphere Business Glossary

HowTo. Planning table online

SQL Server Hardening

How To Install Amyshelf On Windows 2000 Or Later

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

Oracle Audit Vault and Database Firewall

Installation Instructions

PRiSM Security. Configuration and considerations

How to install/configure MySQL Database

UQC103S1 UFCE Systems Development. uqc103s/ufce PHP-mySQL 1

ADO and SQL Server Security

Lucid Key Server v2 Installation Documentation.

TIMETABLE ADMINISTRATOR S MANUAL

BlackBerry Enterprise Server Resource Kit

Application note: Connecting the to a Database

Integrating LANGuardian with Active Directory

SETTING UP REMOTE ACCESS ON EYEMAX PC BASED DVR.

SQL Injection Attack Lab Using Collabtive

Training module 2 Installing VMware View

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

PaperClip Audit System Installation Guide

Secure Messaging Server Console... 2

How to Copy A SQL Database SQL Server Express (Making a History Company)

Oracle Database Performance Management Best Practices Workshop. AIOUG Product Management Team Database Manageability

Installation Steps for PAN User-ID Agent

MySQL quick start guide

tpischeduler tpischeduler TotalFBO tpischeduler TotalFBO Initial Installation tpischeduler TotalFBO tpischeduler

Installation Guide for contineo

3 Setting up Databases on a Microsoft SQL 7.0 Server

Installation Guidelines (MySQL database & Archivists Toolkit client)

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

MyOra 3.5. User Guide. SQL Tool for Oracle. Kris Murthy

Security and Control Issues within Relational Databases

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

How to Setup, Install & Run a Website on your Local Computer. For WordPress - on an Offline Server - WAMP

Serious Threat. Targets for Attack. Characterization of Attack. SQL Injection 4/9/2010 COMP On August 17, 2009, the United States Justice

Microsoft SQL Server Installation Guide

SQL Injection January 23, 2013

MassTransit 6.0 Enterprise Web Configuration for Macintosh OS 10.5 Server

Crystal Reports Installation Guide

Contents. 1. Infrastructure

Microsoft SQL Server Installation Guide

Eylean server deployment guide

Moving BidMagic to a new system (Backup / Restore Utility)

How-To: MySQL as a linked server in MS SQL Server

1. Building Testing Environment

User Setup for SQL Security

Introduction to PhPCollab

AVALANCHE MC 5.3 AND DATABASE MANAGEMENT SYSTEMS

FileMaker 12. ODBC and JDBC Guide

SEER Enterprise Shared Database Administrator s Guide

Online shopping store

Upgrade Guide BES12. Version 12.1

VIP Help Desk Web Application User Guide Version 3.0

Configuring Color Access on the WorkCentre 7120 Using Microsoft Active Directory Customer Tip

Microsoft SQL Server Security & Auditing. March 23, 2011 ISACA Chapter Meeting

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com

Administrator Manual

A Guide to Securing MySQL on Windows

National Fire Incident Reporting System (NFIRS 5.0) Configuration Tool User's Guide

Securing SQL Server. Protecting Your Database from. Second Edition. Attackers. Denny Cherry. Michael Cross. Technical Editor ELSEVIER

A Brief Introduction to MySQL

enicq 5 System Administrator s Guide

Multimedia im Netz Online Multimedia Winter semester 2015/16

MySQL Manager. User Guide. July 2012

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4

Final Design Document for Practicum Chat Program

Transcription:

Database Security Rights Enforced IT420: Database Management and Organization Database Security Textbook: Ch 9, pg 309-314 PHP and MySQL: Ch 9, pg 217-227 Database security - only authorized users can perform authorized activities Responsibilities Not Enforced Developing database security Determine users rights and responsibilities Enforce security requirements using security features from both DBMS and application programs 1 2 DBMS Security DBMS products provide security facilities They limit certain actions on certain objects to certain users or groups (also called roles) Almost all DBMS products use some form of user name and password security Examples? Principle of Least Privilege Privileges A user (or process) should have the lowest level of privilege required to perform his assigned task 3 4 1

GRANT and REVOKE GRANT create users / grant them privileges REVOKE remove privileges Privileges: ALL SELECT INSERT, DELETE, UPDATE CREATE, ALTER, DROP USAGE //no privileges GRANT Syntax GRANT privileges [columns] ON object TO user [IDENTIFIED BY 'password'] [WITH GRANT OPTION] Example: GRANT ALL ON dbmusic.* TO dbuser IDENTIFIED BY userpass 5 6 REVOKE Syntax REVOKE priv_type ON object FROM user [, user] Example: REVOKE INSERT ON dbmusic.* FROM dbuser Lab Exercise: Connect to Local DB Server Use WAMP on local machine C:\WAMP\www web directory C:\WAMP\mysql\data MySQL data Start MySQL MySQL Query Browser Server host:localhost User name: root Password: [leave blank] Default schema: mysql OK 7 8 2

Lab Exercise Create database midstore; set it as default for the rest of the session (use midstore;) Create tables (you can use Lab 7 MidStore SQL) Grant select privileges on table midstore.product to user mxxx with password mxxx Logout Connect to MySQL on localhost as mxxx with password mxxx, default schema midstore SELECT * FROM Product; INSERT into Product( ) VALUES( ) What happens? Fix the problem Changing the Password Option 1 mysql database, user table, password column UPDATE user SET Password = PASSWORD( newpass ) WHERE User = dbuser ; [flush privileges;] 9 10 Changing the Password Option 2 SET PASSWORD [FOR username @ host ] = PASSWORD('newpass'); Example: While logged in as dbuser SET PASSWORD = PASSWORD( it420t ) Lab Exercise Login as root Change the password of mxxx to be midnxxx Logout Login as mxxx use the new password Change your own password to midn2cxxx 11 12 3

DBMS Security Model With Roles DBMS Security Guidelines Run DBMS behind a firewall, but plan as though the firewall has been breached Apply the latest operating system and DBMS service packs and fixes Use the least functionality possible Protect the computer that runs the DBMS 13 14 DBMS Security Guidelines Manage accounts and passwords Use a low privilege user account for the DBMS service Protect database accounts with strong passwords Monitor failed login attempts Frequently check group and role memberships Audit accounts with null passwords Assign accounts the lowest privileges possible Limit DBA account privileges Planning Develop a security plan for preventing and detecting security problems Create procedures for security emergencies and practice them Application Security If DBMS security features are inadequate, additional security code could be written in application program Example? Use the DBMS security features first 15 16 4

SQL Injection Attacks! SQL injection attack occurs when data from the user is used to modify a SQL statement Example: users are asked to enter their alpha into a Web form textbox User input: 081234 OR TRUE SELECT * FROM STUDENT_GRADES WHERE Alpha = 081234 OR TRUE; Result? Making your MySQL Database Secure - Server Do not run MySQL (mysqld) as root! Set up a user just for running the server Make directories accessible just to this user Run MySQL server behind a firewall 17 18 Making your MySQL Database Secure - Passwods Make sure all users have strong passwords Connecting from PHP: Have the user an password stored in a file my_db_connect.inc.php and include this file when required Store my_db_connect.inc.php outside web tree ($_SERVER[ DOCUMENT_ROOT ]) Store passwords only in.php files (not.inc,.txt, etc.) Do not store application passwords in plain text. Use sha1(). Making your MySQL Database Secure User Privileges Use principle of least privilege: Grant only the privileges actually needed to each user Grand access only from the host(s) that they will be connecting from 19 20 5

Making your MySQL Database Secure Web Issues Set up a special user just for web connections, with minimum required privileges Check all data coming from user (SQL Injection Attacks!!) addslashes() / stripslashes() doubleval() Lab Exercise Run Mids Store on Local Machine Copy your code from Lab 7 or Lab 8 into C:\WAMP\www Modify to connect to Host: localhost User: mxxxx Password: midn2cxxxx Database: midstore Open browser. Test your programs. 21 22 Lab Exercise Secure the Password File Create a folder Secret in C:\WAMP Move the my_connect_db.inc.php file (or other file that you require ) in C:\WAMP\Secret Include the file from new location instead of require( my_connect_db.inc.php ); Have require($_server[ DOCUMENT_ROOT ]. /../Secret/my_c onnect_db.inc.php ); Lab Exercise SQL Queries for Mids Store Database Find barcode, product name and price for products bought by at least two customers List category name and the average price of products in that category, for each category List product name, price, and category for products with price higher than most expensive product in food category 23 24 6