SCUHolliday12–1 Schedule Today: u Security, Object-Relational Systems. u Read Section 8.7. Next u Indexing. u Read Section 6.6.5 And Then u Query optimization.

Slides:



Advertisements
Similar presentations
Chapter 6: Integrity and Security
Advertisements

Chapter 6: Integrity and Security  Domain Constraints  Referential Integrity  Assertions  Triggers  Security  Authorization  Authorization in SQL.
Chapter 23 Database Security and Authorization Copyright © 2004 Pearson Education, Inc.
II.I Selected Database Issues: 1 - SecuritySlide 1/20 II. Selected Database Issues Part 1: Security Lecture 2 Lecturer: Chris Clack 3C13/D6.
Understand Database Security Concepts
1 Supplement III: Security Controls What security services should network systems provide? Confidentiality Access Control Integrity Non-repudiation Authentication.
Database Security by Muhammad Waheed Aslam SIS Project Leader ITC/KFUPM.
Database Management System
Temple University – CIS Dept. CIS616– Principles of Data Management V. Megalooikonomou Integrity Constraints (based on notes by Silberchatz,Korth, and.
Dr. Kalpakis CMSC 461, Database Management Systems URL: Integrity and Security.
Ch4 Database Security. Security  Security - protection from malicious attempts to steal or modify data.  Database system level Authentication and authorization.
©Silberschatz, Korth and Sudarshan6.1Database System ConceptsTriggers A trigger is a statement that is executed automatically by the system as a side effect.
Triggers A trigger is a statement that is executed automatically by the system as a side effect of a modification to the database. To design a trigger.
1.1R. Meersman --Adapted from: Database System Concepts --Silberschatz, Korth, Sudarshan Chapter 6: Integrity and Security Domain Constraints Referential.
19.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 19: Security The Security Problem Authentication Program Threats.
Monday, 08 June 2015Dr. Mohamed Osman1 What is Database Administration A high level function (technical Function) that is responsible for ► physical DB.
Security A system is secure if its resources are used and accessed as intended under all circumstances. It is not generally possible to achieve total security.
Winter 2002Arthur Keller – CS 18012–1 Schedule Today: Feb. 19 (T) u Object-Relational Systems. u Read Sections 4.5, Assignment 5 due. Feb. 21.
Fall 2001Arthur Keller – CS 18014–1 Schedule Nov. 13 (T) Object-Relational, O-R Queries. u Read Sections 4.5, Assignment 6 due. (No office hours.)
Winter 2002Judy Cushing12–1 Schedule Today (week 8): u Object-Relational Systems. Sections 4.5, u Assignment 5 debriefed. u Transactions, Authorization.
CSCI 5707: Database Security Pusheng Zhang University of Minnesota March 2, 2004.
Chapter 8 Security Transparencies © Pearson Education Limited 1995, 2005.
Triggers, security and authorization in SQL Niki Sardjono Niki Sardjono CS 157A sect 2 Prof. S. M. Lee.
Alter – Information Systems 4th ed. © 2002 Prentice Hall 1 E-Business Security.
Chapter 10: Authentication Guide to Computer Network Security.
ISOM MIS3150 Data and Info Mgmt Database Security Arijit Sengupta.
Operating Systems Protection & Security.
Chapter 6: Integrity and Security Domain Constraints Domain Constraints Referential Integrity Referential Integrity Assertions Assertions Triggers Triggers.
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
SEC835 Practical aspects of security implementation Part 1.
Cryptography, Authentication and Digital Signatures
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Winter 2006Keller, Ullman, Cushing12–1 Object-Relational Systems Object-oriented ideas enter the relational world. u Keep relation as the fundamental abstraction.
CSc-340 3b1 Intermediate SQL Chapter 4 [2 of 2] Phase 1 of Student Projects SQL Data Types & Schemas Authorization.
Copyright © 2013 Curt Hill Database Security An Overview with some SQL.
Section 3 Database Security. 3-2 CA306 Introduction Section Content 3.1 Security Overview 3.2 Security Controls 3.3 Views 3.4 Security in Oracle 3.5 Web.
Triggers. Why Triggers ? Suppose a warehouse wishes to maintain a minimum inventory of each item. Number of items kept in items table Items(name, number,...)
SCUHolliday - coen 1788–1 Schedule Today u Modifications, Schemas, Views. u Read Sections (except and 6.6.6) Next u Constraints. u Read.
Integrity and Security Domain Constraints Referential Integrity Assertions Triggers Security Authorization Authorization in SQL.
Computing & Information Sciences Kansas State University Friday, 12 Oct 2007CIS 560: Database System Concepts Lecture 21 of 42 Friday, 12 October 2007.
CSCI 3140 Module 6 – Database Security Theodore Chiasson Dalhousie University.
Advanced SQL: Triggers & Assertions
Chapter 4: SQL Complex Queries Complex Queries Views Views Modification of the Database Modification of the Database Joined Relations Joined Relations.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
Chap1: Is there a Security Problem in Computing?.
Computing & Information Sciences Kansas State University Friday, 13 Oct 2006CIS 560: Database System Concepts Lecture 21 of 42 Friday, 13 October 2006.
Database Security Lesson Introduction ●Understand the importance of securing data stored in databases ●Learn how the structured nature of data in databases.
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 
Database Security and Authorization. DB security Secrecy: Users should not be able to see things they are not supposed to. – E.g., A student can’t see.
Private key
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 4: Intermediate.
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.
SECURITY. Security Threats, Policies, and Mechanisms There are four types of security threats to consider 1. Interception 2 Interruption 3. Modification.
Database System Concepts, 5th Ed. ©Sang Ho Lee Chapter 8: Application Design and Development.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
TABLES AND INDEXES Ashima Wadhwa.
Database Security and Authorization
Privileges Grant and Revoke Grant Diagrams
Privileges Grant and Revoke Grant Diagrams
Chapter 6: Integrity and Security
Privileges Grant and Revoke Grant Diagrams
Chapter 6: Integrity and Security
Security.
Mohammad Alauthman Computer Security Mohammad Alauthman
Chapter 6: Integrity and Security
Presentation transcript:

SCUHolliday12–1 Schedule Today: u Security, Object-Relational Systems. u Read Section 8.7. Next u Indexing. u Read Section And Then u Query optimization. u No Readings in Text

SCUHolliday12–2 Terminology A Vulnerability is a weakness in the system that might (or might not) be exploited to cause loss or harm. Threats to computing systems are circumstances that have the potential to cause loss or harm. Human attacks from disgruntled employees, natural disasters, human errors, hardware and software flaws are threats. Threats can be assigned a probability.

SCUHolliday12–3 Security Goals Identify the assets: hardware, software, data Maintain three properties: u Confidentiality – only authorized people can see protected data u Integrity – only acceptable and authorized modifications, internally consistent and meaningful, error detection and correction u Availability – fair allocation of resources, can be used as intended

SCUHolliday12–4 Security Vulnerabilities Database system level u Authentication and authorization mechanisms to allow specific users access only to required data u DBMS has automatic backup and recovery mechanism u Audit files Operating system level u O.S. super-users can do anything they want to the database! O.S. level security is required. Network level: must use encryption to prevent u Eavesdropping (unauthorized reading of messages) u Masquerading (pretending to be an authorized user or sending messages supposedly from authorized users)

SCUHolliday12–5 Sources of Vulnerabilities u Physical level Physical access to computers allows destruction of data by intruders; traditional lock-and-key security is needed Computers must also be protected from floods, fire, etc. u Human level Users must be screened to ensure that authorized users do not give access to intruders Users should be trained on password selection and secrecy

SCUHolliday12–6 Authorization in SQL File systems identify certain access privileges on files, e.g., read, write, execute. Similarly, SQL identifies six access privileges on relations, of which the most important are: 1. SELECT = the right to query the relation. ( READ ) 2. INSERT = the right to insert tuples into the relation – may refer to one attribute, in which case the privilege is to specify only one column of the inserted tuple. 3. DELETE = the right to delete tuples from the relation. 4. UPDATE = the right to update tuples of the relation – may refer to one attribute.

SCUHolliday12–7 Granting Privileges You have all possible privileges to the relations you create. You may grant privileges to any user if you have those privileges “with grant option.” u You have this option to your own relations. Example 1.Here, Sally can query Sells and can change prices, but cannot pass on this power: GRANT SELECT ON Sells, UPDATE(price) ON Sells TO sally; 2.Here, Sally can also pass these privileges to whom she chooses: GRANT SELECT ON Sells, UPDATE(price) ON Sells TO sally WITH GRANT OPTION;

SCUHolliday12–8 Revoking Privileges Your privileges can be revoked. Syntax is like granting, but REVOKE... FROM instead of GRANT... TO. Determining whether or not you have a privilege is tricky, involving “grant diagrams”. However, the basic principles are: a)If you have been given a privilege by several different people, then all of them have to revoke in order for you to lose the privilege. b)Revocation is transitive. if A granted P to B, who then granted P to C, and then A revokes P from B, it is as if B also revoked P from C.

SCUHolliday12–9 Schema Privileges Forms of authorization to modify the database schema: Index authorization - allows creation and deletion of indices. Resources authorization - allows creation of new relations. Alteration authorization - allows addition or deletion of attributes in a relation. Drop authorization - allows deletion of relations.

SCUHolliday12–10 View Privileges Users can be given authorization on views, without being given any authorization on the relations used in the view definition Ability of views to hide data serves both to simplify usage of the system and to enhance security by allowing users access only to data they need for their job A combination of relation-level security and view-level security can be used to limit a user’s access to precisely the data that user needs.

SCUHolliday12–11 Views Suppose a bank clerk needs to know the names of the customers of each branch, but is not authorized to see specific loan information. u Approach: Deny direct access to the loan relation, but grant access to the view cust-loan, which consists only of the names of customers and the branches at which they have a loan. u The cust-loan view is defined in SQL as follows: create view cust-loan as select branchname, customer-name from borrower, loan where borrower.loan-number = loan.loan- number

SCUHolliday12–12 The clerk is authorized to see the result of the query: select * from cust-loan When the query processor translates the result into a query on the actual relations in the database, we obtain a query on borrower and loan. Authorization must be checked on the clerk’s query before query processing begins. (Can you guess why?)

SCUHolliday12–13 Creation of view does not require resources authorization since no real relation is being created. The creator of a view gets only those privileges that provide no additional authorization beyond that he already had. E.g. if creator of view cust-loan had only read authorization on borrower and loan, he gets only read authorization on cust-loan

