Chapter 2 DB security & authorization(2)
Chapter 2 DB security & authorization(2)
Chapter Two
11
Discretionary Access Control
This is the typical method of enforcing access
control in a database based on the granting and
revoking privileges.
2.1 Types of Discretionary Privileges
The account level:
At this level, the DBA specifies the particular
privileges that each account holds independently
of the relations in the database.
The relation level (or table level):
◦ At this level, the DBA can control the privilege to
access each individual relation or view in the
database. 12
Discretionary Privileges (cont…)
The Privileges at the account level apply to the
capabilities provided to the account itself and
can include
◦ the CREATE SCHEMA or CREATE TABLE
privilege, to create a schema or base relation;
◦ the CREATE VIEW privilege;
◦ the ALTER privilege, to apply schema changes such
as adding or removing attributes from relations;
◦ the DROP privilege, to delete relations or views;
◦ the MODIFY privilege, to insert, delete, or update
tuples;
◦ and the SELECT privilege, to retrieve information
from the database by using a SELECT query.
13
Cont…
The second level of privileges applies to the
relation level
◦ This includes privileges on base relations and
virtual (view) relations.
The granting and revoking of privileges generally
follow an authorization model for discretionary
privileges known as the access matrix model where
◦ The rows of a matrix M represents subjects
(users, accounts, programs)
◦ The columns represent objects (relations,
records, columns, views, operations).
◦ Each position M(i,j) in the matrix represents the
types of privileges (read, write, update) that
subject i holds on object j. 14
Types of Discretionary Privileges (cont..)
21
An Example (cont…)
User account A1 can create tables under the schema
called shema1.
Suppose that A1 creates the two base relations
EMPLOYEE and DEPARTMENT
◦ A1 is then owner of these two relations and
hence all the relation privileges on each of them.
Suppose that A1 wants to grant A2 the privilege to
insert and delete tuples in both of these relations,
but A1 does not want A2 to be able to propagate
these privileges to additional accounts:
GRANT INSERT, DELETE ON
EMPLOYEE, DEPARTMENT TO A2;
22
2.5 An Example (cont…)
Suppose that A1 wants to allow A3 to retrieve
information from either of the two tables and also
to be able to propagate the SELECT privilege to
other accounts.
A1 can issue the command:
GRANT SELECT ON EMPLOYEE,
DEPARTMENT
TO A3 WITH GRANT OPTION;
A3 can grant the SELECT privilege on the
EMPLOYEE relation to A4 by issuing:
GRANT SELECT ON EMPLOYEE TO A4;
◦ Notice that A4 can’t propagate the SELECT
privilege because GRANT OPTION was not given
to A4 23
2.5 An Example (cont…)
Suppose that A1 decides to revoke the
SELECT privilege on the EMPLOYEE
relation from A3; A1 can issue:
REVOKE SELECT ON EMPLOYEE FROM A3;
The DBMS must now automatically revoke
the SELECT privilege on EMPLOYEE from
A4, too, because A3 granted that privilege
to A4 and A3 does not have the privilege
any more.
24
2.5 Example (cont…)
Suppose that A1 wants to give back to A3 a limited
capability to SELECT from the EMPLOYEE relation
and wants to allow A3 to be able to propagate the
privilege.
◦ The limitation is to retrieve only the NAME,
BDATE, and ADDRESS attributes and only for the
tuples with DNO=5.
A1 then create the view:
CREATE VIEW A3EMPLOYEE AS
SELECT NAME, BDATE, ADDRESS
FROM EMPLOYEE
WHERE DNO = 5;
After the view is created, A1 can grant SELECT on
the view A3EMPLOYEE to A3 as follows:
GRANT SELECT ON A3EMPLOYEE TO A3
WITH GRANT OPTION; 25
An Example (cont…)
30
3.1 Comparing Discretionary Access Control and
Mandatory Access Control (cont…)
41