Access Control CS461/ECE422 Spring 2012 Reading Material - - PowerPoint PPT Presentation
Access Control CS461/ECE422 Spring 2012 Reading Material - - PowerPoint PPT Presentation
Access Control CS461/ECE422 Spring 2012 Reading Material Chapter 4 through sec=on 4.5 Chapters 25 and 26 For the access control aspects of
Reading ¡Material ¡
- Chapter ¡4 ¡through ¡sec=on ¡4.5 ¡
- Chapters ¡25 ¡and ¡26 ¡
– For ¡the ¡access ¡control ¡aspects ¡of ¡Unix ¡and ¡ Windows ¡
Outline ¡
- Access ¡Control ¡Matrix ¡
- Access ¡Control ¡List ¡
- Capabili=es ¡
Access ¡Control ¡in ¡Context ¡
AAA ¡
- Access ¡control ¡part ¡of ¡a ¡broader ¡context ¡
- Authen=ca=on ¡
– Discussed ¡last ¡=me. ¡ ¡Bind ¡external ¡en=ty ¡to ¡ system ¡en=ty ¡
- Authoriza=on ¡
– Grant ¡a ¡right ¡or ¡permission ¡to ¡the ¡system ¡en=ty ¡to ¡ access ¡a ¡system ¡resource ¡
- Audit ¡
– Independent ¡review ¡of ¡system ¡ac=ons ¡
Types ¡of ¡Access ¡Control ¡Policies ¡
- Discre=onary ¡Access ¡Control ¡(DAC) ¡
– Decision ¡made ¡based ¡on ¡iden=ty ¡of ¡requestor ¡and ¡ access ¡rules ¡ – Regular ¡users ¡can ¡adjust ¡the ¡policy ¡
- Mandatory ¡Access ¡Control ¡(MAC) ¡
– Decision ¡made ¡by ¡tes=ng ¡labels ¡associated ¡with ¡ processes ¡and ¡resources ¡against ¡system ¡policy ¡rules ¡ – Regular ¡user ¡cannot ¡adjust ¡the ¡policy ¡
- Role ¡Based ¡Access ¡Control ¡(RBAC) ¡
– Access ¡decisions ¡defined ¡against ¡roles ¡rather ¡than ¡ individual ¡requestors ¡
Access ¡Control ¡Elements ¡
- Subject ¡– ¡system ¡en=ty ¡capable ¡of ¡access ¡objects. ¡
Generally ¡a ¡process ¡in ¡an ¡OS ¡context ¡
- Object ¡– ¡a ¡resource ¡in ¡a ¡system ¡
– OYen ¡a ¡file ¡ – Could ¡also ¡be ¡other ¡named ¡resources ¡like ¡mutex, ¡ process, ¡network ¡interface, ¡network ¡port ¡
- Access ¡right ¡– ¡a ¡way ¡that ¡a ¡subject ¡may ¡access ¡an ¡
- bject ¡in ¡the ¡system ¡
– Read, ¡Write, ¡Execute, ¡Delete, ¡Create, ¡Search, ¡Change ¡ Access, ¡Own ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 8 ¡
Access ¡Control ¡Matrix ¡
- Access ¡Matrix ¡or ¡Access ¡Control ¡Matrix ¡
(ACM) ¡and ¡related ¡concepts ¡provides ¡very ¡ basic ¡abstrac=on ¡
– Map ¡different ¡systems ¡to ¡a ¡common ¡form ¡for ¡ comparison ¡ – Enables ¡standard ¡proof ¡techniques ¡ – Not ¡directly ¡used ¡in ¡implementa=on ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 9 ¡
Defini=ons ¡
- Protec=on ¡state ¡of ¡system ¡
– Describes ¡current ¡se`ngs, ¡values ¡of ¡system ¡ relevant ¡to ¡protec=on ¡
- Access ¡control ¡matrix ¡
– Describes ¡protec=on ¡state ¡precisely ¡ – Matrix ¡describing ¡rights ¡of ¡subjects ¡ – State ¡transi=ons ¡change ¡elements ¡of ¡matrix ¡
Access ¡Matrix: ¡File ¡Example ¡
File ¡1 ¡ File ¡2 ¡ File3 ¡ File4 ¡ User ¡A ¡ Own ¡ Read ¡ Write ¡ Own ¡ Read ¡ Write ¡ User ¡B ¡ Read ¡ Own ¡ Read ¡ Write ¡ Write ¡ Read ¡ User ¡C ¡ Read ¡ Write ¡ Read ¡ Own ¡ Read ¡ Write ¡
Access ¡Matrix: ¡Broader ¡Example ¡
Subjects ¡ Files ¡ Processes ¡ Disks ¡ S1 ¡ S2 ¡ S3 ¡ F1 ¡ F2 ¡ P1 ¡ P2 ¡ D1 ¡ D2 ¡ S1 ¡
control ¡
- wner ¡
- wner ¡
control ¡ Read* ¡ Read ¡
- wner ¡
wakeup ¡ wakeup ¡ seek ¡
- wner ¡
S2 ¡
control ¡ Write* ¡ execute ¡
- wner ¡
Seek* ¡
S3 ¡
control ¡ write ¡ stop ¡
Media=on ¡Implementa=on ¡
Rules ¡Governing ¡Access ¡Matrix ¡Change ¡
Rule ¡ Command ¡(by ¡S0) ¡ AuthorizaCon ¡ OperaCon ¡ R1 ¡ Transfer ¡α ¡or ¡α* ¡to ¡S,X ¡ ‘α*’ ¡in ¡A[S0,X] ¡ Store ¡α ¡or ¡α* ¡in ¡A[S,X] ¡ R2 ¡ Grant ¡α ¡or ¡α* ¡to ¡S,X ¡ ‘owner’ ¡in ¡A[S0,X] ¡ Store ¡α ¡or ¡α* ¡in ¡A[S,X] ¡ R3 ¡ Delete ¡α ¡from ¡S,X ¡ ‘control’ ¡in ¡A[S0,S] ¡
- r ¡ ¡
‘owner’ ¡in ¡A[S0,X] ¡ Delete ¡α ¡from ¡A[S,X] ¡ R4 ¡ w ¡<-‑ ¡read ¡S,X ¡ ‘control’ ¡in ¡A[S0,S] ¡
- r ¡ ¡
‘owner’ ¡in ¡A[S0,X] ¡ Copy ¡A[S,X] ¡into ¡w ¡ R5 ¡ Create ¡object ¡X ¡ None ¡ Add ¡column ¡for ¡X ¡to ¡A; ¡ store ¡‘owner’ ¡in ¡A[S0,X] ¡ R6 ¡ Destroy ¡object ¡X ¡ ‘owner’ ¡in ¡A[S0,X] ¡ Delete ¡column ¡X ¡from ¡A ¡ R7 ¡ Create ¡subject ¡S ¡ None ¡ Add ¡row ¡for ¡S ¡to ¡A; ¡ execute ¡create ¡object ¡S; ¡ store ¡‘control’ ¡in ¡A[S,S] ¡ R8 ¡ Destroy ¡subject ¡S ¡ ‘owner’ ¡in ¡A[S0,S] ¡ Delete ¡row ¡for ¡S ¡from ¡A; ¡ execute ¡destroy ¡object ¡S ¡
Actually ¡Implemen=ng ¡Access ¡Matrix ¡
- Slice ¡by ¡column ¡
– Access ¡control ¡list ¡ – Used ¡by ¡Mul=cs ¡and ¡most ¡modern ¡OS ¡
- Slice ¡by ¡row ¡
– Capability ¡list ¡ – Many ¡implementa=ons ¡in ¡the ¡‘80’s ¡ ¡ – OYen ¡associated ¡with ¡object-‑oriented ¡systems ¡
Slice ¡and ¡Dice ¡File ¡example ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 16 ¡
Unix ¡Access ¡Control ¡
- Three ¡permission ¡octets ¡associated ¡with ¡each ¡
file ¡and ¡directory ¡
– Owner, ¡group, ¡and ¡other ¡ ¡ – Read, ¡write, ¡execute ¡
- For ¡each ¡file/directory ¡
– Can ¡specify ¡RWX ¡permissions ¡for ¡one ¡owner, ¡one ¡ group, ¡and ¡one ¡other ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 17 ¡
Windows ¡ACL ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 18 ¡
Windows ¡ACL ¡
- Actually ¡two ¡ACL's ¡per ¡file ¡
– System ¡ACL ¡(SACL) ¡– ¡controls ¡audi=ng ¡and ¡now ¡ integrity ¡controls ¡ – Discre=onary ¡ACL ¡(DACL) ¡– ¡controls ¡object ¡ access ¡
- Windows ¡ACLs ¡apply ¡to ¡all ¡named ¡objects ¡
– Files ¡ – Pipes ¡ – Events ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 19 ¡
ACL ¡Dis=nc=ons ¡
- What ¡subjects ¡can ¡modify ¡an ¡object's ¡ACL? ¡
- If ¡there ¡is ¡a ¡privileged ¡user, ¡do ¡the ¡ACLs ¡apply ¡
to ¡that ¡user? ¡
- Does ¡the ¡ACL ¡support ¡groups ¡or ¡wildcards? ¡
- How ¡are ¡contradictory ¡access ¡control ¡
permissions ¡handled? ¡
- If ¡a ¡default ¡permission ¡is ¡allowed, ¡do ¡the ¡ACL ¡
permissions ¡modify ¡it, ¡or ¡is ¡the ¡default ¡only ¡ used ¡when ¡the ¡subject ¡is ¡not ¡men=oned ¡in ¡the ¡ ACL? ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 20 ¡
ACL ¡Scaling ¡
- Groups ¡of ¡users ¡
- Role ¡Base ¡Access ¡Control ¡
– Users ¡can ¡take ¡on ¡role ¡at ¡a ¡=me ¡
- Directory ¡inheritance ¡
- Nega=ve ¡rights ¡
9/29/2010 ¡ Computer ¡Security ¡I ¡ 21 ¡
Revoking ¡rights ¡with ¡ACLs ¡
- Revoking ¡rights ¡for ¡subject ¡s ¡to ¡a ¡par=cular ¡
- bject ¡o ¡straighqorward ¡
– Remove ¡s ¡from ¡ ¡ACL(o) ¡ – Make ¡sure ¡s ¡has ¡a ¡nega=ve ¡entry ¡in ¡the ¡ACL(o) ¡
- Example: ¡Alice ¡removes ¡all ¡of ¡Bob's ¡rights ¡to ¡
file ¡f ¡
– What ¡if ¡Bob ¡had ¡given ¡Carol ¡read ¡rights ¡to ¡f? ¡ – Should ¡Carol ¡s=ll ¡have ¡those ¡rights? ¡
22 ¡
Capabili=es ¡
- Where ¡are ¡access ¡rights ¡stored ¡
– ACL: ¡Each ¡resource ¡(file) ¡has ¡an ¡access ¡list ¡ – Capabili=es: ¡Each ¡process ¡has ¡a ¡capability ¡list ¡(C-‑list) ¡
- Note: ¡In ¡capabili=es, ¡subjects ¡are ¡processes ¡ ¡
– In ¡ACLs, ¡subjects ¡are ¡users ¡(why?) ¡
- Capabili=es ¡act ¡as ¡a ¡=cket ¡
– Possession ¡of ¡capability ¡implies ¡access ¡rights ¡
- Tickets ¡must ¡be ¡unforgeable ¡
– Otherwise ¡access ¡control ¡fails ¡
23 ¡
Implementa=on ¡
- Tags ¡/ ¡descriptors ¡
- Cryptographic ¡=ckets ¡
- Type ¡system ¡
24 ¡
Tags ¡/ ¡descriptors ¡
- Each ¡process ¡has ¡a ¡list ¡of ¡=ckets ¡
– Tickets ¡stored ¡in ¡a ¡protected ¡segment ¡ – Programs ¡refer ¡to ¡=ckets ¡by ¡pointers ¡/ ¡indices ¡ – Opera=ng ¡system ¡can ¡add ¡/ ¡remove ¡=ckets ¡
- E.g. ¡CAP ¡system ¡
- E.g. ¡UNIX ¡file ¡descriptors ¡
– UNIX ¡access ¡control ¡a ¡hybrid ¡system: ¡use ¡ACLs ¡to ¡open ¡a ¡file ¡and ¡get ¡a ¡ file ¡descriptor, ¡then ¡use ¡fd ¡as ¡a ¡capability ¡ – More ¡efficient ¡since ¡only ¡have ¡to ¡check ¡permissions ¡on ¡open ¡
25 ¡
Cryptographic ¡=ckets ¡
- Cryptography ¡
– Associate ¡with ¡each ¡capability ¡a ¡cryptographic ¡checksum ¡enciphered ¡ using ¡a ¡key ¡known ¡to ¡OS ¡ – When ¡process ¡presents ¡capability, ¡OS ¡validates ¡checksum ¡ – Example: ¡Amoeba, ¡a ¡distributed ¡capability-‑based ¡system ¡
- Capability ¡is ¡(name, ¡crea)ng_server, ¡rights, ¡check_field) ¡and ¡is ¡given ¡to ¡
- wner ¡of ¡object ¡
- check_field ¡is ¡48-‑bit ¡random ¡number; ¡also ¡stored ¡in ¡table ¡corresponding ¡
to ¡crea)ng_server ¡
- To ¡validate, ¡system ¡compares ¡check_field ¡of ¡capability ¡with ¡that ¡stored ¡in ¡
crea)ng_server ¡table ¡
- Vulnerable ¡if ¡capability ¡disclosed ¡to ¡another ¡process ¡
26 ¡
Differences ¡
- Descriptors ¡-‑ ¡managed ¡by ¡the ¡opera=ng ¡
system ¡
- Crypto ¡=ckets ¡-‑ ¡managed ¡by ¡the ¡process ¡
- Copying ¡
– Descriptors ¡-‑ ¡possible ¡(e.g. ¡UNIX ¡fd ¡passing), ¡but ¡ regulated ¡by ¡the ¡OS ¡ – Tickets ¡-‑ ¡arbitrary ¡copying ¡possible ¡
27 ¡
Revoca=on ¡
- Scan ¡all ¡C-‑lists, ¡remove ¡relevant ¡capabili=es ¡
– Tags ¡/ ¡descriptors ¡-‑ ¡too ¡expensive ¡ – Crypto ¡=ckets ¡-‑ ¡impossible ¡
- Use ¡indirec=on ¡
– Each ¡object ¡has ¡entry ¡in ¡a ¡global ¡object ¡table ¡ – Names ¡in ¡capabili=es ¡name ¡the ¡entry, ¡not ¡the ¡object ¡
- To ¡revoke, ¡zap ¡the ¡entry ¡in ¡the ¡table ¡
– Example: ¡Amoeba: ¡owner ¡requests ¡server ¡change ¡random ¡number ¡in ¡ server ¡table ¡
- All ¡capabili=es ¡for ¡that ¡object ¡now ¡invalid ¡
– Can ¡have ¡mul=ple ¡entries ¡for ¡a ¡single ¡object ¡to ¡allow ¡control ¡of ¡ different ¡sets ¡of ¡rights ¡and/or ¡groups ¡of ¡users ¡for ¡each ¡object ¡
28 ¡
ACLs, ¡Capabili=es, ¡and ¡POLP ¡
- Principle ¡of ¡least ¡privilege ¡
– “subject ¡should ¡be ¡given ¡only ¡those ¡privileges ¡that ¡ it ¡needs ¡in ¡order ¡to ¡complete ¡the ¡task” ¡ – Granularity ¡of ¡subjects ¡controls ¡how ¡small ¡“least” ¡ is ¡
- Capabili=es ¡beser ¡enforce ¡least ¡privilege ¡
– Subjects ¡are ¡processes, ¡not ¡users, ¡can ¡be ¡more ¡ restric=ve ¡ – ACLs ¡with ¡roles ¡form ¡a ¡middle ¡ground ¡(next ¡ lecture) ¡
29 ¡
Least ¡privilege ¡example ¡
- Carol ¡wants ¡to ¡use ¡gcc ¡to ¡compile ¡her ¡file ¡
– gcc ¡may ¡(does) ¡have ¡bugs ¡in ¡it ¡
- ACLs: ¡gcc ¡runs ¡with ¡Carol’s ¡authority ¡
– Can ¡overwrite ¡any ¡of ¡Carol’s ¡files ¡
- Roles: ¡Carol ¡can ¡have ¡separate ¡roles ¡
– Mail ¡role, ¡development ¡role, ¡browsing ¡role ¡ – gcc ¡in ¡development ¡role ¡cannot ¡overwrite ¡other ¡files ¡
- Capabili=es ¡
– Carol ¡gives ¡gcc ¡capabili=es ¡to ¡read ¡(par=cular) ¡source ¡files, ¡write ¡ (par=cular) ¡object ¡files ¡ – All ¡other ¡files ¡are ¡safe ¡
30 ¡
cp ¡example ¡
- Consider ¡unix ¡command ¡‘cp’ ¡
– cp ¡file1 ¡file2 ¡
- What’s ¡the ¡least ¡authority ¡that ¡cp ¡needs ¡to ¡
run? ¡
– Read ¡and ¡write ¡any ¡file ¡the ¡user ¡owns ¡
- What ¡about ¡`cat’? ¡
– cat ¡< ¡file1 ¡> ¡file2 ¡ – file1 ¡and ¡file2 ¡passed ¡as ¡file ¡descriptors ¡
31 ¡
Confused ¡Deputy ¡Problem ¡
- Compila=on ¡costs ¡money ¡
– Compiler ¡writes ¡accoun=ng ¡informa=on ¡to ¡a ¡file ¡ called ¡“BILL” ¡ – Compiler ¡given ¡permission ¡to ¡write ¡to ¡“BILL” ¡
- Using ¡roles, ¡setuid, ¡… ¡
- Compiler ¡takes ¡an ¡op=onal ¡argument ¡with ¡a ¡
file ¡where ¡to ¡write ¡debugging ¡output ¡
– “gcc ¡-‑d ¡debugfile ¡foo.c” ¡
- User ¡runs: ¡“gcc ¡-‑d ¡BILL ¡foo.c” ¡
– Destroys ¡billing ¡informa=on ¡
32 ¡
What ¡went ¡wrong? ¡
- Compiler ¡given ¡authority ¡to ¡write ¡to ¡BILL ¡
– Used ¡it ¡for ¡the ¡wrong ¡purpose ¡
- How ¡to ¡solve? ¡
– In ¡UNIX, ¡access() ¡system ¡call ¡checks ¡permission ¡of ¡ caller ¡ – Awkward, ¡error-‑prone ¡
- Real ¡problem: ¡ambient ¡authority ¡
33 ¡
Ambient ¡Authority ¡
- Permission ¡checks ¡not ¡controlled ¡by ¡user ¡/ ¡
program ¡
– Authority ¡exercised ¡automa=cally ¡ – Doors ¡that ¡magically ¡recognize ¡users, ¡instead ¡of ¡ using ¡keys ¡
- ACLs ¡have ¡ambient ¡authority ¡
- Capability ¡systems ¡can ¡have ¡ambient ¡
authority, ¡most ¡don’t ¡
– POSIX ¡Capabili=es ¡an ¡excep=on ¡
34 ¡
Non-‑ambient ¡authority ¡
- User ¡/ ¡program ¡chooses ¡which ¡authority ¡to ¡
use ¡
- E.g. ¡billing ¡capability ¡
– open(“BILL”, ¡bill_cap) ¡ – open(debug_file, ¡debug_cap) ¡
- Will ¡fail ¡if ¡debug_file ¡== ¡“BILL” ¡
- Beser ¡yet, ¡combine ¡designa=on ¡and ¡authority ¡
35 ¡
Object ¡Capability ¡Systems ¡
class ¡Compiler ¡{ ¡ sta=c ¡private ¡File ¡billFile; ¡ public ¡void ¡compile(File ¡debugFile) ¡{ ¡ billFile.append(billing ¡entry); ¡ debugFile.write(debug ¡info); ¡ } ¡ } ¡
- Permissions ¡enforced ¡by ¡type ¡system ¡
– No ¡way ¡to ¡write ¡to ¡a ¡file ¡without ¡a ¡reference ¡
36 ¡
Object ¡Capability ¡Systems ¡
- Object ¡references ¡are ¡capabili=es ¡
– Requires ¡memory ¡safety ¡(why?) ¡ – Both ¡names ¡the ¡object ¡and ¡grants ¡access ¡
- Objects ¡are ¡accessed ¡through ¡methods ¡
– Methods ¡mediate ¡access ¡
- Execu=on ¡model ¡and ¡access ¡model ¡unified ¡
- Objects ¡are ¡subjects ¡as ¡well ¡
– Low ¡granularity ¡subjects ¡ – Dynamic ¡subject ¡crea=on ¡
37 ¡
Object ¡Proxies ¡
- Most ¡policies ¡enforced ¡by ¡proxy ¡object ¡
- E.g. ¡read-‑only ¡file ¡access ¡
class ¡ReadOnlyFile ¡{ ¡ ¡ ¡private ¡File ¡myFile; ¡ ¡ ¡public ¡ReadOnlyFile(File ¡f) ¡{ ¡ ¡ ¡myFile ¡= ¡f; ¡ ¡ ¡} ¡ ¡ ¡public ¡read() ¡{ ¡ ¡ ¡ ¡ ¡return ¡myFile.read() ¡ ¡ ¡} ¡ ¡ ¡public ¡write ¡() ¡{ ¡return ¡ERROR; ¡} ¡ } ¡
- Compiler.compile(ReadOnlyFile(sourceFile)) ¡
38 ¡
Revoca=on ¡
class ¡Caretaker ¡{ ¡ ¡ ¡Object ¡target; ¡ ¡ ¡ ¡ ¡ ¡public ¡Caretaker(Object ¡o) ¡{ ¡this.target ¡= ¡o; ¡} ¡ ¡ ¡class ¡Revocable ¡{ ¡ ¡ ¡ ¡ ¡match(verb, ¡args) ¡{ ¡call(target, ¡verb, ¡args); ¡} ¡ ¡ ¡} ¡ ¡ ¡revoke() ¡{ ¡target ¡= ¡null; ¡} ¡ ¡ ¡} ¡ }; ¡ ¡ Caretaker ¡caretaker(object); ¡ Bob.pass(caretaker.Revocable()); ¡ … ¡ caretaker.revoke(); ¡ ¡ ¡ ¡ ¡ ¡
39 ¡
ACLs ¡and ¡Capabili=es ¡
- ACLs: ¡Answer ¡to ¡“who ¡can ¡access ¡this ¡file” ¡
– Useful ¡when ¡formula=ng ¡policies ¡
- C-‑List: ¡Answer ¡to ¡“what ¡files ¡can ¡this ¡process ¡
access” ¡
– Useful ¡in ¡inves=ga=on ¡
- Object ¡capabili=es ¡don’t ¡answer ¡either ¡
ques=on, ¡but ¡integrate ¡authoriza=on ¡ decisions ¡in ¡the ¡design ¡
Key ¡Points ¡
- Access ¡control ¡part ¡of ¡broader ¡system ¡
- Access ¡Control ¡Matrix ¡or ¡Access ¡Matrix ¡
– Means ¡to ¡model ¡access ¡control ¡systems ¡
- Real ¡implementa=ons ¡