SCUHolliday12–14 The passage of authorization from one user to another may be represented by an authorization graph. The nodes of this graph are the users. The root of the graph is the database administrator. Consider graph for update authorization on loan. An edge U i  U j indicates that user U i has granted update authorization on loan to U j. U1U1 U4U4 U2U2 U5U5 U3U3 DBA

SCUHolliday12–15 Requirement: All edges in an authorization graph must be part of some path originating with the database administrator If DBA revokes grant from U 1 : u Grant must be revoked from U 4 since U 1 no longer has authorization u Grant must not be revoked from U 5 since U 5 has another authorization path from DBA through U 2 Must prevent cycles of grants with no path from the root: u DBA grants authorization to U 7 u U7 grants authorization to U 8 u U8 grants authorization to U 7 u DBA revokes authorization from U 7 Must revoke grant U 7 to U 8 and from U 8 to U 7 since there is no path from DBA to U 7 or to U 8 anymore.

SCUHolliday12–16 Another Look at GRANT The grant statement is used to confer authorization grant on to is: u a user-id u public, which allows all valid users the privilege granted u A role (more on this later) Granting a privilege on a view does not imply granting any privileges on the underlying relations. The grantor of the privilege must already hold the privilege on the specified item (or be the database administrator).

SCUHolliday12–17 The GRANT Statement select: allows read access to relation,or the ability to query using the view u Example: grant users U 1, U 2, and U 3 select authorization on the branch relation: grant select on branch to U 1, U 2, U 3 insert: the ability to insert tuples update: the ability to update using the SQL update statement delete: the ability to delete tuples. references: ability to declare foreign keys when creating relations. usage: In SQL-92; authorizes a user to use a specified domain all privileges: used as a short form for all the allowable privileges

