Docsity

Security Issues in Database Systems - Lecture Slides | COP 4710, Study notes of Computer Science

Partial preview of the text

Download Security Issues in Database Systems - Lecture Slides | COP 4710 and more Study notes Computer Science in PDF only on Docsity!

Security Issues in Database

Systems

Introduction to DB Security

  • Secrecy: Users should not be able to see things

they are not supposed to.

  • E.g., A student can‟t see other students‟ grades.
  • Integrity: Users should not be able to modify

things they are not supposed to.

  • E.g., Only instructors can assign grades.
  • Availability: Users should be able to see and

modify things they are allowed to.

Discretionary Access Control

  • Based on the concept of access rights or privileges for objects (tables and views), and mechanisms for giving users privileges (and revoking privileges).
  • Creator of a table or a view automatically gets all privileges on it. - DMBS keeps track of who subsequently gains and loses privileges, and ensures that only requests from users who have the necessary privileges (at the time the request is issued) are allowed.

GRANT Command

  • The following privileges can be specified:  SELECT: Can read all columns (including those added later via ALTER TABLE command).  INSERT(col-name): Can insert tuples with non-null or non- default values in this column.  INSERT means same right with respect to all columns.  DELETE: Can delete tuples.  REFERENCES (col-name): Can define foreign keys (in other tables) that refer to this column.
  • If a user has a privilege with the GRANT OPTION, can pass privilege on to other users (with or without passing on the GRANT OPTION).
  • Only owner can execute CREATE, ALTER, and DROP.

GRANT privileges ON object TO users [WITH GRANT OPTION]

GRANT/REVOKE on Views

  • If the creator of a view loses the SELECT

privilege on an underlying table, the view is dropped!

  • If the creator of a view loses a privilege held

with the grant option on an underlying table, (s)he loses the privilege on the view as well; so do users who were granted that privilege on the view!

Views and Security

  • Views can be used to present necessary

information (or a summary), while hiding details in underlying relation(s).

  • Given ActiveSailors, but not Sailors or Reserves, we can find sailors who have a reservation, but not the

bid‟s of boats that have been reserved.

  • Creator of view has a privilege on the view if

(s)he has the privilege on all underlying tables.

  • Together with GRANT/REVOKE commands,

views are a very powerful access control tool.

Security to the Level of a Field!

  • Can create a view that only returns one field of one tuple. (How?)
  • Then grant access to that view accordingly.
  • Allows for arbitrary granularity of control, but:
    • Clumsy to specify, though this can be hidden under a good UI
    • Performance is unacceptable if we need to define field-granularity access frequently. (Too many view creations and look-ups.)

Internet-Oriented Security

  • Key Issues: User authentication and trust.
    • When DB must be accessed from a secure location, password- based schemes are usually adequate.
  • For access over an external network, trust is

hard to achieve.

  • If someone with Sam‟s credit card wants to buy from you, how can you be sure it is not someone who stole his card?
  • How can Sam be sure that the screen for entering his credit card information is indeed yours, and not some rogue site spoofing you (to steal such information)? How can he be sure that sensitive information is not “sniffed” while it is being sent over the network to you?
  • Encryption is a technique used to address these

issues.

RSA Public-Key Encryption

  • Let the data be an integer I
  • Choose a large (>> I) integer n = p * q
    • p, q are large, say 1024-bit, distinct prime numbers
  • Encryption: Choose a random number 1 < e < L that is relatively prime to (p-1) * (q-1) - Encrypted data S = I e^ mod L
  • Decryption key d: Chosen so that
    • d * e = 1 mod ((p-1) * (q-1))
    • We can then show that I = S d^ mod L
  • It turns out that the roles of e and d can be reversed; so they are simply called the public (e, L) and private keys (d, L)

Certifying Servers: SSL, SET

  • If Amazon distributes their public key, Sam’s browser will encrypt his order using it. - So, only Amazon can decipher the order, since no one else has Amazon‟s private key.
  • But how can Sam (or his browser) know that the public key for Amazon is genuine? The SSL protocol covers this. - Amazon contracts with, say, Verisign, to issue a certificate <Verisign, Amazon, amazon.com, public-key> - This certificate is stored in encrypted form, encrypted with Verisign‟s private key, known only to Verisign. - Verisign‟s public key is known to all browsers, which can therefore decrypt the certificate and obtain Amazon‟s public key, and be confident that it is genuine. - The browser then generates a temporary session key, encodes it using Amazon‟s public key, and sends it to Amazon. - All subsequent msgs between the browser and Amazon are encoded using symmetric encryption (e.g., DES), which is more efficient than public-key encryption.
  • What if Sam doesn’t trust Amazon with his credit card information? - Secure Electronic Transaction protocol: 3-way communication between Amazon, Sam, and a trusted server, e.g., Visa.

Public key digital signature schemes

16

Sender

Recipient KeyGen (SK, PK) 

m

m ^ Ver(m, PK,^ )^ ^ valid?

SK

Sign(m, SK)  

Insecure Channel

Statistical DB Security

  • Statistical DB: Contains information about individuals, but allows only aggregate queries (e.g., average age, rather than Joe’s age).
  • New problem: It may be possible to infer some secret information! - E.g., If I know Joe is the oldest sailor, I can ask “How many sailors are older than X?” for different values of X until I get the answer 1; this allows me to infer Joe‟s age.
  • Idea: Insist that each query must involve at least N rows, for some N. Will this work? (No!)

Summary

  • Three main security objectives: secrecy, integrity, availability.
  • DB admin is responsible for overall security.
    • Designs security policy, maintains an audit trail, or history of users‟ accesses to DB.
  • Two main approaches to DBMS security: discretionary and mandatory access control. - Discretionary control based on notion of privileges. - Mandatory control based on notion of security classes.
  • Statistical DBs try to protect individual data by supporting only aggregate queries, but often, individual information can be inferred.