Lambda-RBAC: Programming with Role-Based Access Control
We study mechanisms that permit program components to express role constraints on clients, focusing on programmatic security mechanisms, which permit access controls to be expressed, in situ, as part of the code realizing basic functionality. In this…
Authors: ** - **Andrew C. Myers** (Carnegie Mellon University) - **John C. Mitchell** (Stanford University) - **David A. Schmidt** (University of Washington) *(※ 실제 논문에 따라 저자 구성이 다를 수 있음)* **
Logical Methods in Computer Science V ol. 4 (1:2) 2008, pp. 1–24 www .lmcs-online.org Submitted Nov . 21, 2006 Published Jan. 9, 2008 λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL RADHA JA GADEESAN a , ALAN JEFFREY b , CORIN PITCHER c , AND JAMES RIEL Y d a,c,d CTI, DeP aul Univ ersit y e-mail addr ess : {rjagadeesan,pit her,jriely}ti.depaul.edu b Bell Labs e-mail addr ess : a jereyb ell-labs.om Abstra t. W e study me hanisms that p ermit program omp onen ts to express role on- strain ts on lien ts, fo using on programmati seurit y me hanisms, whi h p ermit aess on trols to b e expressed, in situ , as part of the o de realizing basi funtionalit y . In this setting, t w o questions immediately arise. (1) The user of a omp onen t faes the issue of safet y: is a partiular role suien t to use the omp onen t? (2) The omp onen t designer faes the dual issue of protetion: is a partiular role demanded in all exeution paths of the omp onen t? W e pro vide a formal alulus and stati analysis to answ er b oth questions. 1. Intr odution This pap er addresses programmati seurit y me hanisms as realized in systems su h as Ja v a Authen tiation and Authorization Servie ( jaas ) and .net . These systems enable t w o forms of aess on trol me hanisms 1 . First, they p ermit de lar ative aess on trol to desrib e seurit y sp eiations that are orthogonal and separate from desriptions of funtionalit y , e.g., in an in terfae I , a delarativ e aess on trol me hanism ould require the aller to p ossess a minim um set of righ ts. While oneptually elegan t, su h sp eiations do not diretly p ermit the enforemen t of aess on trol that is sensitiv e to the on trol and datao w of the o de implemen ting the funtionalit y onsider for example history sensitiv e seurit y p oliies that require run time monitoring of relev an t ev en ts. Consequen tly , jaas and .net also inlude pr o gr ammati me hanisms that p ermit aess on trol o de to b e in tert wined with funtionalit y o de, e.g., in the o de of a omp onen t implemen ting in terfae I . On the one hand, su h programmati me hanisms p ermit the diret expression of aess on trol p oliies. Ho w ev er, the programmati approa h leads to the ommingling of the oneptually separate onerns of seurit y and funtionalit y . 1998 A CM Subje t Classi ation: D.3, K.6.5. Key wor ds and phr ases: role-based aess on trol, lam b da-alulus, stati analysis. a,c Radha Jagadeesan and Corin Pit her w ere supp orted in part b y NSF Cyb erT rust 0430175. d James Riely w as supp orted in part b y NSF CAREER 0347542. 1 In this pap er, w e disuss only authorization me hanisms, ignoring the authen tiation me hanisms that are also part of these infrastrutures. LOGICAL METHODS l IN COMPUTER SCIENCE DOI:10.216 8/LMCS-4 (1:2) 2008 © R. Jagadeesan, A. Jeffrey, C. Pitcher , and J. Riely CC Creative Commons 2 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y There is extensiv e literature on p oliy languages to sp eify and implemen t p oliies (e.g., [16, 28, 15 , 5, 29, 13℄ to name but a few). This resear h studies seurit y p oliies as separate and orthogonal additions to omp onen t o de, and is th us fo used on delarativ e seurit y in the parlane of jaas / .net . In on trast, w e study programmati seurit y me hanisms. Our motiv ation is to extr at the seurit y guaran tees pro vided b y aess on trol o de whi h has b een written inline with omp onen t o de. W e address this issue from t w o viewp oin ts: • The user of a omp onen t faes the issue of safet y: is a partiular set of righ ts suien t to use the omp onen t? (ie. with that set of righ ts, there is no p ossible exeution path that w ould fail a seurit y he k. F urthermore, an y greater set of righ ts will also b e allo w ed to use the omp onen t) • The omp onen t designer faes the dual issue of protetion: is a partiular set of righ ts demanded in all exeution paths of the omp onen t? (ie. ev ery exeution path requires that set of righ ts. F urthermore, an y lesser set of righ ts will not b e allo w ed to use the omp onen t) The main on tribution of this pap er is separate stati analyses to alulate appro ximations to these t w o questions. An appro ximate answ er to the rst question is a set of righ ts, p erhaps bigger than neessary , that is suient to use the omp onen t. On the other hand, an appro ximate answ er to the seond question, is a set of righ ts, p erhaps smaller than what is atually enfored, that is ne essary to use the omp onen t. 1.1. An o v erview of our te hnial on tributions. There is extensiv e literature on Role- Based A ess-Con trol ( rba ) mo dels inluding nist standards for rba [26 , 12 ℄; see [11℄ for a textb o ok surv ey . The main motiv ation for rba , in soft w are ar hitetures (e.g., [22, 21 ℄) and framew orks su h as jaas / .net , is that it enables the enforemen t of seurit y p oliies at a gran ularit y demanded b y the appliation. In these examples, rba allo ws p ermissions to b e de-oupled from users: Roles are the unit of administration for users and p ermissions are assigned to roles. Roles are often arranged in a hierar h y for suint represen tation of the mapping of p ermissions. Comp onen t programmers design o de in terms of a stati olletion of roles. When the appliation is deplo y ed, administrators map the roles dened in the appliation to users in the partiular domain. In this pap er, w e study a lam b da alulus enri hed with primitiv es for aess on trol, dubb ed λ - RBAC . The underlying lam b da alulus serv es as an abstration of the am bien t programming framew ork in a real system. W e dra w inspiration from the programming idioms in jaas and .net , to determine the expressiv eness required for the aess on trol me hanisms. In a sequene of .net examples 2 , losely based on [18 ℄, w e giv e the reader a a v or of the basi programming idioms. Example 1 ( [18 ℄) . In the .net F ramew ork lr , ev ery thread has a Prinipal ob jet that arries its role. This Prinipal ob jet an b e view ed as represen ting the user exeuting the thread. In programming, it often needs to b e determined whether a sp ei Prinipal ob jet b elongs to a familiar role. The o de p erforms he ks b y making a seurit y all for a PrinipalPermission ob jet. The PrinipalPermission lass denotes the role that a sp ei prinipal needs to mat h. A t the time of a seurit y he k, the lr he ks whether 2 In order to minimize the syn tati barrage on the unsusp eting reader, our examples to illustrate the features are dra wn solely from the .net programming domain. A t the lev el of our disussion, there are no real distintions b et w een jaas and .net seurit y servies. λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 3 the role of the Prinipal ob jet of the aller mat hes the role of the PrinipalPermission ob jet b eing requested. If the role v alues of the t w o ob jets do not mat h, an exeption is raised. The follo wing o de snipp et illustrates the issues: PrinipalPermission usrPerm = new PrinipalPermission (null,"Manager"); usrPerm.Demand() If the urren t thread is asso iated with a prinipal that has the the role of manager, the PrinipalPermission ob jets are reated and seurit y aess is giv en as required. If the reden tials are not v alid, a seurit y exeption is raised. In this v ein, the in tuitiv e op eration of λ - RBAC is as follo ws. λ - RBAC program exeution tak es plae in the on text of a role, sa y r , whi h an b e view ed onretely as a set of p ermissions. The set of roles used in a program is stati: w e do not allo w the dynami reation of roles. λ - RBAC supp orts run-time op erations to reate ob jets (i.e. higher-order funtions) that are wrapp ed with proteting roles. The use of su h guarded ob jets is failitated b y op erations that he k that the role-on text r is at least as strong as the guarding role: an exeption is raised if the he k fails. The next example illustrates that b o olean om binations of roles are p ermitted in pro- grams. In lassial rba terms, this is abstrated b y a lattie or b o olean struture on roles. Example 2 ( [18℄) . The Union metho d of the PrinipalPermission lass om bines m ultiple PrinipalPermission ob jets. The follo wing o de represen ts a seurit y he k that sueeds only if the Prinipal ob jet represen ts a user in the CourseAdmin or BudgetManager roles: PrinipalPermission Perm1 = new PrinipalPermission (null,"CourseAdmin"); PrinipalPermission Perm2 = new PrinipalPermission(null,"BudgetManager'); // Demand at least one of the roles using Union perm1.Union (perm2).Demand () Similarly , there is an Interset metho d to represen t a join op eration in the role lattie. In λ - RBAC , w e assume that roles form a lattie: abstrating the onrete union/in ter- setion op erations of these examples. In the onrete view of a role as a set of p ermissions, role ordering is giv en b y sup ersets, ie. a role is stronger than another role if it has more p ermissions; join of roles orresp onds to the union of the sets of p ermissions and meet of roles orresp onds to the in tersetion of the sets of p ermissions. Some of our results assume that the lattie is b o olean, i.e. the lattie has a negation op eration. In the onrete view of the motiv ating examples, the negation op eration is in terpreted b y set omplemen t with resp et to a maxim um olletion of p ermissions Our study is parametri on the underlying role lattie. The k ey op eration in su h programming is rights mo dulation . F rom a programming viewp oin t, it is on v enien t, indeed sometimes required, for an appliation to op erate under the guise of dieren t users at dieren t times. Righ ts mo dulation of ourse omes in t w o a v ors: righ ts w eak ening is o v erall a safe op eration, sine the aller ho oses to exeute with few er righ ts. On the other hand, righ ts ampliation is learly a more dangerous op eration. In the .net framew ork, righ ts mo dulation is a hiev ed via a te hnique alled imp ersonation. 4 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y Example 3. Imp ersonation of an aoun t is a hiev ed using the aoun t's tok en, as sho wn in the follo wing o de snipp et: WindowsIdentity stIdentity = new WindowsIdentity (StToken); // StToken is the token assoiated with the Windows at being impersonated WindowsImpersonationContext stImp = stIdentity.Impersonate(); // now operating under the new identity stImp.Undo(); // revert bak λ - RBAC has om binators to p erform sop ed righ ts w eak ening and ampliation. W e demonstrate the expressiv eness of λ - RBAC b y building a range of useful om binators and a v ariet y of small illustrativ e examples. W e disuss t yp e systems to p erform the t w o analyses alluded to earlier: (a) an analysis to detet and remo v e unneessary role- he ks in a piee of o de for a aller at a suien tly high role, and (b) an analysis to determine the (maximal) role that is guaran teed to b e required b y a piee of o de. The latter analysis a- quires partiular v alue in the presene of righ ts mo dulation. F or b oth w e pro v e preserv ation and progress prop erties. 1.2. Related w ork. Our pap er falls in to the broad area of resear h enlarging the sop e of foundational, language-based seurit y metho ds (see [27 , 19, 3℄ for surv eys). Our w ork is lose in spirit, if not in te hnial dev elopmen t, to edit automata [16 ℄, whi h use asp ets to a v oid the expliit in termingling of seurit y and baseline o de. The pap ers that are most diretly relev an t to the urren t pap er are those of Braghin, Gorla and Sassone [7 ℄ and Compagnoni, Garalda and Gun ter [10℄. [7℄ presen ts the rst on- urren t alulus with a notion of rba , whereas [10℄'s language enables privileges dep ending up on lo ation. Both these pap ers start o with a mobile pro ess-based omputational mo del. Both al- uli ha v e primitiv es to ativ ate and deativ ate roles: these roles are used to prev en t undesired mobilit y and/or omm uniation, and are similar to the primitiv es for role restrition and ampliation in this pap er. The am bien t pro ess alulus framew ork of these pap ers pro- vides a diret represen tation of the sessions of rba in on trast, our sequen tial alulus is b est though t of as mo deling a single session. [7, 10℄ dev elop t yp e systems to pro vide guaran tees ab out the minimal role required for exeution to b e suessful our rst t yp e system o upies the same oneptual spae as this stati analysis. Ho w ev er, our seond t yp e system that alulates minim um aess on trols do es not seem to ha v e an analogue in these pap ers. More globally , our pap er has b een inuened b y the desire to serv e lo osely as a metalan- guage for programming rba me hanisms in examples su h as the jaas / .net framew orks. Th us, our treatmen t in ternalizes righ ts ampliation b y program om binators and the am- plify role onstrutor in role latties. In on trast, the ab o v e pap ers use external i.e. not part of the pro ess language me hanisms (namely , user p oliies in [10 ℄, and rba - s hemes in [7℄) to enfore on trol on righ ts ativ ation. W e exp et that our ideas an b e adapted to the pro ess aluli framew ork. In future w ork, w e also hop e to in tegrate the p o w erful bisim ulation priniples of these pap ers. Our pap er deals with aess on trol, so the extensiv e w ork on information o w, e.g., see [24℄ for a surv ey , is not diretly relev an t. Ho w ev er, w e note that righ ts ampliation pla ys the same role in λ - RBAC that delassiation and delimited release [9, 25, 20 ℄ pla ys in λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 5 the on text of information o w; namely that of p ermitting aess that w ould not ha v e b een p ossible otherwise. In addition, b y supp orting the in ternalizing of the abilit y to amplify o de righ ts in to the role lattie, our system p ermits aess on trol o de to ativ ely partiipate in managing righ ts ampliation. 1.3. Rest of the pap er. W e presen t the language in Setion 2, the t yp e system in Se- tion 3 and illustrate its expressiv eness with examples in Setion 4. W e disuss metho ds for on trolling righ ts ampliation in Setion 5. Setion 6 pro vides pro ofs of the theorems from Setion 3. 2. The Langua ge After a disussion of roles, w e presen t an o v erview of the language design. The remaining subsetions presen t the formal syn tax, ev aluation seman tis, t yping system, and some simple examples. 2.1. Roles. The language of roles is built up from r ole onstrutors . The hoie of role onstrutors is appliation dep enden t, but m ust inlude the lattie onstrutors disussed b elo w. Ea h role onstrutor, κ , has an asso iated arit y , arity ( κ ) . Roles A E ha v e the form κ ( A 1 , . . . , A n ) . W e require that roles form a b o olean lattie; that is, the set of onstrutors m ust inlude the n ullary onstrutors 0 0 0 and 1 1 1 , binary onstrutors ⊔ and ⊓ (written inx), and unary onstrutor ⋆ (written p ostx). 0 0 0 is the least elemen t of the role lattie. 1 1 1 is the greatest elemen t. ⊓ and ⊔ are idemp oten t, omm utativ e, asso iativ e, and m utually distributiv e meet and join op erations resp etiv ely . ⋆ is the omplemen t op erator. A role ma y b e though t of as a set of p ermissions. Under this in terpretation, 0 0 0 is the empt y set, while 1 1 1 is the set of all p ermissions. The syn tax of terms uses r ole mo diers , ρ , whi h ma y b e of the form ↑ A or ↓ A . W e use role mo diers as funtions from roles to roles, with ρ L A M dened as follo ws: ↑ A L B M = A ⊔ B ↓ A L B M = A ⊓ B In summary , the syn tax of roles is as follo ws. κ : : = 0 0 0 | 1 1 1 | ⊔ | ⊓ | ⋆ | · · · Role onstrutors A E : : = κ ( A 1 , . . . , A n ) Roles ρ : : = ↑ A | ↓ A Role mo diers Throughout the pap er, w e assume that all roles (and therefore all t yp es) are w ell-formed, in the sense that role onstrutors ha v e the orret n um b er of argumen ts. The seman tis of roles is dened b y the relation A . = B stating that A and B are pro v ably equiv alen t. In addition to an y appliation-sp ei axioms, w e assume the standard axioms of b o olean algebra. W e sa y that A dominates B (notation A > B ) if A . = A ⊔ B (equiv alen tly B . = A ⊓ B ) is deriv able. Th us w e an onlude 1 1 1 > A ⊔ B > A > A ⊓ B > 0 0 0 , for an y A , B . The role mo dier ↓ A reates a w eak er role (loser to 0 0 0 ), th us w e refer to it as a r estrition . Dually , the mo dier ↑ A reates a stronger role (loser to 1 1 1 ), and th us w e refer to it as an 6 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y ampli ation . While this ordering follo ws that of the nist rba standard [12 ℄, it is dual to the normal logial reading; it ma y b e helpful to k eep in mind that, view ed as a logi, 1 1 1 is false, 0 0 0 is true, ⊔ is and, ⊓ is or and > is implies. 2.2. Language o v erview. Our goal is to apture the essene of role-based systems, where roles are used to regulate the in teration of omp onen ts of the system. W e ha v e hosen to base our language on Moggi's monadi metalanguage b eause it is simple and w ell under- sto o d, y et ri h enough to apture the k ey onepts. By design, the monadi metalanguage is partiularly w ell suited to studying omputational side eets (or simply ee ts ), whi h are en tral to our w ork. (W e exp et that our ideas an b e adapted to b oth pro ess and ob jet aluli.) The omp onen ts in the monadi metalanguage are terms and the on texts that use them. T o protet terms, w e in tro due guards of the form { A }[ M ℄ , whi h an only b e dis harged b y a on text whose role dominates A . The notion of ontext r ole is formalized in the denition of ev aluation, where A ⊲ M → N indiates that on text role A is suien t to redue M to N . The term check M dis harges the guard on M . The ev aluation rule allo ws A ⊲ che ck { B } [ M ℄ → [ M ℄ only if A > B . The on text role ma y v ary during ev aluation: giv en on text role A , the term ρ ( M ) ev aluates M with on text role ρ L A M . Th us, when ↓ B ( M ) is ev aluated with on text role A , M is ev aluated with on text role A ⊓ B . A on text ma y protet itself from a term b y plaing the use of the term in su h a restrited on text. (The syn tax enfores a sta k disipline on role mo diers.) By om bining up w ards and do wn w ards mo diers, o de ma y assume an y role and th us irum v en t an in tended p oliy . W e address this issue in Setion 5. These onstruts are suien t to allo w protetion for b oth terms and on texts: terms an b e proteted from on texts using guards, and on texts an b e proteted from terms using (restritiv e) role mo diers. 2.3. Syn tax. Let x, y , z , f , g range o v er v ariable names, and let bv range o v er base v alues. Our presen tation is abstrat with resp et to base v alues; w e use the t yp es String , Int and Unit (with v alue unit ) in examples. W e use the standard eno dings of b o oleans and pairs (see Example 14). The syn tax of v alues and terms are as follo ws. V , U, W : : = M , N , L : : = V alues; T erms bv | x V Base V alue λx . M M N | fix M Abstration { A }[ M ℄ check M Guard [ M ℄ let x = M ; N Computation ρ ( M ) Role Mo dier Notation. In examples, w e write A ( M ) to abbreviate ↓ 0 0 0 ( ↑ A ( M )) , whi h exeutes M at exatly role A . The v ariable x is b ound in the v alue λx . M (with sop e M ) and in the term let x = M ; N (with sop e N ). If x do es not app ear free in M , w e abbreviate λx . M as λ . M . Similarly , if x do es not app ear free in N , w e abbreviate let x = M ; N as M ; N . W e iden tify syn tax up to renaming of b ound v ariables and write N { x : = M } for the apture- a v oiding substitution of M for x in N . λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 7 In the presen tation of the syn tax ab o v e, w e ha v e paired the onstrutors on v alues on the left with the destrutors on omputations on the righ t. F or example, the monadi metalanguage distinguishes 2 from [ 2 ℄ and [ 1 + 1 ℄ : the former is an in teger, whereas the latter are omputations that, when b ound, pro due an in teger. The omputation v alue [ M ℄ m ust b e dis harged in a binding on text see the redution rule for let, b elo w. Similarly , the funtion v alue λx . M m ust b e dis harged b y appliation; in the redution seman tis that follo ws, ev aluation pro eeds in an appliation till the term in funtion p osition redues to a lam b da abstration. { A }[ M ℄ onstruts a guarded v alue; the asso iated destrutor is check . The monadi metalanguage distinguishes omputations from the v alues they pro due and treats omputations as rst lass en tities. (An y term ma y b e treated as a v alue via the unit onstrutor [ M ℄ .) Both appliation and the let onstrut result in omputations; ho w- ev er, the w a y that they handle their argumen ts is dieren t. The appliation ( λx . N ) [ M ℄ results in N { x : = [ M ℄ } , whereas the binding let x = [ M ℄; M results in N { x : = M } . 2.4. Ev aluation and role error. The small-step ev aluation relation A ⊲ M → M ′ is dened indutiv ely b y the follo wing redution and on text rules. (r-app) A ⊲ ( λx . M ) N → M { x : = N } (-app) A ⊲ M → M ′ A ⊲ M N → M ′ N (r-fix) A ⊲ fix ( λx . M ) → M { x : = fix ( λx . M ) } (-fix) A ⊲ M → M ′ A ⊲ fix M → fix M ′ (r-hk) A ⊲ che ck { B }[ M ℄ → [ M ℄ A > B (-hk) A ⊲ M → M ′ A ⊲ che ck M → check M ′ (r-bind) A ⊲ let x = [ M ℄; N → N { x : = M } (-bind) A ⊲ M → M ′ A ⊲ let x = M ; N → let x = M ′ ; N (r-mod) A ⊲ ρ ( V ) → V (-mod) ρ L A M ⊲ M → M ′ A ⊲ ρ ( M ) → ρ ( M ′ ) The rules r/-app for appliation, r/-fix for xed p oin ts and r/-bind for let are standard. r-hk ensures that the on text role is suien t b efore dis harging the relev an t guard. -mod mo dies the on text role un til the relev an t term is redued to a v alue, at whi h p oin t r-mod disards the mo dier. The ev aluation seman tis is designed to ensure a role-monotoniit y prop ert y . Inreasing the a v ailable role-on text annot in v alidate transitions, it an only enable more ev olution. Lemma 4. If B ⊲ M → M ′ and A > B then A ⊲ M → M ′ . Pr o of. (Sk et h) The on text role is used only in r-hk . Result follo ws b y indution on the ev aluation judgemen t. 8 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y Via a series of onseutiv e small steps, the nal v alue for the program an b e determined. Suessful termination is written A ⊲ M ։ V whi h indiates that A is authorized to run the program M to ompletion, with result V . View ed as a role-indexed relation on terms, ։ is reexiv e and transitiv e. Denition 5. (a) M 0 evaluates to M n at A (notation A ⊲ M 0 ։ M n ) if there exist terms M i su h that A ⊲ M i → M i +1 , for all i ( 0 ≤ i ≤ n − 1 ). (b) M diver ges at A (notation A ⊲ M → ω ) if there exist terms M i su h that A ⊲ M i → M i +1 , for all i ∈ N . Ev aluation an fail b eause a term div erges, b eause a destrutor is giv en a v alue of the wrong shap e, or b eause an inadequate role is pro vided at some p oin t in the omputation. W e refer to the latter as a r ole err or (notation A ⊲ M err ), dened indutiv ely as follo ws. A ⊲ che ck { B } [ M ℄ err A 6 > B ρ L A M ⊲ M err A ⊲ ρ ( M ) err A ⊲ M err A ⊲ M N err A ⊲ M err A ⊲ fix M err A ⊲ M err A ⊲ let x = M ; N err A ⊲ M err A ⊲ check M err Example 6. Reall from Setion 2.3 that B ( M ) abbreviates ↓ 0 0 0 ( ↑ B ( M )) , and dene test < B > as follo ws 3 . test < B > △ = check { B } [ unit ℄ test < B > is a omputation that requires on text role B to ev aluate. F or example, ↓ B ⋆ ( test < B >) pro dues a role error in an y on text, sine ↓ B ⋆ restrits an y role-on text to the negation of the role B . Example 7. W e no w illustrate ho w terms an pro vide roles for themselv es. Consider the follo wing guarded funtion: from < A , B > △ = { A }[ λ y . B ( y )℄ from < A , B > is a guarded v alue that ma y only b e dis harged b y A , resulting in a funtion that runs an y omputation at B . Let test < B > △ = check { B }[ unit ℄ . No matter what the relationship is b et w een A and B , the follo wing ev aluation sueeds: A ⊲ let z = check from < A , B >; z test < B > ։ B ( test < B >) ։ [ unit ℄ from < A , B > is far to o p o w erful to b e useful. After the A -guard is dis harged, the resulting funtion will run any o de at role B . One an pro vide sp ei o de, of ourse, as in λ y . B ( M ) . Su h funtions are inheren tly dangerous and therefore it is desirable onstrain the w a y in whi h su h funtions are reated. The essen tial idea is to atta h suitable he ks to a funtion su h as λ g . λ y . B ( g y ) , whi h tak es a non-privileged funtion and runs it under B . There are a n um b er of subtleties to onsider in pro viding a general purp ose infrastruture to reate terms with righ ts ampliation. When should the guard b e he k ed? What funtions should b e allo w ed to run, and in what on text? In Example 21, w e disuss the treatmen t of these issues using the Domain and T yp e Enforemen t aess on trol me hanism. 3 W e do not address parametriit y here; the bra k ets in the names test < B > and from < A , B > are merely suggestiv e. λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 9 3. Typing W e presen t t w o t yping systems that on trol role errors in addition to shap e errors. The rst t yping system determines a on text role suient to a v oid role errors; that is, with this role, there is no p ossible exeution path that auses a role error. This system enables the remo v al of unneessary role- he ks in a piee of o de for a aller at a suien tly high role. The seond system determines a on text role ne essary to a v oid role errors; that is, an y role that do es not dominate this role will ause ev ery exeution path to result in a role error. Stated dieren tly , the seond system alulates the role that is he k ed and tested on ev ery exeution path and th us determines the amoun t of protetion that is enfored b y the allee. T e hnially , the t w o systems dier primarily in their notions of subt yping. In the absene of subt yping, the t yping system determines a on text role that is b oth neessary and suien t to exeute a term without role errors. Beause it learly indiates the p oin t at whi h omputation is p erformed, the monadi metalanguage is attrativ e for reasoning ab out seurit y prop erties, whi h w e understand as omputational eets. The t yp e [ T ] is the t yp e of omputations of t yp e T . W e extend the omputation t yp e [ T ] to inlude an eet that indiates the guards that are dis harged during ev aluation of a term. Th us the term check { A }[ 1 + 1 ℄ has t yp e h A i [ Int ] this t yp e indiates that the redution of the term to a v alue (at t yp e Int ) requires A . Guarded v alues inhabit t yp es of the form { A } [ T ] this t yp e indiates the protetion of A around an underlying v alue at t yp e T . These ma y b e dis harged with a check , resulting in a term inhabiting the omputation t yp e h A i [ T ] . The syn tax of t yp es is giv en b elo w, with the onstrutors and destrutors at ea h t yp e realled from Setion 2.3. T , S : : = V , U, W : : = M , N , L : : = T yp es; V alues; T erms Base bv | x V Base V alue T S λx . M M N | fix M Abstration { A } [ T ] { A }[ M ℄ check M Guard h A i [ T ] [ M ℄ let x = M ; N Computation ρ ( M ) Role Mo dier 3.1. Subt yping. The judgmen ts of the subt yping and t yping relations are indexed b y α whi h ranges o v er { 1 , 2 } . The subt yping relation for h A i [ T ] reets the dierene b et w een the t w o t yp e systems. If role A sues to enable a term to ev aluate without role errors, then an y higher role on text also a v oids role errors (using Lemma 4). This explains the subt yping rule for the rst t yp e system in partiular, ⊢ 1 h A i [ T ] < : h 1 1 1 i [ T ] , reeting the fat that the top role is suien t to run an y omputation. On the other hand, if a role A of the role-on text is he k ed and tested on ev ery exeution path of a term, then so is an y smaller role. This explains the subt yping rule for the rst t yp e system in partiular, ⊢ 2 h A i [ T ] < : h 0 0 0 i [ T ] , reeting the fat that the b ottom role is v auously he k ed in an y omputation. 10 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y ⊢ α Base < : Base ⊢ α T < : T ′ ⊢ α { A } [ T ] < : { A ′ } [ T ′ ] if α = 1 then A ′ > A if α = 2 then A > A ′ ⊢ α T ′ < : T ⊢ α S < : S ′ ⊢ α T S < : T ′ S ′ ⊢ α T < : T ′ ⊢ α h A i [ T ] < : h A ′ i [ T ′ ] if α = 1 then A ′ > A if α = 2 then A > A ′ Lemma 8. The r elations ⊢ α T < : S ar e r eexive and tr ansitive. 3.2. T yp e systems. T yping is dened using en vironmen ts. An envir onment , Γ : : = x 1 : T 1 , . . . , x n : T n is a nite partial map from v ariables to t yp es. As usual, there is one t yping rule for ea h syn tati form plus the rule t-sub for sub- sumption, whi h allo ws the use of subt yping. Up w ards and do wn w ards role mo diers ha v e separate rules, disussed b elo w. The t yping rules for the t w o systems dier only in their no- tion of subt yping and in the side ondition on t-mod-dn ; w e disuss the latter in Example 15. (t-base) Γ ⊢ α bv : B ase (t-v ar) Γ , x : T , Γ ′ ⊢ α x : T (t-sub) Γ ⊢ α M : T Γ ⊢ α M : T ′ ⊢ α T < : T ′ (t-abs) Γ , x : T ⊢ α M : S Γ ⊢ α λx . M : T S x / ∈ dom (Γ) (t-app) Γ ⊢ α M : T S Γ ⊢ α N : T Γ ⊢ α M N : S (t-fix) Γ ⊢ α M : T T Γ ⊢ α fix M : T (t-grd) Γ ⊢ α M : T Γ ⊢ α { A }[ M ℄ : { A } [ T ] (t-hk) Γ ⊢ α M : { A } [ T ] Γ ⊢ α check M : h A i [ T ] (t-unit) Γ ⊢ α M : T Γ ⊢ α [ M ℄ : h 0 0 0 i [ T ] (t-bind) Γ ⊢ α M : h A i [ T ] Γ , x : T ⊢ α N : h B i [ S ] Γ ⊢ α let x = M ; N : h A ⊔ B i [ S ] x / ∈ dom (Γ) (t-mod-up) Γ ⊢ α M : h B i [ T ] Γ ⊢ α ↑ A ( M ) : h B ⊓ A ⋆ i [ T ] (t-mod-dn) Γ ⊢ α M : h B i [ T ] Γ ⊢ α ↓ A ( M ) : h B i [ T ] if α = 1 then A > B The rules t-base , t-v ar , t-sub , t-abs , t-app and t-fix are standard. F or example, the iden tit y funtion has the exp eted t yping, ⊢ α λx . x : T T , for an y T . Non terminating omputations an also b e t yp ed; for example, ⊢ α fix ( λx . x ) : T , for an y T . An y term ma y b e injeted in to a omputation t yp e at the least role using t-unit . Th us, in the ligh t of the earlier disussion on subt yping, if ⊢ α M : T then, in the rst system, [ M ℄ inhabits h A i [ T ] for ev ery role A ; in the seond system, the term inhabits only t yp e h 0 0 0 i [ T ] , indiating that no he ks are required to suessfully ev aluate the v alue [ M ℄ . λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 11 Computations ma y b e om bined using t-bind 4 . If M inhabits h A i [ T ] and N inhabits h B i [ S ] , then M ; N inhabits h A ⊔ B i [ S ] . More generally , w e an dedue: ⊢ α λx . let x ′ = x ; x ′ : h A i [ h B i [ T ]] h A ⊔ B i [ T ] In the rst t yp e system, this rule is motiv ated b y noting that the role on text A ⊔ B sues to suessfully a v oid role errors in the om bined omputation if A (resp. B ) sues for M (resp. N ). F or the seond t yp e system, onsider a role C that is not bigger than A ⊔ B th us C is not bigger than at least one of A, B . If it is not greater than A , b y assumption on t yping of M , ev ery omputation path of M in role on text C leads to a role-error. Similarly for B . Th us, in role on text C , ev ery omputation path in the om bined omputation leads to a role error. F urthermore, using the earlier subt yping disussion, the sequene also inhabits h 1 1 1 i [ S ] in the rst system and h 0 0 0 i [ S ] in the seond. The rule t-grd t yp es basi v alues with their protetion lev el. The higher-order v ersion of { A }[℄ has the natural t yping: ⊢ α λx . { A }[ x ℄ : T { A } [ T ] Reall that in the transition relation, check { A }[ N ℄ he ks the role on text against A . The t yping rule t-hk mirrors this b eha vior b y on v erting the protetion lev el of v alues in to onstrain ts on role on texts. F or example, w e ha v e the t yping: ⊢ α λx . check x : { A } [ T ] h A i [ T ] In the sp eial ase of t yping Γ ⊢ α check { A }[ N ℄ : h A i [ T ] , w e an further justify in the t w o systems as follo ws. In terms of the rst t yp e system, the role on text passes this he k if it is at least A . In terms of the seond t yp e system, an y role on text that do es not inlude A will ause a role-error. Role mo diers are treated b y separate rules for up w ards and do wn w ards mo diers. The rule for t-mod-up is justied for the rst t yp e system as follo ws. Under assumption that B sues to ev aluate M without role-errors, onsider ev aluation of ↑ A ( M ) in role on text B ⊓ A ⋆ . This term on tributes A to role on text yielding A ⊔ ( B ⊓ A ⋆ ) = ( A ⊔ B ) ⊓ ( A ⊔ A ⋆ ) = B for the ev aluation of M . F or the seond t yp e system, assume that if a role is not greater than B , then the ev aluation of N leads to a role error. Consider the ev aluation of ↑ A ( M ) in a role on text C that do es not exeed B ⊓ A ⋆ . Then, the ev aluation of M pro eeds in role on text C ⊔ A whi h do es not exeed B and hene auses a role error b y assumption. The rule for t-mod-dn is justied for the rst t yp e system as follo ws. Under assumption that B sues to ev aluate M without role-errors, and A is greater than B onsider ev aluation of ↓ A ( M ) in role on text B . This term alters role-on text B to B ⊓ A = B for the ev aluation of M , whi h sues. F or the seond t yp e system, assume that if a role is not greater than B , then the ev aluation of N leads to a role error. Consider the ev aluation of ↓ A ( M ) in a role on text C that do es not exeed B . Then, C ⊓ A ertainly do es not exeed B and so the ev aluation of M auses a role error b y assumption. Example 16 and Example 15 disuss alternate presen tations for the rules of t yping for the role mo diers. In stating the results, w e distinguish omputations from other t yp es. Lemma 10 holds trivially from the denitions. 4 The distintion b et w een our system and dep endeny-based systems an b e see in t-bind , whi h in d [1 , 2, 30 ℄ states that ⊢ let x = M ; N : h B i [ S ] if B > A , where ⊢ M : h A i [ T ] and x : T ⊢ N : h B i [ S ] . 12 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y Denition 9. Role A dominates t yp e T (notation A ≥ T ) if T is not a omputation t yp e, or T is a omputation t yp e h B i [ S ] and A > B . Lemma 10. (a) If A > B and B ≥ T then A ≥ T . (b) If ⊢ 1 T < : S and A ≥ S then A ≥ T . () If ⊢ 2 T < : S and A ≥ T then A ≥ S . The follo wing theorems formalize the guaran tees pro vided b y the t w o systems. The pro ofs ma y b e found in Setion 6. Theorem 11. If ⊢ 1 M : T and A ≥ T , then either A ⊲ M → ω or A ⊲ M ։ V for some V . Theorem 12. If ⊢ 2 M : T and A 6≥ T , then either A ⊲ M → ω or ther e exists N suh that A ⊲ M ։ N and A ⊲ N err . F or the rst system, w e ha v e a standard t yp e-safet y theorem. F or the seond system, su h a safet y theorem do es not hold; for example ⊢ 2 check { 1 1 1}[ unit ℄ : h 1 1 1 i [ Unit ] and 1 1 1 ⊲ check { 1 1 1}[ unit ℄ → [ unit ℄ but 6⊢ 2 [ unit ℄ : h 1 1 1 i [ Unit ] . Instead Theorem 12 states that a term run with an insuien t on text role is guaran teed either to div erge or to pro due a role error. 3.3. Simple examples. Example 13. W e illustrate om binators of the language with some simple funtions. The iden tit y funtion ma y b e giv en its usual t yp e: ⊢ α λ x . x : T T The unit of omputation an b e used to reate a omputation from an y v alue: ⊢ α λ x . [ x ℄ : T h 0 0 0 i [ T ] The let onstrut ev aluates a omputation. In this follo wing example, the result of the omputation x ′ m ust itself b e a omputation b eause it is returned as the result of the funtion: ⊢ α λ x . let x ′ = x ; x ′ : h A i [ h B i [ T ]] h A ⊔ B i [ T ] The guard onstrut reates a guarded term: ⊢ α λ x . { A } [ x ℄ : T { A } [ T ] The he k onstrut dis harges a guard, resulting in a omputation: ⊢ α λ x . check x : { A } [ T ] h A i [ T ] The up w ards role mo dier redues the role required b y a omputation. ⊢ α λ x . ↑ B ( x ) : h A i [ T ] h A ⊓ B ⋆ i [ T ] The rst t yping system requires that an y omputation p erformed in the on text of a do wn- w ard role mo dier ↓ B () m ust not require more than role B : ⊢ α λ x . ↓ B ( x ) : h A i [ T ] h A i [ T ] (where B > A if α = 1 ) In the rst t yp e system, the last t w o judgmen ts ma y b e generalized as follo ws: ⊢ 1 λ x . ρ ( x ) : h ρ L A M i [ T ] h A i [ T ] Th us a role mo dier ma y b e seen as transforming a omputation that requires the mo dier in to one that do es not. F or further disussion see Example 16. λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 13 Example 14 (Bo oleans) . The Ch ur h Bo oleans, tru △ = λ t . λ f . t and fls △ = λ t . λ f . f , illustrate the use of subt yping. In the t w o systems, these ma y b e giv en the follo wing t yp es. Bo ol 1 △ = h A i [ T ] h B i [ T ] h A ⊔ B i [ T ] ⊢ 1 tru , fls : Bo ol 1 Bo ol 2 △ = h A i [ T ] h B i [ T ] h A ⊓ B i [ T ] ⊢ 2 tru , fls : Bo ol 2 These t yp es reet the in tuitions underlying the t w o t yp e systems. The rst t yp e system reets a maxim um o v er all paths t yping, whereas the seond reets a minim um o v er all paths t yping. The onditional ma y b e in terpreted using the follo wing deriv ed rules. Γ ⊢ 1 L : B ool 1 Γ ⊢ 1 M : h A i [ T ] Γ ⊢ 1 N : h B i [ T ] Γ ⊢ 1 if L th en M else N : h A ⊔ B i [ T ] Γ ⊢ 2 L : B ool 2 Γ ⊢ 2 M : h A i [ T ] Γ ⊢ 2 N : h B i [ T ] Γ ⊢ 2 if L th en M else N : h A ⊓ B i [ T ] Example 15 ( t-mod-dn ) . The side ondition on t-mod-dn do es not eet t ypabilit y in seond t yping system, but ma y unneessarily derease the auray of the analysis, as an b e seen from the follo wing onrete example. Let M , N b e terms of t yp e h B i [ T ] . Γ ⊢ α M : h B i [ T ] Γ ⊢ α M : h A ⊓ B i [ T ] ( t-sub ) Γ ⊢ α ↓ A ( M ) : h A ⊓ B i [ T ] ( t-mod-dn ) With the side ondition, the term let x = ↓ A ( M ); N w ould ha v e to b e giv en a t yp e of the form h A ⊓ B i [ T ] , ev en though b oth M and N ha v e t yp e h B i [ T ] . Without the side ondition, the b etter t yp e h B i [ T ] ma y b e giv en to the en tire let expression. Example 16 (Alternativ e rule for role mo diers) . In the rst t yping system, t-mod-up and t-mod-dn ma y b e replaed with the follo wing rule, whi h w e all t-mod-* . Γ ⊢ 1 M : h ρ L B M i [ T ] Γ ⊢ 1 ρ ( M ) : h B i [ T ] Consider ρ = ↑ A . Beause C > ( A ⊔ C ) ⊓ A ⋆ , the follo wing are equiv alen t. Γ ⊢ 1 M : h A ⊔ C i [ T ] Γ ⊢ 1 ↑ A ( M ) : h C i [ T ] ( t-mod-* ) Γ ⊢ 1 M : h A ⊔ C i [ T ] Γ ⊢ 1 ↑ A ( M ) : h ( A ⊔ C ) ⊓ A ⋆ i [ T ] ( t-mod-up ) Γ ⊢ 1 ↑ A ( M ) : h C i [ T ] ( t-sub ) Beause ( D ⊓ A ⋆ ) ⊔ A > D , the follo wing are equiv alen t. Γ ⊢ 1 M : h D i [ T ] Γ ⊢ 1 M : h ( D ⊓ A ⋆ ) ⊔ A i [ T ] ( t-sub ) Γ ⊢ 1 ↑ A ( M ) : h D ⊓ A ⋆ i [ T ] ( t-mod-* ) Γ ⊢ 1 M : h D i [ T ] Γ ⊢ 1 ↑ A ( M ) : h D ⊓ A ⋆ i [ T ] ( t-mod-up ) Consider ρ = ↓ A . Beause A > A ⊓ C and C > A ⊓ C , the follo wing are equiv alen t. Γ ⊢ 1 M : h A ⊓ C i [ T ] Γ ⊢ 1 ↓ A ( M ) : h C i [ T ] ( t-mod-* ) Γ ⊢ 1 M : h A ⊓ C i [ T ] Γ ⊢ 1 ↓ A ( M ) : h A ⊓ C i [ T ] ( t-mod-dn ) Γ ⊢ 1 ↓ A ( M ) : h C i [ T ] ( t-sub ) 14 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y Supp ose A > D . Then D ⊓ A > D , and the follo wing are equiv alen t. Γ ⊢ 1 M : h D i [ T ] Γ ⊢ 1 M : h D ⊓ A i [ T ] ( t-sub ) Γ ⊢ 1 ↓ A ( M ) : h D i [ T ] ( t-mod-* ) Γ ⊢ 1 M : h D i [ T ] Γ ⊢ 1 ↓ A ( M ) : h D i [ T ] ( t-mod-dn ) Example 17 (A sublanguage) . The follo wing prop er sublanguage is suien t to eno de the omputational lam b da alulus. Here v alues and terms are disjoin t, with v alues assigned v alue t yp es T and terms assigned omputation t yp es h A i [ T ] . T , S : : = Base | T h A i [ S ] | { A } [ T ] V , U, W : : = bv | x | λx . M | { A }[ V ℄ M , N , L : : = [ V ℄ | V U | fix V | check V | let x = M ; N | ρ ( M ) Eno ding the Ch ur h Bo oleans in this sublanguage is sligh tly more ompliated than in Example 14; tru and fls m ust aept th unks of t yp e Unit h A i [ S ] rather than the simpler blo ks of t yp e h A i [ S ] . Op erations on base v alues that ha v e no omputational eet are plaed in the language of v alues rather than the language of terms. The resulting terms ma y b e simplied at an y time without aeting the omputation (e.g., [ 1 + 2 == 3 ℄ ma y b e simplied to [ tru ℄ ). Example 18 (Relation to onferene v ersion) . The language presen ted here is m u h simpler than that of the onferene v ersion of this pap er [14 ℄. In partiular, the onferene v ersion ollapsed guards and abstrations in to a single form { A }[ λx . M ℄ with t yp es of the form T { A ⊲ B } [ S ] , whi h translates here as { A } T h B i [ S ] : the immediate guard of the abstration is A , whereas the eet of applying the abstration is B . In addition, the onferene v ersion ollapsed role mo diation and appliation: the appliation ↓ C V U rst he k ed the guard of V , then p erformed the appliation in a on text mo died b y ↓ C . In the urren t presen tation, this translates as let x = check V ; ↓ C ( x U ) . 4. Examples In this setion w e assume n ullary role onstrutors for user roles, su h as Alice , Bob , Cha rlie , Admin , and Daemon . Example 19 (A CLs) . Consider a read-only lesystem proteted b y A ess Con trol Lists (A CLs). One an mo del su h a system as: filesystem △ = λ name . if name ==" file1 " then check { Admin }[" data1 " ℄ else if name ==" file2 " then check { Alice ⊓ B o b }[" data2 " ℄ else [" error : file not f oun d " ℄ If Admin ≥ Alice ⊓ Bob then o de running in the Admin role an aess b oth les: Admin ⊲ filesystem " file1 " ։ check { Admin }[" data1 " ℄ ։ [" data1 " ℄ Admin ⊲ filesystem " file2 " ։ check { Alice ⊓ Bob }[" data2 " ℄ ։ [" data2 " ℄ If Alice 6≥ Admin then o de running as Alice annot aess the rst le but an aess the seond: Alice ⊲ filesystem " file1 " ։ check { Admin }[" data1 " ℄ err Alice ⊲ filesystem " file2 " ։ check { Alice ⊓ Bob }[" data2 " ℄ ։ [" data2 " ℄ λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 15 Finally , if Cha rlie 6≥ Alice ⊓ B ob then o de running as Cha rlie annot aess either le: Cha rlie ⊲ filesystem " file1 " ։ check { Admin }[" data1 " ℄ err Cha rlie ⊲ filesystem " file2 " ։ check { Alice ⊓ Bob }[" data2 " ℄ err The lesystem o de an b e assigned the follo wing t yp e, meaning that a aller m ust p ossess a role from ea h of the A CLs in order to guaran tee that aess he ks will not fail. If, in addition, Admin ≥ Alice ⊓ Bob then the nal role is equal to Admin . ⊢ 1 filesystem : String h Admin ⊔ ( Al i ce ⊓ Bob ) ⊔ 0 0 0 i [ String ] In the ab o v e t yp e, the nal role 0 0 0 arises from the unkno wn le bran h that do es not require an aess he k. The la k of an aess he k explains the w eak er ⊢ 2 t yp e: ⊢ 2 filesystem : String h Admin ⊓ ( Al i ce ⊓ Bob ) ⊓ 0 0 0 i [ String ] This t yp e indiates that filesystem has the p oten tial to exp ose some information to unprivi- leged allers with role Admin ⊓ ( Al ice ⊓ Bob ) ⊓ 0 0 0 . = 0 0 0 , p erhaps ausing the o de to b e agged for seurit y review. Example 20 (W eb serv er) . Consider a w eb serv er that pro vides remote aess to the lesys- tem desrib ed ab o v e. The w eb serv er an use the role assigned to a aller to aess the lesystem (unless the w eb serv er's aller withholds its role). T o prev en t an atta k er deter- mining the non-existene of les via the w eb serv er, the w eb serv er fails when an attempt is made to aess an unkno wn le unless the Debug role is ativ ated. w ebserver △ = λ name . if name ==" file1 " then filesystem name else i f name ==" file2 " then filesystem name else check { Debug }[" error : file not f o und " ℄ F or example, o de running as Alie an aess " file2 " via the w eb serv er: Alice ⊲ webserver " file2 " ։ filesystem " file2 " ։ [" data2 " ℄ The aess he k in the w eb serv er do es prev en t the le not found error message leaking unless the Debug role is ativ e, but, unfortunately , it is not p ossible to assign a role stritly greater than 0 0 0 to the w eb serv er using the seond t yp e system. The filesystem t yp e do es not reord the dieren t roles that m ust b e he k ed dep ending up on the lename argumen t. ⊢ 2 w ebserver : Stri n g h Admin ⊓ ( Alice ⊓ Bob ) ⊓ 0 0 0 i [ String ] (deriv able) 6⊢ 2 w ebserver : Stri n g h Admin ⊓ ( Alice ⊓ Bob ) ⊓ Debug i [ Stri ng ] (not deriv able) Example 21 illustrates ho w the Domain-T yp e Enfor ement ( dte ) aess on trol me ha- nism [6, 31℄, found in Seurit y-Enhaned Lin ux ( selinux ) [17 ℄, an b e mo delled in λ - RBAC . F urther disussion of the relationship b et w een rba and dte an b e found in [11 , 13℄. Example 21 (Domain-T yp e Enforemen t) . The dte aess on trol me hanism gran ts or denies aess requests aording to the urren t domain of running o de. The urren t domain hanges as new programs are exeuted, and transitions b et w een domains are restrited in order to allo w, and also fore, o de to run with an appropriate domain. The restritions up on domain transitions are based up on a dte t yp e asso iated with ea h program to exeute. F or example, the dte p oliy in [31℄ only p ermits transitions from a domain for daemon pro esses to a domain for login pro esses when exeuting the login program, b eause o de running in the login domain is highly privileged. This eet is a hiev ed b y allo wing transitions from 16 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y the daemon domain to the login domain only up on exeution of programs asso iated with a partiular dte t yp e, and that dte t yp e is assigned only to the login program. The essene of dte an b e aptured in λ - RBAC , using roles to mo del b oth domains and dte t yp es, and the on text role to mo del the urren t domain of a system. W e start b y building up on the o de fragmen t λ g . λ y . B ( g y ) , disussed in Example 7, that allo ws a funtion he king role B to b e exeuted in the on text of o de running at a dieren t role. W e ha v e the t yping (for emphasis w e use extra paren theses that are not stritly neessary giv en the usual righ t asso iativit y for the funtion t yp e onstrutor): ⊢ α λ g . λ y . B ( g y ) : ( T h B i [ S ]) ( T h 0 0 0 i [ S ]) T o aid readabilit y , and xing t yp es T and S for the remainder of this example, dene: R △ = R ( T h 0 0 0 i [ S ]) So that the previous t yping b eomes: ⊢ α λ g . λ y . B ( g y ) : T h B i [ S ] T o restrit the use of the privileged funtion λ g . λ y . B ( g y ) , it an b e guarded b y a role E ating as a dte t yp e, where the asso iation of the dte t yp e E with a funtion is mo delled in the sequel b y o de that an ativ ate role E . The guarded funtion an b e t yp ed as: ⊢ α { E } [ λ g . λ y . B ( g y )℄ : { E } [ T h B i [ S ]] W e no w dene a funtion domtrans < A , E , B > for a domain transition from domain (role) A to domain (role) B up on exeution of a funtion asso iated with dte t yp e (also a role) E . The funtion rst v eries that the on text role dominates A , and then p ermits use of the privileged funtion λ g . λ y . B ( g y ) b y o de that an ativ ate role E . The funtion domtrans < A , E , B > is dened b y: domtrans < A , E , B > △ = λ f . λ x . check { A }[ unit ℄; f { E } [ λ g . λ y . B ( g y )℄ x W e ha v e the t yping: ⊢ α domtrans < A , E , B > : { E } [ T h B i [ S ]] ( T h A i [ S ]) The ab o v e t yp e sho ws that domtrans < A , E , B > an b e used to turn a funtion he king role B in to a funtion he king role A , but only when the role E is a v ailablein on trast to the t yp e ( T h B i [ S ]) ( T h A i [ S ]) that do es not require E . In order to mak e use of domtrans < A , E , B > , w e m ust also onsider o de that an ativ ate E . W e dene a funtion assign < E > that tak es a funtion f and ativ ates E in order to aess the privileged o de λ g . λ y . B ( g y ) from domtrans < A , E , B > . The funtion assign < E > is dened b y: assign < E > △ = λ f . λ x . λ y . let g = E ( check x ) ; g f y And w e ha v e the t yping: ⊢ α assign < E > : ( T h B i [ S ]) { E } [ T h B i [ S ]] Therefore the funtional omp osition of assign < E > and domtrans < A , E , B > has t yp e: ( T h B i [ S ]) ( T h A i [ S ]) T o sho w that in the presene of b oth assign < E > and domtrans < A , E , B > , o de running with on text A an exeute o de he king for role on text B , w e onsider the follo wing redutions λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 17 in role on text A , where w e tak e F △ = λ z . check { B } [ unit ℄ and underline terms to indiate the redex: domtrans < A , E , B > ( assign < E > F ) unit = ( λ f . λ x . check { A }[ unit ℄; f ( { E }[ λ g . λ y . B ( g y )℄ ) x ) ( assign < E > F ) unit → ( λ x . check { A }[ unit ℄; ( assign < E > F ) ( { E }[ λ g . λ y . B ( g y )℄ ) x ) unit → check { A }[ unit ℄ ; ( assign < E > F ) ( { E }[ λ g . λ y . B ( g y )℄ ) uni t → ( a ssign < E > F ) ( { E }[ λ g . λ y . B ( g y )℄ ) uni t = ( λ f . λ x . λ y . let g = E ( check x ) ; g f y ) F ( { E }[ λ g . λ y . B ( g y ) ℄ ) unit → ( λ x . λ y . let g = E ( check x ) ; g F y ) ( { E } [ λ g . λ y . B ( g y )℄ ) uni t → ( λ y . let g = E ( check { E } [ λ g . λ y . B ( g y ) ℄); g F y ) uni t → let g = E ( check { E }[ λ g . λ y . B ( g y ) ℄ ); g F uni t → let g = E ([ λ g . λ y . B ( g y )℄) ; g F unit ։ let g = [ λ g . λ y . B ( g y )℄; g F uni t → ( λ g . λ y . B ( g y ) ) F unit → ( λ y . B ( F y ) ) uni t → B ( F unit ) = B ( ( λ z . check { B }[ unit ℄ ) uni t ) → B ( check { B }[ unit ℄ ) → B ([ unit ℄) ։ [ unit ℄ The strength of dte lies in the abilit y to fator aess on trol p oliies in to t w o omp o- nen ts: the set of p ermitted domain transitions and the assignmen t of dte t yp es to o de. W e illustrate this b y adapting the aforemen tioned login example from [31℄ to λ − RBAC . In this example, the dte me hanism is used to fore ev ery in v o ation of user o de (running at role User ) from daemon o de (running at role Daemon ) to o ur via trusted login o de (running at role Login ). This is a hiev ed b y pro viding domain transitions from Login to User , and Daemon to Login , but no others. Moreo v er, o de p ermitted to run at Login m ust b e assigned dte t yp e LoginEXE , and similarly for User and UserEXE . Th us a full program running daemon o de M has the follo wing form, where neither M nor N on tain diret righ ts ampliation. let dtLogin T oUser = domtrans < Login , UserEXE , User >; let dtDa e mon T oLogin = domtrans < Daemon , Log inEXE , Login >; let shell = assign < UserEXE > ( λ . M ) ; let login = assign < LoginEXE > ( λ p wd . if p wd == "seret" then dtLogin T oUser shell unit else . . . ) ; Daemon ( N ) Beause login pro vides the sole gatew a y to the role User , the daemon o de N m ust pro vide the orret passw ord in order to exeute the shell at User (in order to aess resoures that are a v ailable at role User but not at role Daemon ). In addition, remo v al of the domain transition dtDaemon T oLogin mak es it imp ossible for the daemon o de to exeute an y o de at User . 18 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y 5. Contr olling rights amplifia tion Example 22. Supp ose that M on tains no diret righ ts ampliation, that is, no subterms of the form ↑ A ( · ) . Then, in let priv = [ λ x . ↑ A ( V x ) ℄; ↓ User ( M ) w e ma y view V as a T ruste d Computing Base ( tb ) a privileged funtion whi h ma y esalate righ ts and view M as restrited user o de . The funtion p riv is an en try p oin t to the tb whi h is aessible to user o de; that is, user o de is exeuted at the restrited role User , and righ ts ampliation ma y only o ur through in v o ation of p riv . Non-trivial programs ha v e larger tb s with more en try p oin ts. As the size of the tb gro ws, it b eomes diult to understand the seurit y guaran tees oered b y a system when righ ts ampliation is unonstrained, ev en if only in the tb . T o manage this omplexit y , one ma y enfore a o ding on v en tion that requires righ ts inreases b e justied b y earlier he ks. As an example, onsider the follo wing, where amplify is a unary role onstrutor. let at < A > = [ λ f . check { amplify ( A ) }[ λ x . ↑ A ( f x )℄℄; let priv = at < A > V ; ↓ User ( M ) In a on text with role amplify ( A ) , this redues (using r-bind , r-app and r-hk ) to let priv = [ λ x . ↑ A ( V x ) ℄; ↓ User ( M ) In a on text without role amplify ( A ) , ev aluation b eomes stu k when attempting to exeute r-hk . The privileged funtion returned b y at < A > (whi h p erforms righ ts ampliation for A ) is justied b y the he k for amplify ( A ) on an y aller of at < A > . One ma y also wish to expliitly prohibit a term from diret ampliation of some righ t B ; with su h a on v en tion in plae, this an b e a hiev ed using the role mo dier ↓ amplify ( B ) . One ma y formalize the preeding example b y in tro duing the unary role onstrutor amplify , where amplify ( A ) stands for the righ t to pro vide the role A b y storing ↑ A in o de. W e require that amplify distribute o v er ⊔ and ⊓ and ob ey the follo wing absorption la ws: A ⊔ amplify ( A ) . = amplify ( A ) A ⊓ amplify ( A ) . = A Th us amplify ( A ) > A for an y role A . T o distinguish justied use of role mo diers from unjustied use, w e augmen t the syn tax with he ke d r ole mo diers . M , N : : = · · · | ρ A ( M ) Whenev er a he k is p erformed on role M w e mark role mo diers in the onsequen t to indiate that these mo diers ha v e b een justied b y a he k. Dene the funtion mark A homomorphially o v er all terms but for role mo diers: mark A ( ρ ( M ) ) = ρ A ( mark A ( M ) ) mark A ( ρ B ( M ) ) = ρ A ⊔ B ( mark A ( M ) ) Mo dify the redution rule for check as follo ws. A ⊲ che ck { B } [ M ℄ → [ mark B ( M ) ℄ A > B λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 19 Th us, the he k in the example ab o v e will exeute as follo ws. amplify ( A ) ⊲ chec k { amplify ( A ) }[ λx . ↑ A ( f x )℄ → λx . ↑ A amplify ( A ) ( f x ) In the residual, the abstration on tains a he k ed role mo dier, indiating that the role ampliation has b een pro vided b y o de that had the righ t to do so. W e no w dene r ole mo di ation err ors so that ↑ A B ( M ) pro dues an error if B do es not dominate amplify ( A ) . ↑ B ( M ) mo derr ↑ B C ( M ) mo derr C 6 > amplify ( B ) M moderr M N moderr M moderr let x = M ; N mo derr M mo derr check M moderr M moderr ρ ( M ) mo derr Using this augmen ted language, unjustied righ ts ampliation is noted as an error. T o prev en t su h errors, w e mo dify the t yping system to ha v e judgmen ts of the form Γ; C ⊢ α M : T , where C indiates the aum ulated guards on a term whi h m ust b e dis harged b efore the term ma y b e exeuted; sine M is guarded b y C , it ma y inlude subterms of the form ↑ A ( · ) when C > amplify ( A ) . In addition to adding rules for he k ed role mo diers, w e also mo dify t-grd and t-mod-up . The rule t-mod-up ensures that an y ampliation is justied b y C . The rule t-grd allo ws guards to b e used in he king guarded terms; the rule is sound sine guarded terms m ust b e he k ed b efore they are exeuted. (t-grd ′ ) Γ; C ⊔ A ⊢ α M : T Γ; C ⊢ α { A }[ M ℄ : { A } [ T ] (t-mod-up ′ ) Γ; C ⊢ α M : h B i [ T ] Γ; C ⊢ α ↑ A ( M ) : h B ⊓ A ⋆ i [ T ] C > amplify ( A ) (t-mod-dn-heked) Γ; C ⊢ α M : h B i [ T ] Γ; C ⊢ α ↓ A D ( M ) : h B i [ T ] if α = 1 then A > B (t-mod-up-heked) Γ; C ⊢ α M : h B i [ T ] Γ; C ⊢ α ↑ A D ( M ) : h B ⊓ A ⋆ i [ T ] C ⊔ D > amplify ( A ) One ma y not assume that top lev el terms ha v e b een guarded; therefore, let Γ ⊢ α M : T b e shorthand for Γ; 0 0 0 ⊢ α M : T . Example 23. The funtions domtrans and assign from Example 21 are not t ypable using this more restritiv e system. Reall the denitions: domtrans < A , E , B > △ = λ f . λ x . check { A }[ unit ℄; f { E } [ λ g . λ y . B ( g y )℄ x assign < E > △ = λ f . λ x . λ y . let g = E ( check x ) ; g f y The ampliation of B in domtrans is not justied; neither is the ampliation of E in assign . The required form is: domtrans < A , E , B > △ = { amplify ( B ) }[ λ f . λ x . check { A } [ unit ℄; f { E }[ λ g . λ y . B ( g y )℄ x ℄ assign < E > △ = { amplify ( E ) }[ λ f . λ x . λ y . let g = E ( check x ); g f y ℄ 20 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y The login example m ust no w b e mo died in order to dis harge the guards. Again the mo diations are straigh tforw ard: let dtLogin T oUser = check domtrans < Login , UserEXE , User >; let dtDa e mon T oLogin = check domtrans < Daemon , Log inEXE , Login >; let assi g nXUs er = check as sign < UserEXE >; let assi g nXLogin = check assign < LoginEXE >; let shell = assignXUser ( λ . M ) ; let login = assignXLogin ( λ pwd . if p wd == "seret" then dtLogin T oUser shell unit else . . . ) ; Daemon ( N ) Th us mo died, the program t yp es orretly , but will only exeute in a on text that dominates the four roles amplify ( User ) , amplify ( UserEXE ) , amplify ( Login ) , and amplify ( LoginEXE ) . This ensures that domain transitions and assignmen ts are reated b y authorized o de. Prop osition 25 establishes that the t yping system is suien t to prev en t role mo dia- tion errors. The pro of of Prop osition 25 relies on the follo wing lemma, whi h establishes the relation b et w een t yping and mark . Lemma 24. If Γ; C ⊔ A ⊢ α M : T then Γ; C ⊢ α mark A ( M ) : T . Pr o of. By indution on the deriv ation of the t yping judgmen t, app ealing to the denition of mark . Prop osition 25. If ⊢ α M : T and A ⊲ M ։ N then ¬ ( N mo derr ) Pr o of Sketh. That ¬ ( M moderr ) follo ws immediately from the denition of role mo di- ation error, om bined with t-mod-up ′ and t-mod-up-heked . It remains only to sho w that t yping is preserv ed b y redution. W e pro v e this for the t yp e systems of Setion 3 in the next setion. The pro of extends easily to the t yp e system onsidered here. The only wrinkle is the ev aluation rule for check , whi h is handled using the previous lemma. 6. Pr oof of Type Safety Theorems The pro ofs for the rst and seond systems are similar, b oth relying on w ell-studied te hniques [23 ℄. W e presen t pro ofs for the seond system, whi h is the more hallenging of the t w o. Denition 26 (Compatibilit y) . T yp es T and S are omp atible (notation T ≈ S ) if T = S or T = h A i [ R ] and S = h B i [ R ] , for some t yp e R . The follo wing lemmas ha v e straigh tforw ard indutiv e pro ofs. Lemma 27 (Compatibilit y) . If ⊢ α T < : T ′ then T ≈ S i T ′ ≈ S . Lemma 28 (Substitution) . If Γ ⊢ α M : T and Γ , x : T ⊢ α N : S , then Γ ⊢ α N { x : = M } : S . Lemma 29 (Bound W eak ening) . If Γ , x : S ⊢ α M : T and ⊢ α S ′ < : S , then Γ , x : S ′ ⊢ α M : T . λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 21 Lemma 30 (Canonial F orms) . (1) If ⊢ 2 V : T S then V has form ( λx . M ) wher e x : T ⊢ 2 M : S . (2) If ⊢ 2 V : h A i [ T ] then V has form [ M ℄ wher e ⊢ 2 M : T and A = 0 0 0 . (3) If ⊢ 2 V : { A } [ T ] then V has form { B }[ M ℄ wher e ⊢ 2 M : T and B > A . Pr o of. (1) By indution on deriv ation of ⊢ 2 V : T S . The only appliable ases are t-sub and t-abs . ( t-sub ) W e kno w ⊢ 2 V : T ′ S ′ , where ⊢ 2 V : T S and ⊢ 2 T S < : T ′ S ′ , so ⊢ 2 T ′ < : T and ⊢ 2 S < : S ′ . By the IH, V has form ( λx . M ) where x : T ⊢ 2 M : S . By Lemma 29 and subsumption, x : T ′ ⊢ 2 M : S ′ . ( t-abs ) Immediate. (2) By indution on deriv ation of ⊢ 2 V : h A i [ T ] . The only appliable ases are t-sub and t-unit . ( t-sub ) W e kno w ⊢ 2 V : h A ′ i [ T ′ ] , where ⊢ 2 V : h A i [ T ] and ⊢ 2 h A i [ T ] < : h A ′ i [ T ′ ] , so ⊢ 2 T < : T ′ and A > A ′ . By the IH, V has form [ M ℄ where ⊢ 2 M : T and A = 0 0 0 , so A ′ = 0 0 0 . By subsumption, ⊢ 2 M : T ′ . ( t-unit ) Immediate. (3) By indution on deriv ation of ⊢ 2 V : { A } [ T ] . The only appliable ases are t-sub and t-grd . ( t-sub ) W e kno w ⊢ 2 V : { A ′ } [ T ′ ] , where ⊢ 2 V : { A } [ T ] and ⊢ 2 { A } [ T ] < : { A ′ } [ T ′ ] , so ⊢ 2 T < : T ′ and A > A ′ . By the IH, V has form { B } [ M ℄ where ⊢ 2 M : T and B > A , so B > A ′ . By subsumption, ⊢ 2 M : T ′ . ( t-grd ) Immediate. Prop osition 31 (Preserv ation) . If ⊢ 2 M : T and A ⊲ M → N then ther e exists S suh that S ≈ T and ⊢ 2 N : S and if A ≥ S then A ≥ T . Pr o of. By indution on the deriv ation of ⊢ 2 M : T . The indution h yp othesis inludes the quan tiation o v er A , N . F or v alues, the result is trivial; th us w e onsider only the rules for non-v alues. ( t-sub ) W e kno w ⊢ 2 M : T ′ , where ⊢ 2 M : T and ⊢ 2 T < : T ′ , and A ⊲ M → N . Applying the IH to ⊢ 2 M : T and A ⊲ M → N yields S su h that ⊢ 2 N : S and S ≈ T and if A ≥ S then A ≥ T . By Lemma 10, this extends to if A ≥ S then A ≥ T ′ . In addition, b y Lemma 27, w e ha v e S ≈ T ′ . ( t-app ) W e kno w ⊢ 2 M N : T 2 , where ⊢ 2 M : T 1 T 2 and ⊢ 2 N : T 1 , and A ⊲ M N → L . There are t w o sub ases dep ending on the redution rule used in A ⊲ M N → L . ( M is a v alue) By Lemma 30, M = λx . M ′ and x : T 1 ⊢ 2 M ′ : T 2 . The redution yields L = M ′ { x : = N } . By Lemma 28, ⊢ 2 L : T 2 . The remaining requiremen ts on T 2 are immediate. ( M has a redution) Therefore A ⊲ M → M ′ and L = M ′ N . Applying the IH to ⊢ 2 M : T 1 T 2 and A ⊲ M → M ′ yields S su h that ⊢ 2 M ′ : S and S ≈ T 1 T 2 , whi h implies that S = T 1 T 2 . Hene ⊢ 2 L : T 2 . The remaining requiremen ts on T 2 are immediate. ( t-fix ) W e kno w ⊢ 2 fix M : T , where ⊢ 2 M : T T and A ⊲ fix M → L . There are t w o sub ases dep ending on the redution rule used in A ⊲ fix M → L . 22 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y ( M is a v alue) By Lemma 30, M = λx . M ′ and x : T ⊢ 2 M ′ : T . The redution yields L = M ′ { x : = M } . By Lemma 28, ⊢ 2 L : T . The remaining requiremen ts on T are immediate. ( M has a redution) Therefore A ⊲ M → M ′ and L = fix M ′ . Applying the IH to ⊢ 2 M : T T and A ⊲ M → M ′ yields S su h that ⊢ 2 M ′ : S and S ≈ T T , whi h implies that S = T T . Hene ⊢ 2 L : T . The remaining requiremen ts on T are immediate. ( t-hk ) W e kno w ⊢ 2 check M : h A 1 i [ T ] , where ⊢ 2 M : { A 1 } [ T ] , and A ⊲ check M → L . There are t w o sub ases dep ending on the redution rule used in A ⊲ che ck M → L . ( M is a v alue) By Lemma 30, M = { A 2 }[ M ′ ℄ and ⊢ 2 M ′ : T and A 2 > A 1 . The redution yields L = [ M ′ ℄ and from the redution w e dedue A > A 2 , so A > A 1 alw a ys holds. W e assign t yp e ⊢ 2 L : h 0 0 0 i [ T ] , where h 0 0 0 i [ T ] ≈ h A 1 i [ T ] , and w e ha v e already sho wn that A > 0 0 0 implies A > A 1 . ( M has a redution) Therefore A ⊲ M → M ′ and L = check M ′ . Applying the IH to ⊢ 2 M : { A 1 } [ T ] and A ⊲ M → M ′ yields S su h that ⊢ 2 M ′ : S and S ≈ { A 1 } [ T ] , so S = { A 1 } [ T ] . Hene ⊢ 2 L : h A 1 i [ T ] . The remaining requiremen ts on h A 1 i [ T ] are immediate. ( t-bind ) W e kno w ⊢ 2 let x = M ; N : h A 1 ⊔ A 2 i [ T 2 ] , where ⊢ 2 M : h A 1 i [ T 1 ] and x : T 1 ⊢ 2 N : h A 2 i [ T 2 ] , and A ⊲ let x = M ; N → L . There are t w o sub ases dep ending on the redution rule used in A ⊲ let x = M ; N → L . ( M is a v alue) By Lemma 30, M = [ M ′ ℄ and ⊢ 2 M ′ : T 1 and A 1 = 0 0 0 , so A 1 ⊔ A 2 = A 2 . The redution yields L = N { x : = M ′ } . By Lemma 28, ⊢ 2 L : h A 2 i [ T 2 ] . The remaining requiremen ts on T 2 are immediate. ( M has a redution) Therefore A ⊲ M → M ′ and L = let x = M ′ ; N . Applying the IH to ⊢ 2 M : h A 1 i [ T 1 ] and A ⊲ M → M ′ yields S su h that ⊢ 2 M ′ : S and S ≈ h A 1 i [ T 1 ] and if A ≥ S then A ≥ h A 1 i [ T 1 ] . Hene S = h A 3 i [ T 1 ] , for some A 3 , and A > A 3 implies A > A 1 . W e dedue ⊢ 2 L : h A 3 ⊔ A 2 i [ T 2 ] , where h A 3 ⊔ A 2 i [ T 2 ] ≈ h A 1 ⊔ A 2 i [ T 2 ] . Finally , supp ose A ≥ h A 3 ⊔ A 2 i [ T 2 ] , i.e., A > A 3 ⊔ A 2 , so A > A 3 and A > A 2 . By the ab o v e, this en tails A > A 1 , so A > A 1 ⊔ A 2 . Therefore A ≥ h A 1 ⊔ A 2 i [ T 2 ] , as required. ( t-mod-up ) W e kno w ⊢ 2 ↑ A 1 ( M ) : h A 2 ⊓ A ⋆ 1 i [ T ] , where ⊢ 2 M : h A 2 i [ T ] , and A ⊲ ↑ A 1 ( M ) → L . There are t w o sub ases dep ending on the redution rule used in A ⊲ ↑ A 1 ( M ) → L . ( M is a v alue) Therefore L = M and ⊢ 2 L : h A 2 i [ T ] , where h A 2 i [ T ] ≈ h A 2 ⊓ A ⋆ 1 i [ T ] . By Lemma 30, M = [ M ′ ℄ and ⊢ 2 M ′ : T and A 2 = 0 0 0 , and the remaining requiremen t on h A 2 i [ T ] , that A ≥ h A 2 i [ T ] implies A ≥ h A 2 ⊓ A ⋆ 1 i [ T ] , is immediate. ( M has a redution) Therefore ↑ A 1 L A M ⊲ M → M ′ and L = ↑ A 1 ( M ′ ) . Applying the IH to ⊢ 2 M : h A 2 i [ T ] and ↑ A 1 L A M ⊲ M → M ′ yields S su h that ⊢ 2 M ′ : S and S ≈ h A 2 i [ T ] , so S = h A 3 i [ T ] for some A 3 , and if ↑ A 1 L A M ≥ S then ↑ A 1 L A M ≥ h A 2 i [ T ] , i.e., A ⊔ A 1 > A 3 implies A ⊔ A 1 > A 2 . W e ha v e ⊢ 2 ↑ A 1 ( M ′ ) : h A 3 ⊓ A ⋆ 1 i [ T ] and h A 3 ⊓ A ⋆ 1 i [ T ] ≈ h A 2 ⊓ A ⋆ 1 i [ T ] . Finally , if A ≥ h A 3 ⊓ A ⋆ 1 i [ T ] , then A > A 3 ⊓ A ⋆ 1 , so A ⊔ A 1 > ( A 3 ⊓ A ⋆ 1 ) ⊔ A 1 = ( A 3 ⊔ A 1 ) ⊓ 1 1 1 = A 3 ⊔ A 1 . Hene A ⊔ A 1 > A 3 , so A ⊔ A 1 > A 2 , and A ⊓ A ⋆ 1 = ( A ⊓ A ⋆ 1 ) ⊔ 0 0 0 = ( A ⊔ A 1 ) ⊓ A ⋆ 1 > A 2 ⊓ A ⋆ 1 . Therefore A > A 2 ⊓ A ⋆ 1 and A ≥ h A 2 ⊓ A ⋆ 1 i [ T ] , as required. ( t-mod-dn ) W e kno w ⊢ 2 ↓ A 1 ( M ) : h A 2 i [ T ] , where ⊢ 2 M : h A 2 i [ T ] , and A ⊲ ↓ A 1 ( M ) → L . There are t w o sub ases dep ending on the redution rule used in A ⊲ ↓ A 1 ( M ) → L . ( M is a v alue) Therefore L = M and ⊢ 2 L : h A 2 i [ T ] , and w e are done. λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 23 ( M has a redution) Therefore ↓ A 1 L A M ⊲ M → M ′ and L = ↓ A 1 ( M ′ ) . By A > ↓ A 1 L A M and Lemma 4, w e ha v e A ⊲ M → M ′ . Applying the IH to ⊢ 2 M : h A 2 i [ T ] and A ⊲ M → M ′ yields S su h that ⊢ 2 M ′ : S and S ≈ h A 2 i [ T ] , so S = h A 3 i [ T ] for some A 3 , and if A ≥ S then A ≥ h A 2 i [ T ] . Hene ⊢ 2 ↓ A 1 ( M ′ ) : h A 3 i [ T ] , whi h ompletes the sub ase. Corollary 32. If ⊢ 2 M : T and A ⊲ M ։ V , then A ≥ T . Pr o of. By indution on the length of the redution sequene A ⊲ M ։ V . F or the base ase, M = V and Lemma 30 implies that A ≥ T , b eause ev ery non-omputation t yp e is dominated b y an y role, and in a omputation t yp e T = h B i [ S ] Lemma 30 tells us that B = 0 0 0 . F or the indutiv e step, there exists N su h that A ⊲ M → N and A ⊲ N ։ V . By Prop osition 31, there exists S su h that ⊢ 2 N : S and if A ≥ S then A ≥ T . Applying the IH to ⊢ 2 N : S and A ⊲ N ։ V yields A ≥ S , hene A ≥ T as required. Prop osition 33 (Progress) . F or al l A , if ⊢ 2 M : T then either M is a value, A ⊲ M err , or ther e exists N suh that A ⊲ M → N . Pr o of. By indution on the deriv ation of ⊢ 2 M : T . W e need only onsider the ases when M is not a v alue. ( t-sub ) W e kno w ⊢ 2 M : T ′ , where ⊢ 2 M : T and ⊢ 2 T < : T ′ . Immediate b y the IH. ( t-app ) W e kno w ⊢ 2 M N : T 2 , where ⊢ 2 M : T 1 T 2 and ⊢ 2 N : T 1 . Apply the IH to ⊢ 2 M : T 1 T 2 and role A . If M is a v alue, then, b y Lemma 30, M has form ( λx . L ) , so A ⊲ M N → L { x : = N } . If A ⊲ M err , then A ⊲ M N err . Finally , if A ⊲ M → L , then A ⊲ M N → L N . ( t-fix ) W e kno w ⊢ 2 fix M : T , where ⊢ 2 M : T T . Apply the IH to ⊢ 2 M : T T and role A . If M is a v alue, then, b y Lemma 30, M has form ( λx . L ) , so A ⊲ fix M → L { x : = ( λx . L ) } . If A ⊲ M err , then A ⊲ fix M err . Finally , if A ⊲ M → L , then A ⊲ fix M → fix L . ( t-hk ) W e kno w ⊢ 2 check M : h A 1 i [ T ] , where ⊢ 2 M : { A 1 } [ T ] . Apply the IH to ⊢ 2 M : { A 1 } [ T ] and role A . If M is a v alue, then, b y Lemma 30, there exists B , L su h that M = { B }[ L ℄ , so either A ⊲ check M → [ L ℄ or A ⊲ che ck M err dep ending on whether A > B holds or not. If A ⊲ M err , then A ⊲ che ck M err . Finally , if A ⊲ M → L , then A ⊲ che ck M → check L . ( t-bind ) W e kno w ⊢ 2 let x = M ; N : h A 1 ⊔ A 2 i [ T 2 ] , where ⊢ 2 M : h A 1 i [ T 1 ] and x : T 1 ⊢ 2 N : h A 2 i [ T 2 ] . Apply the IH to ⊢ 2 M : h A 1 i [ T 1 ] and role A . If M is a v alue, then, b y Lemma 30, M has form [ L ℄ , so A ⊲ let x = M ; N → N { x : = L } . If A ⊲ M err , then A ⊲ let x = M ; N err . Finally , if A ⊲ M → L , then A ⊲ let x = M ; N → let x = L ; N . ( t-mod-up ) W e kno w ⊢ 2 ↑ A 1 ( M ) : h A 2 ⊓ A ⋆ 1 i [ T ] , where ⊢ 2 M : h A 2 i [ T ] . Apply the IH to ⊢ 2 M : h A 2 i [ T ] and role ↑ A 1 L A M . If M is a v alue, then A ⊲ ↑ A 1 ( M ) → M . If ↑ A 1 L A M ⊲ M err , then A ⊲ ↑ A 1 ( M ) err . Finally , if ↑ A 1 L A M ⊲ M → L , then A ⊲ ↑ A 1 ( M ) → ↑ A 1 ( L ) . ( t-mod-dn ) W e kno w ⊢ 2 ↓ A 1 ( M ) : h A 2 i [ T ] , where ⊢ 2 M : h A 2 i [ T ] . Apply the IH to ⊢ 2 M : h A 2 i [ T ] and role ↓ A 1 L A M . If M is a v alue, then A ⊲ ↓ A 1 ( M ) → M . If ↓ A 1 L A M ⊲ M err , then A ⊲ ↓ A 1 ( M ) err . Finally , if ↓ A 1 L A M ⊲ M → L , then A ⊲ ↓ A 1 ( M ) → ↓ A 1 ( L ) . Theorem (12) . If ⊢ 2 M : T and A 6≥ T , then either A ⊲ M → ω or ther e exists N suh that A ⊲ M ։ N and A ⊲ N err . Pr o of. W e use a oindutiv e argumen t to onstrut a redution sequene that is either innite or terminates with a role he k failure. When ⊢ 2 M : T and A 6≥ T , w e kno w that M is 24 R. JA GADEESAN, A. JEFFREY, C. PITCHER, AND J. RIEL Y not a v alue b y Lemma 30. By Prop osition 33, either A ⊲ M err or there exists N su h that A ⊲ M → N . In the former ase, w e are done. In the latter ase, using Prop osition 31, there exists S su h that ⊢ 2 N : S and if A ≥ S then A ≥ T . Ho w ev er, w e kno w that A 6≥ T , so A 6≥ S , as required. 7. Conlusions The fo us of this pap er is programmati approa hes, su h as jaas / .net , that use rba . F rom a soft w are engineering approa h to the design of omp onen ts, rba failitates a sepa- ration of onerns: the design of the system is arried out in terms of a role hierar h y with an asso iated assignmen t of p ermissions to roles, whereas the atual assignmen t of users to roles tak es plae at the time of deplo ymen t. W e ha v e presen ted t w o metho ds to aid the design and use of omp onen ts that inlude su h aess on trol o de. The rst admittedly standard te hnique enables users of o de to dedue the role at whi h o de m ust b e run. The main use of this analysis is to optimize o de b y enabling the remo v al of some dynami he ks. The seond somewhat more no v el analysis alulates the role that is v eried on all exeution paths. This analysis is p oten tially useful in v alidating ar hitetural seurit y requiremen ts b y enabling o de designers to dedue the protetion guaran tees of their o de. W e ha v e demonstrated the use of these metho ds b y mo deling Domain T yp e Enfore- men t, as used in SELin ux. As future w ork, w e will explore extensions to role p olymorphism and reursiv e roles follo wing the te hniques of [8 , 4℄. A kno wledgments The presen tation of the pap er has greatly impro v ed thanks to the ommen ts of the referees. Referenes [1℄ M. Abadi. A ess on trol in a ore alulus of dep endeny . SIGPLAN Not. , 41(9):263273, 2006. [2℄ M. Abadi, A. Banerjee, N. Hein tze, and J. G. Rie k e. A ore alulus of dep endeny . In POPL '99 , pages 147160. A CM Press, 1999. [3℄ M. Abadi, G. Morrisett, and A. Sab elfeld. Language-based seurit y . J. F unt. Pr o gr am. , 15(2):129, 2005. [4℄ R. M. Amadio and L. Cardelli. Subt yping reursiv e t yp es. A CM TOPLAS , 15(4):575631, 1993. [5℄ S. Bark er and P . J. Stu k ey . Flexible aess on trol p oliy sp eiation with onstrain t logi program- ming. A CM T r ans. Inf. Syst. Se ur. , 6(4):501546, 2003. [6℄ W. E. Bo eb ert and R. Y. Kain. A pratial alternativ e to hierar hial in tegrit y p oliies. In CSS '85 , 1985. [7℄ C. Braghin, D. Gorla, and V. Sassone. A distributed alulus for role-based aess on trol. In CSFW , pages 4860, 2004. [8℄ M. Brandt and F. Henglein. Coindutiv e axiomatization of reursiv e t yp e equalit y and subt yping. F un- dam. Inf. , 33(4):309338, 1998. [9℄ S. Chong and A. C. My ers. Seurit y p oliies for do wngrading. In CCS '04 , pages 198209, 2004. [10℄ A. Compagnoni, P . Garralda, and E. Gun ter. Role-based aess on trol in a mobile en vironmen t. In Symp osium on T rustworthy Glob al Computing , 2005. [11℄ D. F. F erraiolo, D. R. Kuhn, and R. Chandramouli. R ole-Base d A ess Contr ol . Computer Seurit y Series. Arte h House, 2003. [12℄ D. F. F erraiolo, R. Sandh u, S. Ga vrila, D. R. Kuhn, and R. Chandramouli. Prop osed NIST standard for role-based aess on trol. A CM T r ans. Inf. Syst. Se ur. , 4(3):224274, 2001. λ - RBAC : PR OGRAMMING WITH R OLE-BASED A CCESS CONTR OL 25 [13℄ J. Homan. Implemen ting RBA C on a t yp e enfored system. In Computer Se urity Appli ations (A C- SA C '97) , pages 158163, 1997. [14℄ R. Jagadeesan, A. Jerey , C. Pit her, and J. Riely . λ -RBA C: Programming with role-based aess on trol. In ICALP '06 , v olume 4052 of L e tur e Notes in Computer Sien e , pages 456467. Springer, 2006. [15℄ S. Ja jo dia, P . Samarati, M. L. Sapino, and V. S. Subrahmanian. Flexible supp ort for m ultiple aess on trol p oliies. A CM T r ans. Datab ase Syst. , 26(2):214260, 2001. [16℄ J. Ligatti, L. Bauer, and D. W alk er. Edit automata: enforemen t me hanisms for run-time seurit y p oliies. Int. J. Inf. Se . , 4(1-2):216, 2005. [17℄ P . A. Loso o and S. D. Smalley . Meeting ritial seurit y ob jetiv es with Seurit y-Enhaned Lin ux. In Ottawa Linux Symp osium , 2001. [18℄ S. Malhotra. Mir osoft .NET F r amework Se urity . Premier Press, 2002. [19℄ J. C. Mit hell. Programming language metho ds in omputer seurit y . In POPL '01 , pages 126, 2001. [20℄ A. C. My ers, A. Sab elfeld, and S. Zdanewi. Enforing robust delassiation. In CSFW , pages 172 186, 2004. [21℄ S. Osb orn, R. Sandh u, and Q. Muna w er. Conguring role-based aess on trol to enfore mandatory and disretionary aess on trol p oliies. A CM T r ans. Inf. Syst. Se ur. , 3(2):85106, 2000. [22℄ J. S. P ark, R. S. Sandh u, and G.-J. Ahn. Role-based aess on trol on the w eb. A CM T r ans. Inf. Syst. Se ur. , 4(1):3771, 2001. [23℄ B. Piere. T yp es and Pr o gr amming L anguages . MIT Press, 2002. [24℄ A. Sab elfeld and A. C. My ers. Language-based information-o w seurit y . IEEE J. Sele te d A r e as in Communi ations , 21(1):519, Jan. 2003. [25℄ A. Sab elfeld and A. C. My ers. A mo del for delimited information release. In ISSS , pages 174191, 2003. [26℄ R. Sandh u, E. Co yne, H. F einstein, and C. Y ouman. Role-based aess on trol mo dels. IEEE Computer , 29(2), 1996. [27℄ F. B. S hneider, G. Morrisett, and R. Harp er. A language-based approa h to seurit y . In Informatis 10 Y e ars Bak, 10 Y e ars A he ad , v olume 2000 of LNCS , pages 86101, 2000. [28℄ F. Siew e, A. Cau, and H. Zedan. A omp ositional framew ork for aess on trol p oliies enforemen t. In FMSE '03 , pages 3242, 2003. [29℄ E. G. Sirer and K. W ang. An aess on trol language for w eb servies. In SA CMA T '02 , pages 2330, 2002. [30℄ S. T se and S. Zdanewi. T ranslating dep endeny in to parametriit y . In ICFP , pages 115125, 2004. [31℄ K. M. W alk er, D. F. Sterne, M. L. Badger, M. J. P etk a, D. L. Shermann, and K. A. Oostendorp. Conning ro ot programs with Domain and Typ e Enforemen t (DTE). In USENIX Se urity Symp osium , 1996. This wo rk is licensed under the Cr eative Commons Attribution- NoDerivs Lice nse . T o view a copy of this license, v isit http://reative o mm on s. org /l i en se s/b y- nd /2 .0 / or send a letter to Creative Commons , 559 Natha n Abbo tt Wa y , Stanford, Calif or nia 94 305, USA.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment