Database Security Lesson Introduction ●Understand the importance of securing data stored in databases ●Learn how the structured nature of data in databases.

Slides:



Advertisements
Similar presentations
Chapter 23 Database Security and Authorization Copyright © 2004 Pearson Education, Inc.
Advertisements

Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Jan. 2014Dr. Yangjun Chen ACS Database security and authorization (Ch. 22, 3 rd ed. – Ch. 23, 4 th ed. – Ch. 24, 6 th )
Understand Database Security Concepts
Database Security CS461/ECE422 Spring Overview Database model – Relational Databases Access Control Inference and Statistical Databases Database.
Database Security by Muhammad Waheed Aslam SIS Project Leader ITC/KFUPM.
Security and Integrity
Database Management System
Introduction The concept of “SQL Injection”
Introduction to Structured Query Language (SQL)
1 Relational Model. 2 Relational Database: Definitions  Relational database: a set of relations  Relation: made up of 2 parts: – Instance : a table,
CSCI 5707: Database Security Pusheng Zhang University of Minnesota March 2, 2004.
Chapter 8 Security Transparencies © Pearson Education Limited 1995, 2005.
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
CSC 2720 Building Web Applications Database and SQL.
View n A single table derived from other tables which can be a base table or previously defined views n Virtual table: doesn’t exist physically n Limitation.
Dec 13 th CS555 presentation1 Yiwen Wang --“Securing the DB may be the single biggest action an organization can take to protect its assets” David C. Knox.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
Hamdi Yesilyurt, MA Student in MSDF & PhD-Public Affaris SQL Riji Jacob MS Student in Computer Science.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
©Silberschatz, Korth and Sudarshan5.1Database System Concepts Chapter 5: Other Relational Languages Query-by-Example (QBE) Datalog.
The Relational Model. Review Why use a DBMS? OS provides RAM and disk.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 5 “Database and Cloud Security”.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
SEC835 Practical aspects of security implementation Part 1.
Computer Security: Principles and Practice
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
1 IT420: Database Management and Organization Database Security 5 April 2006 Adina Crăiniceanu
Copyright © 2013 Curt Hill Database Security An Overview with some SQL.
Database Management COP4540, SCS, FIU Constraints and security in SQL (Ch. 8.6, Ch22.2)
1 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Oracle 11g DATABASE DEVELOPMENT LAB1. Introduction  Oracle 11g Database:-  Oracle 11g database is designed for some features, which helps to the organizations.
Chapter No 4 Query optimization and Data Integrity & Security.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Controlling User Access Fresher Learning Program January, 2012.
Academic Year 2014 Spring Academic Year 2014 Spring.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Access Control Lesson Introduction ●Understand the importance of access control ●Explore ways in which access control can be implemented ●Understand how.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
Chapter 9 Database Security and Authorization Copyright © 2004 Pearson Education, Inc.
Oracle 11g: SQL Chapter 7 User Creation and Management.
1 Copyright © 2009, Oracle. All rights reserved. Controlling User Access.
Constraints and Views Chap. 3-5 continued (7 th ed. 5-7)
Database Security. Introduction to Database Security Issues (1) Threats to databases Loss of integrity Loss of availability Loss of confidentiality To.
Database Security and Authorization Introduction to DB Security Access Controls Database Security and the DBA Discretionary Access Control The privileges.
Database Security Database System Implementation CSE 507 Some slides adapted from Navathe et. Al.
ADVANCED SQL.  The SQL ORDER BY Keyword  The ORDER BY keyword is used to sort the result-set by one or more columns.  The ORDER BY keyword sorts the.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Non Functional Testing. Contents Introduction – Security Testing Why Security Test ? Security Testing Basic Concepts Security requirements - Top 5 Non-Functional.
Database Security Advanced Database Dr. AlaaEddin Almabhouh.
IST 210 Security. IST 210 Introduction to DB Security Secrecy: Users should not be able to see things they are not supposed to. E.g., A student can’t.
Cosc 5/4765 Database security. Database Databases have moved from internal use only to externally accessible. –Organizations store vast quantities of.
Database and Cloud Security
Database System Implementation CSE 507
Controlling User Access
Managing Privileges.
Database Security and Authorization
Chapter 8 Working with Databases and MySQL
Lecture 2 - SQL Injection
Presentation transcript:

Database Security Lesson Introduction ●Understand the importance of securing data stored in databases ●Learn how the structured nature of data in databases impacts security mechanisms ●Understand attacks and defenses that specifically target databases

Importance of Database Security Why securing data stored in databases so important and different? ●Databases store massive amounts of sensitive data ●Data has structure that influences how it is accessed ●Accessed via queries or programs written in languages like SQL (Structured Query Language) ●Transactional nature of queries (updates or reads) ●Derived data or database views

Database Threats Quiz Oracle, a major database vendor, sponsored a database security study which identified key security threats. In your view, which of the following is the biggest threat... Choose the best answer. External hackers Insiders and unauthorized users

Database Hacking Quiz Databases are attractive targets for hackers because... Mark all applicable answers. They store information such as SS#, DOB etc. that can be easily monetized They store information about lots of users Queries languages used to access data can be abused to gain unauthorized access.

