Privileges Grant and Revoke Grant Diagrams

Slides:



Advertisements
Similar presentations
Jan. 2014Dr. Yangjun Chen ACS Database security and authorization (Ch. 22, 3 rd ed. – Ch. 23, 4 th ed. – Ch. 24, 6 th )
Advertisements

Chapter 7 Notes on Foreign Keys Local and Global Constraints Triggers.
Security and Authorization. Introduction to DB Security Secrecy: Users shouldn’t be able to see things they are not supposed to. –E.g., A student can’t.
Security and Authorization. Introduction to DB Security Secrecy: Users shouldn’t be able to see things they are not supposed to. –E.g., A student can’t.
Constraints and Triggers Foreign Keys Local and Global Constraints Triggers.
1 Chapter 7 System Aspects of SQL uSQL in a Programming Environment uTransactions uAuthorization.
1 SQL Authorization Privileges Grant and Revoke Grant Diagrams.
1 SQL Authorization Privileges Grant and Revoke Grant Diagrams.
Winter 2002Arthur Keller – CS 18013–1 Schedule Today: Feb. 21 (TH) u Transactions, Authorization. u Read Sections Project Part 5 due. Feb. 26.
System Administration Accounts privileges, users and roles
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #4.
Fall 2001Arthur Keller – CS 18012–1 Schedule Nov. 6 (T) Transactions, Authorization. u Read Sections Nov. 8 (TH) Object-Oriented Database Design.
Dec 15, 2003Murali Mani Transactions and Security B term 2004: lecture 17.
Cs3431 Transactions, Logging and Security. cs3431 Transactions: What and Why? A set of operations on a database must appear as one “unit”. Example: Consider.
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
Database Systems Marcus Kaiser School of Computing Science Newcastle University.
Database Programming Sections 13–Creating, revoking objects privileges.
Data Modeling and Database Design
Constraints on Relations Foreign Keys Local and Global Constraints Triggers Following lecture slides are modified from Jeff Ullman’s slides
Winter 2006Keller, Ullman, Cushing9–1 Constraints Commercial relational systems allow much more “fine-tuning” of constraints than do the modeling languages.
1 IT 244 Database Management System Lecture 11 More SQL Constraints &Triggers, SQL Authorization,Transactions Foreign Keys, Local and Global Constraints,
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
DCL/1 Data Control Language Objectives –To learn about the security mechanisms implemented in an RDBMS and how to use them Contents –Identifying Users.
Database Management COP4540, SCS, FIU Constraints and security in SQL (Ch. 8.6, Ch22.2)
Winter 2006Keller, Ullman, Cushing13–1 TRANSACTION MANAGEMENT Airline Reservationsmany updates Statistical Abstract of the USmany queries Atomicity – all.
IST 210 Constraints and Triggers. IST Constraints and Triggers Constraint: relationship among data elements DBMS should enforce the constraints.
Controlling User Access Fresher Learning Program January, 2012.
DATA AND SCHEMA MODIFICATIONS CHAPTERS 4,5 (6/E) CHAPTER 8 (5/E) 1.
Security and User Authorization in SQL CIS 4301 Lecture Notes Lecture /18/2006.
Copyright © 2013 Curt Hill Triggers The Generation of Indirect Actions.
Oracle 11g: SQL Chapter 7 User Creation and Management.
1 SQL Authorization (Chap. 8.7) Privileges Grant and Revoke Grant Diagrams.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 4: Intermediate.
Creating and Revoking Object Privileges. 2 home back first prev next last What Will I Learn? Explain what a ROLE is and what its advantages are. Construct.
1 Database Design: DBS CB, 2 nd Edition SQL in a Server Environment: CLI & JDBC & Security Ch Ch. 9.6 – Ch 10.1.
Database Security Database System Implementation CSE 507 Some slides adapted from Navathe et. Al.
Database System Concepts, 5th Ed. ©Sang Ho Lee Chapter 8: Application Design and Development.
Jennifer Widom Authorization. Jennifer Widom Authorization Database Authorization  Make sure users see only the data they’re supposed to see  Guard.
1 Introduction to Database Systems, CS420 SQL JOIN, Aggregate, Grouping, HAVING and DML Clauses.
Database Security Advanced Database Dr. AlaaEddin Almabhouh.
Database System Implementation CSE 507
CPSC-310 Database Systems
Controlling User Access
Controlling User Access
Controlling User Access
Controlling User Access
Managing Privileges.
Privileges Grant and Revoke Grant Diagrams
Outerjoins, Grouping/Aggregation Insert/Delete/Update
Privileges Grant and Revoke Grant Diagrams
Foreign Keys Local and Global Constraints Triggers
Schedule Today: Next After that Subqueries, Grouping and Aggregation.
Schedule Today Transactions, Authorization. Sections
Introduction to Database Systems, CS420
SQL Authorization Book: A First Course in Database Systems
CPSC-608 Database Systems
CPSC-310 Database Systems
CPSC-310 Database Systems
Privileges Grant and Revoke Grant Diagrams
Authorization.
Session #, Speaker Name Database Privileges 11/29/2018.
אבטחת נתונים בסביבת SQL Data Security
Privileges Grant and Revoke Grant Diagrams
CMSC-461 Database Management Systems
Chapter 2 Views.
CPSC-608 Database Systems
More SQL Extended Relational Algebra Outerjoins, Grouping/Aggregation
SQL – Constraints & Triggers
CPSC-608 Database Systems
Presentation transcript:

