ahmed khaled hossam alaa mariam badr - cse.aucegypt.educsci253/presentations s12... · encrypting...

27
Ahmed Khaled Hossam Alaa Mariam Badr

Upload: others

Post on 11-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Ahmed Khaled Hossam Alaa Mariam Badr

Page 2: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only
Page 3: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Bank Accounts Credit Cards Information Applications users Licenses and certificates

Page 4: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Identity thefts Systems hacking Illegal transactions Most web and network applications are

vulnerable

Page 5: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Database itself Application Programs Database Management Server (DBMS) Network connected to Database Web Server connected to Database

Page 6: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only
Page 7: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Physical level Traditional lock-and-key security

Protection from floods, fire, etc. ▪ E.g. WTC (9/11), fires in IITM, WWW conf website, etc.

Protection from administrator error ▪ E.g. delete critical files

Solution ▪ Remote backup for disaster recovery

▪ Plus archival backup (e.g. DVDs/tapes)

Operating system level Protection from virus/worm attacks critical

Page 8: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

To encrypt the database at storage level, transparent to application

▪ Whole database/file/relation

▪ Unit of encryption: page

▪ Column encryption

Main issue: key management

▪ E.g. user provides decryption key (password) when database is started up

Supported by many database systems

▪ Standard practice now to encrypt credit card information, and other sensitive information

Page 9: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Encrypting at Application Layer Must do it at multiple locations from within app.

Data can only be used from within application

Encrypting at File System/Operating System

Layer less flexible. Requires you to encrypt everything. Performance degrades Weak for handling Disk Theft problem.

Encrypting within Database Usually, most practical option

Page 10: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Application Developers use a cryptographic library to encrypt such as Java Cryptographic Extensions (JCE) – set of APIs in the java.security and java.crypto packages

Page 11: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

SQL Server 2005 you can access Windows CryptoAPI through DB_ENCRYPT and

DB_DECRYPT within T-SQL (similar to PL/SQL)

Can use DES, Triple DES and AES (symmetric keys)

In ORACLE, you can access DBMS_OBFUSCATION_TOOLKIT package that

implements DES and Triple DES

Page 12: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

DB Encryption can be divided into Data-in-transit and Data-at-rest

Encryption is useful as a last layer of defense (defense in depth). Should never be used as an alternative solution

Encryption should be used only when needed

Key Management is Key

Page 13: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Network level: must use encryption to prevent

Eavesdropping: unauthorized reading of messages

Masquerading:

▪ pretending to be an authorized user or legitimate site, or

▪ sending messages supposedly from authorized users

Page 14: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

All information must be encrypted to prevent eavesdropping Public/private key encryption widely used

Must prevent person-in-the-middle attacks E.g. someone impersonates seller or bank/credit card

company and fools buyer into revealing information ▪ Encrypting messages alone doesn’t solve this problem

Page 15: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

One mechanism to allow specific users access only to required data

Password

Smartcards

Page 16: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Central authentication systems Allow users to be authenticated centrally

MS Active Directory often used for central authentication and user management in organizations

Single sign-on: authenticate once, and access

multiple applications without fresh authentication

Page 17: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Different authorizations for different users

Ensure that only authenticated users can

access the system And can access (read/update) only

data/interfaces that they are authorized to access

Page 18: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Application authenticates/authorizes users Application itself authenticates itself to

database

Database password

Database Application Program

Page 19: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only
Page 20: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Applications are the biggest source of insecurity

Poor coding of application may allow unauthorized access

The applications may be very big.

Page 21: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

E.g. application takes accnt_number as input from user and creates an SQL query as follows:

string query = "select balance

from account

where account_number =‘" + accnt_number +"‘ “

Page 22: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

select balance

from account

where account_number =‘123’

Page 23: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

What if I entered 022572636‘ or 1=1

Now its select balance

from account

where account_number =‘ 022572636‘

or 1=1

Page 24: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

http://www.example.com/index.php?id=123

Just add ‘

http://www.example.com/index.php?id=123’

Page 25: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

To prevent SQL injection attacks use prepared statements (instead of creating query strings from input parameters)

• use stored procedures

• use a function that removes special characters (such as quotes) from strings

Page 26: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Most security schemes address outsider attack Have password to DB? Okay, you can update

anything

Bypassing all security levels ▪ The more people have access, the more danger

The application program has the DB password Great deal of trust in people who manage databases

Page 27: Ahmed Khaled Hossam Alaa Mariam Badr - cse.aucegypt.educsci253/Presentations S12... · Encrypting at Application Layer Must do it at multiple locations from within app. Data can only

Chapter 8 of Database System Concepts 5th Edition, Silberschatz, Korth and Sudarshan, McGraw-Hill

The Open Web Application Security Project http://www.owasp.org

Web application security scanners e.g. WebInspect (SPI Dynamics) http://www.windowsecurity.com/software/Web-Application-Security/

SQL Injection http://www.cgisecurity.com/development/sql.shtml

9 ways to hack a web app http://developers.sun.com/learning/javaoneonline/2005/webtier/TS-5935.pdf

Related research papers Kabra, Ramamurthy and Sudarshan, Redundancy and Information Leakage in

Fine-Grained Access Control, SIGMOD 2006 Rizvi, Mendelzon, Sudarshan and Roy, Extending Query Rewriting Techniques

for Fine-Grained Access Control, SIGMOD 2004