Lect#6 DDBS (Integrity Constraints) - Security Issues, Authorization
Lect#6 DDBS (Integrity Constraints) - Security Issues, Authorization
Week 14
The AUP
1
Goals of DB Security
2
Data and Access Control
3
View Management
4
View Management in Centralized DB/1
EMP
View – virtual relation
ENO ENAME TITLE
• generated from base relation(s) by a query
• not stored as base relations E1 J. Doe Elect. Eng
E2 M. Smith Syst. Anal.
E3 A. Lee Mech. Eng.
E4 J. Miller Programmer
Example : The view of system analysts derived from E5 B. Casey Syst. Anal.
relation EMP E6 L. Chu Elect. Eng.
E7 R. Davis Mech. Eng.
CREATE VIEW SYSAN(ENO,ENAME) E8 J. Jones Syst. Anal.
AS SELECT ENO,ENAME
SYSAN
FROM EMP
ENO ENAME
WHERE TITLE= "Syst. Anal."
E2 M.Smith
E5 B.Casey
E8 J.Jones
View Management in Centralized DB/2:
Query Modification
Queries expressed on views are translated into
7
View Management in Centralized DB/4
8
View Management in DDBs/1
9
View Management in DDBs/2
• Views derived from distributed relations may be costly to
evaluate
• Optimizations are important, e.g., snapshots
• A snapshot is a static view
• does not reflect the updates to the base relations
• can be managed as temporary relations
• is subject to periodic recalculation
• Materialized views store the computed result of a view in a DB
relation, to improve performance.
• Updates of views are made faster by making materialized views.
Uses in On Line Analytical Processing (OLAP) applications in data
warehousing.
10
Data Security/1
• Data protection
• Prevents the physical content of data to be understood by unauthorized users
• Uses encryption/decryption techniques (Public key) -> cryptography
• Access control
• Only authorized users perform operations they are allowed to on database
objects.
• The centralized or distributed DBMS must thus be able to restrict the access
of a subset of the database to a subset of the users.
• Discretionary access control (DAC)
• Also called authorization control; access rights (select, update). Long
been provided by DBMS with authorization rules.
• Mandatory or Multilevel access control (MAC)
• Increases security with security levels or restricting access to
classified data
Discretionary Access Control /2
• Main actors
• Subjects (users, groups of users) who execute operations
• Operations (in queries or application programs)
• Objects, on which operations are performed
• Authorization control checks whether a given triple (subject, operation,
object) can be allowed to proceed (subject may perform an op. on an
object)
• Authorization= (subject, op. type, object def.)
• Defined using GRANT OR REVOKE
• Centralized: one single user class (admin.) may grant or revoke
• Decentralized, with op. type GRANT
• More flexible but recursive revoking process which needs the
hierarchy of grants
Problem with DAC /3
13
Problem with DAC /4
18
Authorization Control /2
19
Authorization Control /3
20
Distributed Authorization Control /1
21
Distributed Authorization Control /2
22
Integrity Constraints /1
• A database is consistent if it satisfies a set of constraints, called
integrity constraints.
• The DDBMS must ensure that such constraints are always
satisfied.
• Two main types of constraints can be distinguished:
• Structural constraints: basic semantic properties inherent to a
data model e.g., unique key constraint in relational model
• Behavioral constraints: regulate application behavior e.g.,
dependencies (functional, inclusion) in the relational model
• An integrity control system has 2 components:
• Integrity constraint specification
• Integrity constraint enforcement
23
Integrity constraints specification/1
24
Integrity constraints specification/2
25
Integrity constraints specification/3
26
Integrity constraints specification/4
27
Integrity Constraints in SQL
28
Integrity Constraints Enforcement /1
29
Integrity Constraints Enforcement /2
30
Distributed Integrity Constraints
31