Privileges Grant and Revoke Grant Diagrams SQL Authorization Privileges Grant and Revoke Grant Diagrams

Authorization (Ch 10.1) A file system: Identifies certain privileges on the objects (files) it manages. Typically read, write, execute. Identifies certain participants to whom privileges may be granted. Typically the owner, a group, all users.

Privileges – (1) SQL identifies a more detailed set of privileges on objects (relations) than the typical file system. Nine privileges in all are defined, some of which can be restricted to specific attributes of a relation.

Privileges – (2) Some important privileges on a relation (see the text for the complete list): SELECT = right to query the relation. INSERT = right to insert tuples. DELETE = right to delete tuples. UPDATE = right to update tuples. SELECT, INSERT, and UPDATE may apply to only a specified subset of the attributes. A relation may be either a base table or view

Example: Privileges Consider the statement below: INSERT INTO Beers(name) SELECT beer FROM Sells WHERE NOT EXISTS (SELECT * FROM Beers WHERE name = beer); We require privileges SELECT on Sells and Beers, and INSERT on Beers or Beers.name. beers that do not appear in Beers but are in Sells. We add them to Beers with a NULL manufacturer.

Database Objects The objects on which privileges exist include stored tables and views. Other privileges give the right to create objects of a type, e.g., triggers. Views are another important tool for access control.

Example: Views as Access Control We might not want to give the SELECT privilege for salary on Emps(name, addr, salary). It is safer to give SELECT on: CREATE VIEW SafeEmps AS SELECT name, addr FROM Emps; Queries on SafeEmps do not require SELECT on Emps, just on SafeEmps.

Triggers and Privileges Triggers can be tricky wrt privileges A user with a TRIGGER privilege for a relation can attempt to create any trigger for that relation However the condition and action part of a trigger may refer to other relations The user needs the appropriate privileges for those relations also But when someone does something that awakens a trigger, they don’t need the privileges for the condition and action parts of the trigger E.g.: Recall the INSTEAD OF example for inserting into a view.

Authorization ID’s A user is referred to by authorization ID, typically their login name. There is an authorization ID called PUBLIC. Granting a privilege to PUBLIC makes it available to any authorization ID.

Granting Privileges: General Points A user has all possible privileges on the objects (such as relations) that they create. The object owner may grant privileges to other users (authorization ID’s), including PUBLIC. The object owner may also grant privileges WITH GRANT OPTION, which lets the grantee also grant this privilege.

The GRANT Statement To grant privileges: GRANT <list of privileges> ON <relation or other object> TO <list of authorization ID’s>; If you want the recipient(s) to be able to pass the privilege(s) to others add: WITH GRANT OPTION

Example: GRANT Suppose you are the owner of Sells. You may say: GRANT SELECT, UPDATE(price) ON Sells TO sally; Now Sally has the right to issue any query on Sells She can update the price component only.

