Formalizing and Ref ining Authorization in SQL
by Aaron Rosenthal and Edward Sciore (MI TRE)
Formalizing and Ref ining Authorization in SQL by Aaron Rosenthal - - PowerPoint PPT Presentation
Formalizing and Ref ining Authorization in SQL by Aaron Rosenthal and Edward Sciore (MI TRE) J i-Won Byun Tr uSe Reading Group J anuar y 11, 2005 I ntroduction Problems of current aut horizat ion semant ics of SQL t oo complex due t
by Aaron Rosenthal and Edward Sciore (MI TRE)
– t oo complex due t o t riggers, obj ect s, and ot her f eat ures. – Numerous special cases and unnecessary rest rict ions. – DBA must cope wit h diverse user communit ies.
– Reduce t he ad hoc nat ure of aut horizat ion semant ics. – I nt roduce explicit , simple, and f ormal principles. – Formalizat ion and simplif icat ion st art f rom pract ice.
– Obj ect s: schemas, base t ables, views, columns and
– Each obj ect has a set of act ions t hat can be perf ormed
– Specif ies a part icular act ion α on a part icular obj ect O.
– Allows an I D τ t o perf orm an operat ion θ.
Given a st at ement S, SQL implicit ly def ines a set of
– That is, an I D τ is aut hor ized t o per f or m S if f τ has a
– OPS(S) can be f ound by t he f ollowing r ules:
I f S is a quer y, OPS(S) cont ains (select , A) f or all columns A
ment ioned in S.
I f S is an updat e, OPS(S) cont ains (updat e, A) f or each column A
being updat ed, plus (select , B) f or all columns B ment ioned in S.
I f S is a call t o r out ine P, OPS(S) cont ains (execut e, P), plus
(select , A) f or all columns A ment ioned in t he ar gument list .
I f S cont ains a nest ed st at ement S’, OPS(S) cont ains all
Example: Updat e T set A = C + 2
OP
I f S is complex, t he comput at ion of OPS(S) may not
– Unnecessary predicat es; e.g., t aut ologies and const raint s – select T.A f rom T where T.B is null or T.B * T.B >
(select , T.B) should not be in OPS(S)
– The det ect ion of such predicat es is not decidable; t hey
–
–
–
–
1.
2.
–
–
–
–
–
–
–
–
–
–
We would have t o examine ever y possible st at ement involving Z.
–
OPS((select , Z.B)) consist s of t hose oper at ions (select , T.A) such t hat changing A-value of T can change t he B-value of Z.
–
OPS((inser t , Z.B)) consist s of t hose oper at ions (inser t , T.A) if inser t ing int o Z can cause an inser t ion int o T, and Z.B is der ived f r om T.A.
–
OPS((delet e, Z)) consist s of (delet e, T) if delet ing Z can cause a delet ion f r om T.
–
OPS((updat e, Z.B)) consist s of t hose oper at ions (updat e, T.A) if updat ing t he B-value of Z can cause a change in t he A-value of T.
–
OPS((execut e, P)) consist s of t he oper at ions r equir ed t o execut e t he body of P. That is, it cont ains each oper at ion in OPS(DEF(P)).
1.
2.
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
by Aaron Rosenthal and Edward Sciore (MI TRE)
Problem
– Current ly, access permissions in a dat a warehouse are
– The warehouse DBA has t o manually specif y access
– The warehouse DBA must be t rust ed by all sources. – The consequences are inconsist encies, slow response t o
– Thus, t he crit ical problem of dat a warehousing securit y
a.
who is allowed t o access what inf or mat ion (inf or mat ion per missions): ent er pr ise-wide decision
b.
who is allowed t o access which physical t ables (physical per missions): local decision
ayroll clerks are allowed t o run queries on t he warehouse.
−
I n SQL, a user is allowed t o execut e a quer y Q if t he user has per missions on all t ables ment ioned in Q.
−
I n t he pr oposed model, a user can also execut e Q if t her e is an equivalent quer y Q’, called a wit ness f or Q, f or which t he user has per missions.
–
I n SQL, a view can be cr eat ed only if t her e is a user t hat has Gr ant aut hor it y on all ment ioned t ables.
–
The ext ension allows t he views t o be over sever al mut ually- suspicious sour ces, wher e no one is t r ust ed t o have Gr ant per mission over all of t hem.
–
–
–
–
–
–
–
–
–
–
–
–
–
–
–
1.
View subst it ut ion: I f a subj ect s has t he necessar y per missions on t he sour ce t ables ment ioned in a view, t hen s also has per mission on t he view. (SQL r equir es an explicit gr ant t o access a view.)
2.
Semant ic quer y opt imizat ion: I f t he user quer ies a view V, some sour ce dat a t hat under lies V may be ir r elevant t o t he quer y r esult . (Let V be a j oin of t wo t ables. SQL r equir es per missions on bot h t ables. This is not necessar y in some cases.)
3.
Rewr it e in t er ms of ot her views: Subj ect s ar e of t en given access t o inf or mat ion t hough views when t hey do not have per missions on t he base t able.
–
–
–
–
–
–
–
–
–
–
–
–
–
1.
−
A war ehouse suppor t ing f inancial st udies of hospit als.
−
Each hospit al chooses t o r elease it s inf or mat ion wit hin st at e-wide t ot als or cit y-wide t ot als.
2.
−
Table Ent r ant (bor der pat r ol): people ent er ing t he count r y
−
Table Want ed (Police): people who ar e want ed
−
Select * f r om Ent r ant , Want ed wher e mat ch(Ent r ant , Want ed)
3.
−
Table Pat ient (P# , Age, … ): Par ent t able
−
Table Sur ger y(P# , Pr ocedur e, Dat e, … ): Child t able
−
Select * f r om Pat ient , Sur ger y wher e Pat ient .P# = Sur ger y.P# and Pat ient .Age > 80
–
A wit hin-view per mission: (subj ect , oper at ion, obj ect , mode, view).
–
A subj ect s is able t o access view V if s has access t o each input t able wit hin V.
–
The wit ness semant ics is ext ended as f ollows: A per mission (s, op, T, mode) is implied if t her e exist s a quer y Q and views {vi} equivalent t o T, such t hat f or each obj ect Ti ment ioned in Q, eit her
where Q is equivalent t o Vi.
–
User s ar e able t o access a view even when nobody is t r ust ed t o r eceive per missions t o all under lying t ables.