SCUHolliday12–18 More on GRANT with grant option: allows a user who is granted a privilege to pass the privilege on to other users. u Example: grant select on branch to U 1 with grant option gives U 1 the select privileges on branch and allows U 1 to grant this privilege to others

SCUHolliday12–19 Roles Roles permit common privileges for a class of users which can be specified just once by creating a corresponding “role” Privileges can be granted to or revoked from roles, just like to/from users Roles can be assigned to users, and even to other roles SQL:1999 supports roles create role teller create role manager grant select on branch to teller grant update (balance) on account to teller grant all privileges on account to manager grant teller to manager grant teller to alice, bob grant manager to JoAnne

SCUHolliday12–20 More on REVOKE The revoke statement is used to revoke authorization. revoke on from [restrict|cascade] Example: revoke select on branch from U 1, U 2, U 3 cascade Revocation of a privilege from a user may cause other users also to lose that privilege; referred to as cascading of the revoke. We can prevent cascading by specifying restrict: revoke select on branch from U 1, U 2, U 3 restrict With restrict, the revoke command fails if cascading revokes are required.

SCUHolliday12–21 Revoking Continued may be all to revoke all privileges the revokee may hold. If includes public all users lose the privilege except those granted it explicitly. If the same privilege was granted twice to the same user by different grantees, the user may retain the privilege after the revocation. All privileges that depend on the privilege being revoked are also revoked.

SCUHolliday12–22 Limitations SQL does not support authorization at a tuple level u E.g. we cannot restrict students to see only (the tuples storing) their own grades (but Oracle 9i does) All end-users of an application (such as a web application) may be mapped to a single database user The task of authorization in above cases falls on the application program, with no support from SQL u Authorization must be done in application code, and may be dispersed all over an application u Checking for absence of authorization loopholes becomes very difficult since it requires reading large amounts of application code

SCUHolliday12–23 Encryption Data may be encrypted when database authorization provisions do not offer sufficient protection. Properties of good encryption technique: u Relatively simple for authorized users to encrypt and decrypt data. u Encryption scheme depends not on the secrecy of the algorithm but on the secrecy of a parameter of the algorithm called the encryption key. u Extremely difficult for an intruder to determine the encryption key. (AMTH 387 Cryptology – 4 units)

