Database Security CS461/ECE422 Spring 2012 Overview - - PowerPoint PPT Presentation

database security
SMART_READER_LITE
LIVE PREVIEW

Database Security CS461/ECE422 Spring 2012 Overview - - PowerPoint PPT Presentation

Database Security CS461/ECE422 Spring 2012 Overview Database model RelaAonal Databases Access Control Inference and StaAsAcal Databases Database


slide-1
SLIDE 1

Database ¡Security ¡

CS461/ECE422 ¡ Spring ¡2012 ¡

slide-2
SLIDE 2

Overview ¡

  • Database ¡model ¡

– RelaAonal ¡Databases ¡

  • Access ¡Control ¡
  • Inference ¡and ¡StaAsAcal ¡Databases ¡
  • Database ¡encrypAon ¡
slide-3
SLIDE 3

Reading ¡Material ¡

  • Chapter ¡5 ¡of ¡the ¡text ¡
slide-4
SLIDE 4

4 ¡

MoAvaAon ¡

  • Databases ¡are ¡a ¡common ¡element ¡in ¡today's ¡

system ¡architecture ¡

  • Hold ¡important ¡informaAon ¡

– Target ¡of ¡aLacks ¡ ¡

slide-5
SLIDE 5

5 ¡

Database ¡Advantages ¡

  • Years ¡and ¡years ¡of ¡technology ¡improvements ¡

– Data ¡integrity ¡and ¡consistency ¡

– ACID ¡transacAons ¡

– Decent ¡performance ¡in ¡face ¡of ¡integrity ¡and ¡ consistency ¡requirements ¡

  • Common ¡well ¡understood ¡model ¡

– Shared ¡access ¡ – Controlled ¡access ¡

slide-6
SLIDE 6

6 ¡

RelaAonal ¡Model ¡

  • InformaAon ¡stored ¡in ¡relaAons ¡or ¡tables ¡

– Each ¡row ¡is ¡a ¡tuple ¡of ¡aLributes ¡ – Manipulated ¡by ¡standard ¡SQL ¡language ¡

¡

Name UID College GPA Financial Aid Alice 1232 Eng 4 Bob 3234 Eng 1.2 $5,000.00 Carol 4565 Bus 3.8 Dave 8988 Edu 2.1 Ellen 3234 ACES 3.1 $100.00 Alice 4534 LAS 2.9 $10,000.00

slide-7
SLIDE 7

7 ¡

Making ¡Queries ¡

  • Can ¡select ¡rows ¡to ¡create ¡subtables ¡ ¡

– Select Name, UID, Financial Aid from Students where College = 'Eng'

Name UID College GPA Financial Aid Alice 1232 Eng 4 Bob 3234 Eng 1.2 $5,000.00 Carol 4565 Bus 3.8 Dave 8988 Edu 2.1 Ellen 3234 ACES 3.1 $100.00 Alice 4534 LAS 2.9 $10,000.00 Name UID Financial Aid Alice 1232 Bob 3234 $5,000.00

slide-8
SLIDE 8

8 ¡

Combining ¡tables ¡

  • Can ¡use ¡Join ¡to ¡create ¡single ¡set ¡of ¡tuples ¡from ¡mulAple ¡tables. ¡

select A.name, B.Dorm, A.Major from A, B where A.UID = B.UID;

Name UID Major Alice 1234 ECE Bob 2345 NUC Carol 3456 BA Dave 4567 French UID Dorm 1234 LAR 2345 ISR 3456 FAR 4567 PAR Name Dorm Major Alice LAR ECE Bob ISR NUC Carol FAR BA Dave PAR French

A ¡ B ¡

slide-9
SLIDE 9

Database ¡Access ¡Control ¡

  • In ¡most ¡OS ¡access ¡control, ¡subjects ¡are ¡users, ¡

and ¡objects ¡are ¡files ¡(and ¡file-­‑like ¡objects) ¡

  • In ¡databases, ¡what ¡should ¡the ¡objects ¡be? ¡
slide-10
SLIDE 10

10 ¡

SQL ¡grant ¡Syntax ¡

  • grant privilege_list on resource

to user_list;

  • Privileges ¡include ¡select, ¡insert, ¡etc. ¡
  • Resource ¡may ¡be ¡a ¡table, ¡a ¡database, ¡a ¡

funcAon, ¡etc. ¡

  • User ¡list ¡may ¡be ¡individual ¡users, ¡or ¡may ¡be ¡a ¡

user ¡group ¡

Griffiths Wade 76

slide-11
SLIDE 11

11 ¡

Example ¡ApplicaAon ¡

  • Alice ¡owns ¡a ¡database ¡table ¡of ¡company ¡

employees: ¡ name varchar(50), ssn int, salary int, email varchar(50)

  • Some ¡informaAon ¡(ssn, ¡salary) ¡should ¡be ¡

confidenAal, ¡others ¡can ¡be ¡viewed ¡by ¡any ¡

  • employee. ¡
slide-12
SLIDE 12

12 ¡

Simple ¡Access ¡Control ¡Rules ¡

  • Suppose ¡Bob ¡needs ¡access ¡to ¡the ¡whole ¡table ¡(but ¡

doesn’t ¡need ¡to ¡make ¡changes): ¡

grant select on employee to bob;

  • Suppose ¡Carol ¡is ¡another ¡employee, ¡who ¡should ¡only ¡

access ¡public ¡informaAon: ¡

grant select(name,email) on employee to carol; – not ¡implemented ¡in ¡PostgreSQL ¡(see ¡next ¡two ¡slides ¡for ¡how ¡ to ¡work ¡around ¡this) ¡ – not ¡implemented ¡for ¡select ¡in ¡Oracle ¡ – implemented ¡in ¡MySQL ¡

slide-13
SLIDE 13

13 ¡

CreaAng ¡Views ¡

  • Careful ¡with ¡definiAons! ¡

– A ¡subset ¡of ¡the ¡database ¡to ¡which ¡a ¡user ¡has ¡ access, ¡or: ¡ – A ¡virtual ¡table ¡created ¡as ¡a ¡“shortcut” ¡query ¡of ¡

  • ther ¡tables ¡
  • View ¡syntax: ¡

create view view_name as query_definition;

  • Querying ¡views ¡is ¡nearly ¡idenAcal ¡to ¡querying ¡

regular ¡tables ¡

slide-14
SLIDE 14

14 ¡

View-­‑Based ¡Access ¡Control ¡

  • AlternaAve ¡method ¡to ¡grant ¡Carol ¡access ¡to ¡

name ¡and ¡email ¡columns: ¡ create view employee_public as select name,email from employee; grant select on employee_public to carol;

slide-15
SLIDE 15

15 ¡

Row-­‑Level ¡Access ¡Control ¡

  • Suppose ¡we ¡also ¡allow ¡employees ¡to ¡view ¡their ¡own ¡

ssn, ¡salary: ¡

create view employee_Carol as select * from employee where name='Carol'; grant select on employee_Carol to carol;

  • And ¡we ¡allow ¡them ¡to ¡update ¡their ¡e-­‑mail ¡addresses: ¡

grant update(email) on employee_Carol to carol; – (Or ¡create ¡yet ¡another ¡new ¡view…) ¡

slide-16
SLIDE 16

16 ¡

DelegaAng ¡Policy ¡Authority ¡

  • grant privilege_list on resource to

user_list with grant option;

  • Allows ¡other ¡users ¡to ¡grant ¡privileges, ¡including ¡“with ¡

grant ¡opAon” ¡privileges ¡

  • Like ¡“Copy ¡right” ¡from ¡Access ¡Control ¡lecture ¡ ¡
  • Can ¡grant ¡subset ¡privileges ¡too ¡

– Alice: ¡ ¡grant select on table1 to bob with grant option; – Bob: ¡ ¡grant select(column1) on table1 to carol with grant option;

slide-17
SLIDE 17

17 ¡

SQL ¡revoke ¡Syntax ¡

  • revoke privilege_list on

resource from user_list;

  • What ¡happens ¡when ¡a ¡user ¡is ¡granted ¡access ¡

from ¡two ¡different ¡sources, ¡and ¡one ¡is ¡ revoked? ¡

  • What ¡happens ¡when ¡a ¡“with ¡grant ¡opAon” ¡

privilege ¡is ¡revoked? ¡

slide-18
SLIDE 18

18 ¡

Revoke ¡Example ¡1 ¡

  • Alice ¡gives ¡Read, ¡Update, ¡Insert ¡privileges ¡to ¡

Bob ¡for ¡table ¡X ¡

  • Carol ¡gives ¡Read, ¡Update ¡privileges ¡to ¡Bob ¡

for ¡table ¡X ¡

  • Alice ¡revokes ¡Read, ¡Update, ¡Insert ¡privileges ¡

from ¡Bob ¡for ¡table ¡X ¡

  • What ¡privileges ¡should ¡Bob ¡now ¡have ¡on ¡

table ¡X? ¡

slide-19
SLIDE 19

19 ¡

Revoke ¡Example ¡2 ¡

  • Alice ¡gives ¡Read, ¡Update, ¡Insert ¡privileges ¡to ¡

Bob ¡for ¡table ¡X ¡with ¡Grant ¡opAon ¡

  • Bob ¡gives ¡Read, ¡Update ¡privileges ¡to ¡Carol ¡

for ¡table ¡X ¡

  • Alice ¡revokes ¡all ¡privileges ¡from ¡Bob ¡for ¡

table ¡X ¡

  • What ¡privileges ¡should ¡Bob ¡have ¡on ¡table ¡X? ¡
  • What ¡privileges ¡should ¡Carol ¡have ¡on ¡table ¡

X? ¡

slide-20
SLIDE 20

20 ¡

Revoke ¡Example ¡3 ¡

  • Alice ¡gives ¡Read, ¡Update, ¡Insert ¡privileges ¡to ¡

Bob ¡for ¡table ¡X ¡with ¡Grant ¡opAon ¡

  • Bob ¡gives ¡Read, ¡Update ¡privileges ¡to ¡Carol ¡

for ¡table ¡X ¡with ¡Grant ¡opAon ¡

  • Carol ¡gives ¡Read, ¡Update ¡privileges ¡to ¡Bob ¡

for ¡table ¡X ¡

  • Alice ¡revokes ¡all ¡privileges ¡from ¡Bob ¡for ¡

table ¡X ¡

  • What ¡privileges ¡do ¡Bob ¡and ¡Carol ¡have ¡now? ¡
slide-21
SLIDE 21

21 ¡

Disadvantages ¡to ¡SQL ¡Model ¡

  • Too ¡many ¡views ¡to ¡create ¡

– Tedious ¡for ¡many ¡users, ¡each ¡with ¡their ¡own ¡view ¡ – View ¡redefiniAons ¡that ¡change ¡the ¡view ¡schema ¡ require ¡dropping ¡the ¡view, ¡redefining, ¡then ¡ reissuing ¡privileges ¡ – Fine-­‑grained ¡policies ¡each ¡require ¡their ¡own ¡view— ¡ and ¡no ¡obvious ¡way ¡to ¡see ¡that ¡the ¡views ¡come ¡ from ¡the ¡same ¡table ¡

  • ApplicaAons ¡ooen ¡use ¡one ¡user ¡and ¡implement ¡
  • wn ¡access ¡control ¡
  • Other ¡techniques ¡being ¡developed ¡but ¡not ¡yet ¡

widely ¡deployed ¡

slide-22
SLIDE 22

StaAsAcal ¡Access ¡

  • Access ¡given ¡to ¡aggregate ¡funcAons ¡only ¡

– count, ¡sum, ¡min, ¡max, ¡avg, ¡… ¡ – select ¡avg(gpa) ¡ ¡from ¡students ¡where ¡ student.department ¡= ¡“ECE”; ¡ – select ¡count(*) ¡from ¡students ¡where ¡gpa ¡> ¡3.5; ¡

  • Inference ¡

– Use ¡aggregate ¡values ¡to ¡deduce ¡sensiAve ¡ informaAon ¡

slide-23
SLIDE 23

Exercise ¡1 ¡

  • How ¡can ¡we ¡use ¡staAsAcal ¡funcAons ¡to ¡infer ¡

sensiAve ¡(user-­‑specific ¡values)? ¡ ¡

Name UID College GPA Financial Aid Alice 1232 Eng 4 Bob 3234 Eng 1.2 $5,000.00 Carol 4565 Bus 3.8 Dave 8988 Edu 2.1 Ellen 3234 ACES 3.1 $100.00 Alice 4534 LAS 2.9 $10,000.00

slide-24
SLIDE 24

Examples ¡

  • Too-­‑specific ¡query ¡

– select ¡avg(gpa) ¡from ¡students ¡where ¡ student.name ¡= ¡“Carol”; ¡

  • NegaAve ¡result ¡

– select ¡count(*) ¡from ¡students ¡where ¡college ¡= ¡ ‘Edu’ ¡and ¡gpa ¡> ¡3.0 ¡=> ¡0; ¡

Name UID College GPA Financial Aid Alice 1232 Eng 4 Bob 3234 Eng 1.2 $5,000.00 Carol 4565 Bus 3.8 Dave 8988 Edu 2.1 Ellen 3234 ACES 3.1 $100.00 Alice 4534 LAS 2.9 $10,000.00

slide-25
SLIDE 25

Constraint ¡

  • Refuse ¡to ¡return ¡results ¡from ¡queries ¡that ¡include ¡

too ¡few ¡(<k) ¡rows ¡

  • Exercise: ¡find ¡out ¡Bob’s ¡GPA ¡if ¡k ¡= ¡3 ¡
  • Select ¡avg(financialaid) ¡from ¡students ¡where ¡

college ¡= ¡“Eng” ¡or ¡college ¡= ¡“Edu” ¡and ¡(name ¡!= ¡ “Bob” ¡OR ¡gpa ¡> ¡2.0); ¡

Name UID College GPA Financial Aid Alice 1232 Eng 4 Bob 3234 Eng 1.2 $5,000.00 Carol 4565 Bus 3.8 Dave 8988 Edu 2.1 Ellen 3234 ACES 3.1 $100.00 Alice 4534 LAS 2.9 $10,000.00

slide-26
SLIDE 26

Other ¡possible ¡controls ¡

  • Return ¡imprecise ¡results ¡

– Perturb ¡individual ¡data ¡ – Perturb ¡results ¡ – Return ¡result ¡on ¡random ¡sample ¡

  • Hard ¡to ¡get ¡right, ¡see ¡work ¡on ¡DifferenAal ¡

Privacy ¡for ¡state ¡of ¡the ¡art ¡

slide-27
SLIDE 27

Key ¡Points ¡

  • Database ¡has ¡good ¡ ¡integrity ¡features ¡
  • Fine ¡grained ¡access ¡control ¡implemented ¡in ¡

most ¡DB ¡systems ¡

– Not ¡always ¡taken ¡advantage ¡of ¡

  • It ¡is ¡difficult ¡to ¡block ¡inferences ¡