INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.

Slides:



Advertisements
Similar presentations
Chapter 23 Database Security and Authorization Copyright © 2004 Pearson Education, Inc.
Advertisements

II.I Selected Database Issues: 1 - SecuritySlide 1/20 II. Selected Database Issues Part 1: Security Lecture 2 Lecturer: Chris Clack 3C13/D6.
Access Control Chapter 3 Part 3 Pages 209 to 227.
The twenty-four/seven database Oracle Database Security David Yahalom Senior database consultant
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
Access Control Methodologies
Database Management System
Security Issues and Challenges in Cloud Computing
Security Dale-Marie Wilson, Ph.D.. Why Database Security? Data Valuable resource Must be strictly controlled and managed Corporate resource Have strategic.
Chapter 8 Security Transparencies © Pearson Education Limited 1995, 2005.
Chapter 19 Security.
DATABASE SECURITY By Oscar Suciadi CS 157B Prof. Sin-Min Lee.
Computer Security Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Information Security Technological Security Implementation and Privacy Protection.
ISOM MIS3150 Data and Info Mgmt Database Security Arijit Sengupta.
.Net Security and Performance -has security slowed down the application By Krishnan Ganesh Madras.
Jim McLeod MyDBA  SQL Server Performance Tuning Consultant with MyDBA  Microsoft Certified Trainer with SQLskills Australia 
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
SEC835 Practical aspects of security implementation Part 1.
Encryption Questions answered in this lecture: How does encryption provide privacy? How does encryption provide authentication? What is public key encryption?
Lifecycle Metadata for Digital Objects October 18, 2004 Transfer / Authenticity Metadata.
CSCI 3140 Module 6 – Database Security Theodore Chiasson Dalhousie University.
File System Security Robert “Bobby” Roy And Chris “Sparky” Arnold.
Database Security Tampere University of Technology, Introduction to Databases. Oleg Esin.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Deck 10 Accounting Information Systems Romney and Steinbart Linda Batch March 2012.
© Copyright 2009 SSLPost 01. © Copyright 2009 SSLPost 02 a recipient is sent an encrypted that contains data specific to that recipient the data.
CPS Computer Security Tutorial on Creating Certificates SSH Kerberos CPS 290Page 1.
 Encryption provides confidentiality  Information is unreadable to anyone without knowledge of the key  Hashing provides integrity  Verify the integrity.
Web Database Security Session 12 & 13 Matakuliah: Web Database Tahun: 2008.
Database Security. Introduction to Database Security Issues (1) Threats to databases Loss of integrity Loss of availability Loss of confidentiality To.
Slide Set #24: Database security SY306 Web and Databases for Cyber Operations.
Database Management Systems, 3ed, R. Ramakrishnan and J. Gehrke1 Database architecture and security Workshop 4.
PRESENTED BY Raju. What is information security?  Information security is the process of protecting information. It protects its availability, privacy.
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.
CCT396, Fall 2011 Database Design and Implementation Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
CCT395, Week 12 Storage, Grid Computing, Review This presentation is licensed under Creative Commons Attribution License, v To view a copy of this.
CCT395, Week 6 Implementing a Database with SQL and a Case Study Exercise This presentation is licensed under Creative Commons Attribution License, v.
INF1343, Winter 2011 Data Modeling and Database Design Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under.
INF1343, Winter 2011 Data Modeling and Database Design Yuri Takhteyev University of Toronto This presentation is licensed under Creative Commons Attribution.
8 – Protecting Data and Security
Database System Implementation CSE 507
Key management issues in PGP
Web Applications Security Cryptography 1
Security Using Armstrong Numbers and Authentication using Colors
Review Databases and Objects
Hash Functions Which of these problems is easier to solve:
Tutorial on Creating Certificates SSH Kerberos
Database Security and Authorization
Special Topics in CCIT: Databases
Security and Administration Transparencies
By Oscar Suciadi CS 157B Prof. Sin-Min Lee
SECURITY in IT ~Shikhar Agarwal.
Data Modeling and Database Design
Data Modeling and Database Design INF1343, Winter 2012 Yuri Takhteyev
Database Design and Implementation
Tutorial on Creating Certificates SSH Kerberos
Audit Findings: SQL Database
By Oscar Suciadi CS 157B Prof. Sin-Min Lee
PHP: Security issues FdSc Module 109 Server side scripting and
An Introduction to Web Application Security
Security.
Lecture 4 - Cryptography
Engineering Secure Software
By Oscar Suciadi CS 157B Prof. Sin-Min Lee
Implementation of security elements in database
Presentation transcript:

INF1343, Winter 2012 Data Modeling and Database Design Yuri Takhteyev Faculty of Information University of Toronto This presentation is licensed under Creative Commons Attribution License, v To view a copy of this license, visit This presentation incorporates images from the Crystal Clear icon collection by Everaldo Coelho, available under LGPL from

Week 11 Database Security

Final Project Implementation plan for unexpected problems the database is what matters most backup your stuff test! Documentation update the ER in the end include all SQL (even if it doesn't work) explain what is not obvious design explain non-obvious testing steps Questions?

Security Confidentiality / secrecy: Preventing unwanted disclosure Integrity Preventing unwanted modification Availability Preventing disruption or loss (Consider the interrelation between the three.)

Threats Attacks Profit Revenge/terrorism Lulz Mistakes / accidents / oversights Outsiders vs insiders Insiders are armed with internal knowledge. Consider “social engineering”.

Cryptography Encryption makes text unreadable without a key Digital Signature a “stamp of approval” for text Hash / digest identifies text without revealing it’s content

Encryption Symmetric Cyphers same key for encryption and decryption e.g.: AES Public Key / Private Key a public key for encryption, a private key for decryption

AES in MySQL create table user ( username varchar(100), ccnumber varbinary(32) ); insert into user values ("bob", aes_encrypt(" ", "May the Force be with you!")); select aes_decrypt(ccnumber, "May the Force be with you!") from user;

Access Control Define who can do/see what 1. Identifying users Passwords + other mechanisms Users can be assigned to groups/roles 2. Determining rights Grant/deny rights to specific data/operations Could be done at the level of group/role

SQL Privileges grant «privilege» on «object» to «user»; grant select on secretdb.* to okenobi; grant select on secretdb.* to okenobi with grant option;

“Flushing” Privileges flush privileges;

SQL Privileges revoke «privilege» on «object» from «user»; revoke select on secretdb.* from okenobi; Also (not in MySQL): revoke select on secretdb.* from okenobi cascade;

SQL Privileges Variations: grant select on secretdb.alpha to okenobi; The user can see table “alpha” but not the other tables.

Roles More flexible: create role student; grant select on secretdb.* to student; grant student to okenobi; (Not available in MySQL.)

Using Views create table true_omega (boring TEXT, scary TEXT); create view omega as select boring from true_omega; grant all on secretdb.omega to okenobi; The user can now see and modify the values in “boring” but not in “scary”.

Using Views create view omega as select boring from true_omega where scary is null; grant all on secretdb.omega to okenobi; The user can now see and modify the values in “boring” but only for those roles for where “scary” is not set.

Limitations Somewhat inflexible 1000 employees = 1000 views? Solution: “fine-grained access control” Discretionary Can be bypassed by users with access: Obvious: “with grant option” Less obvious: users with clearance can copy sensitive data into tables accessible to users without clearance Solution: “mandatory access control” i.e., a centrally enforced row-level policy

Creating Users create user alice; set password for alice = password('bob'); You can now login as 'alice' with password 'bob': mysql -p -u alice BTW, to change your own password: set password = password('newpass');

Storing User Data use mysql; select User, Password from user where User="alice"; You don't have access to database “mysql,” but here is what I get to see: | User | Password | | alice | *61584B76F6ECE8FB9A328E7CF198094B2FAC55C7 | row in set (0.00 sec)

Hashing Passwords set password for alice = password('bob'); Compare with: select password('bob'); Select sha1('bob');

Hashing Passwords A “one-way” function bob → 61584B76F6ECE8FB9A328E7CF198094B2FAC55C7 Easily calculated B76F6ECE8FB9A328E7CF198094B2FAC55C7 → bob Very hard to calculate (in theory). How hard is “very hard”? MD5: a few seconds SHA1/2: 1 hour + $2 SHA3: hopefully centuries

Password Attacks A brute-force attack Just try all possible combinations 5 lower case letters: 12 million combinations 5 letters / numbers: ~ 1 billion 8 letters / numbers: > 200 trillion A dictionary attack Check passwords based on words Matching passwords to accounts Who uses “123456” as their password?

Password Trilemma Pick a simple one Might be guessed or brute-forced Write it down Might be found Forget it later Need a procedure for recovery

Password Theft Stored passwords Paper, accounts, files Insecure transmission “Sniffing”, “key-loggers” Get a user to reveal the password Phishing, social engineering

Password Alternatives Public key cryptography Authentication without revealing any secrets A pair of keys (long numbers): A public key for encoding A private key for decoding RSA SecurID: image source:

Network Linux 1 MySQL Linux 2 Apache Unknown Machine

Web App Accounts Create a table for user accounts: usernames hashed passwords never store actual passwords! Authenticate the user with a query select * from users where username="%s" AND password="%s"; Proceed if successful Give the user a token for the future, e.g. as a “cookie” cookies can be stolen (unless encrypted w/ SSL)

The Accounts MySQL accounts to access the database (from an authorized machine) Machine accounts to access a machine (from within the network) Application accounts your users, e.g. bank clients

Gawker Media Hacked by “Gnosis” in million accounts stolen. 300,000 weakly hashed passwords released. (Most common ones: “12345”, “password”) The scenario: hacked → access to chat logs chat → → sysadmin passwords → access to servers → → root access (unpatched OS) → → MySQL access → → MySQL data, including passwords → → Twitter logins, etc. → Twitter spam

SQL Injection Did you really name your son Robert'); DROP TABLE Students;--? Image source: XKCD,

Anonymous vs HBGary (An SQL injection.)

Cablegate 260,000 “cables” “I would come in with music on a CD- RW labelled with something like ‘Lady Gaga’… erase the music … then write a compressed split file. No one suspected a thing … [I] listened and lip-synched to Lady Gaga’s Telephone while exfiltrating possibly the largest data spillage in American history.” Solutions?

Physical Attack (Also: accidents, natural disasters, hardware failure, file corruption.)

Backup mysqldump mysqldump -u okenobi -p starwars > starwars.sql mysql < starwars.sql (Add “create database starwars; use starwars;”) hot backup replication off-site copies

RAID combining disks for reliability and/or performance

Cloud Storage E.g., Amazon S3 (

Questions?