Relational Database Systems (RDBS) ●Relational model based database systems are widely used in real-world environments ●A relational database consists of relations or tables ●A table is defined by a schema and consists of tuples ●Tuples store attribute values as defined by schema ●Keys used to access data in tuples

Relational Database Systems (RDBS)

Operations on relations: ●Create, select, insert, update, join and delete ●Example: SELECT * FROM EMPLOYEE WHERE DID = ‘15’ ●It returns tuples for Robin and Cody Queries written in a query language (e.g., SQL) use such basic operations to access data in a database as needed. Relational Database Systems (RDBS)

Key Value Quiz Two tuples (rows) in a relation can have the same primary key value. Choose the best answer: Yes No

Database Views Quiz We can use a database view to enhance data security because... Choose the best answer. It can exclude sensitive attributes that should not be accessible to certain users A view can only be accessed by a single user

Database Access Control Two commands: GRANT and REVOKE GRANT {privileges | role} [ONtable] TO{user | role | public} [IDENTIFIED BY password] [WITH GRANT OPTION] Example: GRANT SELECT ON ANY TABLE TO Alice

Privileges can be for operations such as SELECT, INSERT, UPDATE OR DELETE. REVOKE{privileges | role} [ONtable] FROM { user | role | PUBLIC} Example: REVOKE SELECT ON ANY TABLE FROM Alice Database Access Control

Database Access Control Quiz Alice has SELECT access to a table and she can propagate this access to Bob when... Choose the best answer. Alice was granted this access with GRANT option She can always propagate an access she has

Cascading Authorizations Quiz Cascading authorizations occur when an access is propagated multiple times and possibly by several users. Assume that Alice grants access to Bob who grants it further to Charlie. When Alice revokes access to Bob, should Charlie’s access be also revoked? Choose the best answer. Yes No

DAC or MAC Quiz Database access control can be managed centrally by a few privileged users. This is an example of... Choose the best answer. DAC MAC

Attacks on Databases: SQL Injections ●Malicious SQL commands are sent to a database ●Can impact both confidentiality (extraction of data) and integrity (corruption of data) ●In a web application environment, typically a script takes user input and builds an SQL query ●Web application vulnerability can be used to craft an SQL injection

Example: Return information about items shipped to a certain city specified user in a web application that uses forms ●Script code: Var Shipcity; Shipcity = Request.form (“Shipcity”); Var sql = “select * from OrdersTable where Shipcity = ‘” + Shipcity + “‘’”; Attacks on Databases: SQL Injections

●User enters REDMOND, ●Script generates SELECT * FROM OrdersTable Where Shipcity = ‘Redmond’. ●What if user enters Redmond’ ; DROP table OrdersTable; ? ●In this case, SELECT * FROM OrdersTable WHERE Shipcity = ‘Redmond’ ; DROP OrdersTable is generated ●Malicious user is able to inject code to delete the table ●Many other code injection examples exist SQL Injection Example

SQL Injection Defenses ●Input checking (golden rule – all input is evil) ●See OWASP top 10 proactive controls at WASP_Proactive_Controls

Login name SQL Login Quiz A web application script uses the following code to generate a query: Query = “SELECT accounts FROM users WHERE login = ‘ “ + login + “ ‘ AND pass = ‘ “ + password + “ ‘ AND pin = “ + pin; The various arguments are read from a form to generate Query. This query is executed to get a user’s account information when the following is provided correctly... Mark all applicable answers. Password PIN

SQL Login Quiz #2 Query = “SELECT accounts FROM users WHERE login = ‘ “ + login + “ ‘ AND pass = ‘ “ + password + “ ‘ AND pin = “ + pin; The various arguments are read from a form to generate Query. Choose the best answer. Query will fail because the provided login is not a correct user An injection attack will result in all users’ account data being returned If a user types “‘or 1 = 1 --” for login in the above query...

Inference Attacks on Databases ●Certain aggregate/statistical queries can be allowed by all users. ●Consider a student grade database with schema studentid, student_standing (junior or senior), exam1_score, exam2_score, final_grade.

Inference Attacks on Databases ●Average score on an exam is a query that any student should be able to run. ●Attacker wants to find exact score of some student. ●Inference attack when target takes the exam late ●Average score before target takes the exam ●Average score after target takes the exam ●Target score can be easily found

Inference Attacks on Databases Another example: only one student has junior standing in a senior class ●Get average score of students who have junior standing ●This query discloses score of a single student

Defenses Against Inference Attacks ●Do not allow aggregate query results when the set of tuples selected is either too small or too large ●Transform data by removing identifying information Deindentification Anonymization This has to be done with care

SQL Inference Attack Quiz The database that stores student exam scores allows queries that return average score for students coming from various states. Can this lead to an inference attack in this system? Choose the best answer. Yes, depending on how many students come from each state No, it is not possible

SQL Inference Attack Quiz #2 Assume in (1), the data in the database is de-identified by removing student id (and other information such as names). Furthermore, the field that has the state of the student is generalized by replacing it with the US region (e.g., Midwest). The generalization ensures that there are at least two students from each region. Are inference attacks still possible? Choose the best answer. Yes No

Database Security Lesson Summary ●Used to store lots of sensitive data that can be accessed via programs (queries) ●Access control must be based on operations allowed by databases ●New attacks on databases arise due to their unique characteristics ●Defenses must address such attacks