SCUHolliday12–24 Encryption Continued Data Encryption Standard (DES) substitutes characters and rearranges their order on the basis of an encryption key. Scheme is no more secure than the key transmission mechanism since the key has to be shared. Advanced Encryption Standard (AES) is a new standard replacing DES, and is based on the Rijndael algorithm, but is also dependent on shared secret keys Public-key encryption is based on each user having two keys: u public key – publicly published key used to encrypt data, but cannot be used to decrypt that data u private key -- key known only to individual user, and used to decrypt data. Need not be transmitted to the site doing encryption. Encryption scheme is such that it is impossible or extremely hard to decrypt data given only the public key. The RSA public-key encryption scheme is based on the difficulty of factoring a very large number (100's of digits) into its prime components.

SCUHolliday12–25 Authentication Password based authentication is widely used, but is susceptible to sniffing on a network – do you use telnet ?? Challenge-response systems avoid transmission of passwords u DB sends a (randomly generated) challenge string to user u User encrypts string and returns result. u DB verifies identity by decrypting result u Can use public-key encryption system by DB sending a message encrypted using user’s public key, and user decrypting and sending the message back Digital signatures are used to verify authenticity of data u E.g. use private key (in reverse) to encrypt data, and anyone can verify authenticity by using public key (in reverse) to decrypt data. Only holder of private key could have created the encrypted data. u Digital signatures also help ensure nonrepudiation: sender cannot later claim to have not created the data

SCUHolliday12–26 Statistical Databases Problem: how to ensure privacy of individuals while allowing use of data for statistical purposes (e.g., finding median income, average bank balance etc.) How to allow: Select avg(balance) From Account Where branch-name=“Oakland” Without allowing Select balance From Account Where acc#=101

SCUHolliday12–27 Statistical Databases Solutions: u System rejects any query that involves fewer than some predetermined number of individuals.  Still possible to use results of multiple overlapping queries to deduce data about an individual u Data pollution -- random falsification of data provided in response to a query. u Random modification of the query itself. There is a tradeoff between accuracy and security.

SCUHolliday12–28 Physical Level Security Protection of equipment from floods, power failure, etc. Protection of disks from theft, erasure, physical damage. Protection of network and terminal cables from wiretaps non-invasive electronic eavesdropping, physical damage. Solutions: Replicated hardware: u mirrored disks, dual busses, etc. u multiple access paths between every pair of devices Physical security: locks, police, etc. Software techniques to detect physical security breaches.

SCUHolliday12–29 Human Level Security Protection from stolen passwords, sabotage, etc. Primarily a management problem: u Frequent change of passwords u Use of “non-guessable” passwords u Log all invalid access attempts u Data audits u Careful hiring practices

SCUHolliday12–30 Operating System Level Protection from invalid logins File-level access protection (often not very helpful for database security) Protection from improper use of “superuser” authority. Protection from improper use of privileged machine instructions.

SCUHolliday12–31 Network Level Security Each site must ensure that it communicate with trusted sites (not intruders). Links must be protected from theft or modification of messages Mechanisms: u Identification protocol (password-based), u Cryptography.

SCUHolliday12–32 Database Level Security Assume security at network, operating system, human, and physical levels. Database specific issues: u each user may have authority to read only part of the data and to write only part of the data. u User authority may correspond to entire files or relations, but it may also correspond only to parts of files or relations. Oracle 9i allows row-level authorization

SCUHolliday12–33 Object-Relational DBMS Get the advantages of Object Orientation without losing the advantages of Relational DBMS.

SCUHolliday12–34 Object-Relational Systems Keep relation as the fundamental abstraction. Compare with “object-oriented DBMS,” which uses the class as the fundamental abstraction and tacks on relations as one of many types. Motivations Allow DBMS’s to deal with specialized types – maps, signals, images, etc. – with their own specialized methods as in O-O programming languages. Supports specialized methods even on conventional relational data. Supports structure more complex than “flat files.”

SCUHolliday12–35 User-Defined Types SQL allows UDT’s that play a dual role: 1.They can be the types of relations; i.e., the type of their tuple. u Sometimes called a row type. 2.They can be the type of an attribute in a relation.

SCUHolliday12–36 Defining UDT’s – Example in Oracle Syntax CREATE TYPE BarType AS OBJECT ( name CHAR(20) UNIQUE, addr CHAR(20) ); CREATE TYPE BeerType AS OBJECT ( name CHAR(20) UNIQUE, manf CHAR(20) ); CREATE TYPE MenuType AS OBJECT ( bar REF BarType, beer REF BeerType, price FLOAT );

SCUHolliday12–37 Creating Tables Type declarations do not create tables. They are used in place of element lists in CREATE TABLE statements. Example CREATE TABLE Bars OF BarType; CREATE TABLE Beers OF BeerType; CREATE TABLE Sells OF MenuType;

SCUHolliday12–38 Values of User-Defined Types – Oracle Approach Each UDT has a type constructor of the same name. Values of that type are the values of its fields wrapped in the constructor. Example SELECT * FROM Bars; produces values such as BarType('Joe''s Bar','Maple St.')

SCUHolliday12–39 Accessing Fields of an Object – Oracle Approach The dot operator works as expected. Thus, if we want the bar name and address without the constructor: SELECT bb.name, bb.addr FROM Bars bb; The alias bb is not technically necessary, but there are other places where we must use an alias in order to access objects, and it is a good habit to use an alias always.