Example: Grant Option Suppose we also grant: GRANT UPDATE ON Sells TO sally WITH GRANT OPTION; Now, Sally not only can update any attribute of Sells, but she can grant to others the privilege UPDATE ON Sells. Also, she can grant more specific privileges like UPDATE(price) ON Sells.

Revoking Privileges Form: REVOKE <list of privileges> ON <relation or other object> FROM <list of authorization ID’s>; Your granting of these privileges can no longer be used by these users to justify their use of the privilege. But they may still have the privilege because they obtained it from elsewhere.

REVOKE Options We must append to the REVOKE statement either: CASCADE. Now, any grants made by a revokee are also not in force, no matter how far the privilege was passed. RESTRICT. If the privilege has been passed to others, the REVOKE fails as a warning that something else must be done to “chase the privilege down.”

Grant Diagrams It is useful to represent grants and privileges by means of a graph called a grant diagram. Nodes = user / privilege / grant option (y/n) / is owner (y/n) Note that: UPDATE ON R, UPDATE(a) ON R, and UPDATE(b) ON R are represented by different nodes. Also: SELECT ON R and SELECT ON R WITH GRANT OPTION similarly are represented by different nodes. Edge X ->Y means that node X was used to grant Y.

Notation for Nodes Use AP for the node representing authorization ID A with privilege P. P * = privilege P with grant option. P ** = the owner/source of the privilege P. I.e., A is the owner of the object on which P is a privilege. Note ** implies grant option.

Manipulating Edges – (1) When A grants P to B, we draw an edge from AP* or AP** to BP. Or to BP* if the grant is with grant option. If A grants a subprivilege Q of P to B (say, UPDATE(a) on R when P is UPDATE ON R) then the edge goes to BQ or BQ*, instead.

Manipulating Edges – (2) Fundamental rule: User C has privilege Q as long as there is a path from XP** to CQ, CQ*, or CQ**, and P is a superprivilege of Q. P is a superprivilege of Q if having P implies a user has Q Remember that P could be Q, and X could be C.

Manipulating Edges – (3) If A revokes P from B with the CASCADE option, delete the edge from AP to BP. But if A uses RESTRICT instead, and there is an edge from BP to anywhere, then reject the revocation and make no change to the graph.

Manipulating Edges – (4) Having revised the edges, we must check that each node has a path from some ** node, representing ownership. This strategy also handles cycles in granting. Any node with no such path represents a revoked privilege and is deleted from the diagram.

Example: Grant Diagram AP** A owns the object on which P is a privilege

Example: Grant Diagram AP** BP* A: GRANT P TO B WITH GRANT OPTION A owns the object on which P is a privilege

Example: Grant Diagram CP* B: GRANT P TO C WITH GRANT OPTION AP** BP* A: GRANT P TO B WITH GRANT OPTION A owns the object on which P is a privilege

Example: Grant Diagram CP* B: GRANT P TO C WITH GRANT OPTION AP** BP* A: GRANT P TO B WITH GRANT OPTION CP A: GRANT P TO C A owns the object on which P is a privilege

Example: Grant Diagram A executes REVOKE P FROM B CASCADE; AP** Not only does B lose P*, but C loses P*. Delete BP* and CP*. BP* CP* CP However, C still has P without grant option because of the direct grant.

Example: Grant Diagram A executes REVOKE P FROM B CASCADE; Even had C passed P to B, both nodes are still cut off. AP** Not only does B lose P*, but C loses P*. Delete BP* and CP*. BP* CP* CP However, C still has P without grant option because of the direct grant.

Subtle Cases Consider the sequence: U: GRANT INSERT ON R TO V U: GRANT INSERT(A) ON R TO V U: REVOKE INSERT ON R FROM V RESTRICT V retains INSERT(A) privilege from U

Subtle Cases (2) Consider the sequence: U: GRANT p TO V WITH GRANT OPTION V: GRANT p TO W U: REVOKE GRANT OPTION FOR p FROM V CASCADE V retains p privilege, but W does not. When U revokes the grant option, a new node is created for V having the p privilege but without the grant option. Then the arc from U/p** to V/p* is deleted, disconnecting the W/p node

End of SQL Authorization