SlideShare a Scribd company logo
Access Control
•A security policy specifies who is authorized to do what.
•™
A security mechanism allows us to enforce a chosen security
policy. ™
•Two main mechanisms at the DBMS level:
– Discretionary access control
– Mandatory access control
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. –
DBMS 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
Mandatory Access Control
 ™
Based on system-wide policies that cannot be changed by
individual users.
– Each DB object is assigned a security class.
– Each subject (user or user program) is assigned a clearance for a
security class.
– Rules based on security classes and clearances govern who can
read/write which objects. ™
 Most commercial systems do not support mandatory access
control. Versions of some DBMSs do support it; used for
specialized (e.g., military) applications.
Why Mandatory Control?
 ™
Discretionary control has some flaws, e.g., the Trojan horse
problem:
– Dick creates Horsie and gives INSERT privileges to Justin (who
doesn’t know about this).
– Dick modifies the code of an application program used by Justin
to additionally write some secret data to table Horsie.
– Now, Justin can see the secret info. ™
The modification of the code
is beyond the DBMSs control, but it can try and prevent the use
of the database as a channel for secret information.
Security and Authorization
 The data stored in the database need protection from
a. Unauthorized access
b. Malicious destruction or alteration
c. Accidental introduction of inconsistency that integrity
constraints provide
 Among the forms of malicious access are:
a. Unauthorized reading of data (theft of information)
b. Unauthorized modification of data
c. Unauthorized destruction of data
Security
 Security - protection from malicious attempts to steal or modify data.
 Database system level
 Authentication and authorization mechanisms to allow specific users
access only to required data
 We concentrate on authorization in the rest of this chapter
 Operating system level
 Operating system super-users can do anything they want to the
database! Good operating system level security is required.
 Network level: must use encryption to prevent
 Eavesdropping (unauthorized reading of messages)
 Masquerading (pretending to be an authorized user or sending
messages supposedly from authorized users)
Security (Cont.)
 Physical level
 Physical access to computers allows destruction of data by
intruders; traditional lock-and-key security is needed
 Computers must also be protected from floods, fire, etc.
 Human level
 Users must be screened to ensure that an authorized users do
not give access to intruders
 Users should be trained on password selection and secrecy
Authorization
Forms of authorization on parts of the database:
 Read authorization - allows reading, but not modification of data.
 Insert authorization - allows insertion of new data, but not
modification of existing data.
 Update authorization - allows modification, but not deletion of
data.
 Delete authorization - allows deletion of data
Authorization (Cont.)
Forms of authorization to modify the database schema:
 Index authorization - allows creation and deletion of indices.
 Resources authorization - allows creation of new relations.
 Alteration authorization - allows addition or deletion of attributes in
a relation.
 Drop authorization - allows deletion of relations.
Authorization and Views
 Users can be given authorization on views, without being given
any authorization on the relations used in the view definition
 Ability of views to hide data serves both to simplify usage of the
system and to enhance security by allowing users access only to
data they need for their job
 A combination of relational-level security and view-level security
can be used to limit a user’s access to precisely the data that
user needs.
View Example
 Suppose a bank clerk needs to know the names of the
customers of each branch, but is not authorized to see specific
loan information.
 Approach: Deny direct access to the loan relation, but grant access
to the view cust-loan, which consists only of the names of
customers and the branches at which they have a loan.
 The cust-loan view is defined in SQL as follows:
create view cust-loan as
select branch-name, customer-name
from borrower, loan
where borrower.loan-number = loan.loan-number
View Example (Cont.)
 The clerk is authorized to see the result of the query:
select *
from cust-loan
 When the query processor translates the result into a query on
the actual relations in the database, we obtain a query on
borrower and loan.
 Authorization must be checked on the clerk’s query before query
processing replaces a view by the definition of the view.
Authorization on Views
 Creation of view does not require resources authorization since
no real relation is being created
 The creator of a view gets only those privileges that provide no
additional authorization beyond that he already had.
 E.g. if creator of view cust-loan had only read authorization on
borrower and loan, he gets only read authorization on cust-loan
Granting of Privileges
 The passage of authorization from one user to another may be
represented by an authorization graph.
 The nodes of this graph are the users.
 The root of the graph is the database administrator.
 Consider graph for update authorization on loan.
 An edge Ui Uj indicates that user Ui has granted update
authorization on loan to Uj.
U1 U4
U2 U5
U3
DBA
Authorization Grant Graph
 Requirement: All edges in an authorization graph must be part of
some path originating with the database administrator
 If DBA revokes grant from U1:
 Grant must be revoked from U4 since U1 no longer has authorization
 Grant must not be revoked from U5 since U5 has another
authorization path from DBA through U2
 Must prevent cycles of grants with no path from the root:
 DBA grants authorization to U7
 U7 grants authorization to U8
 U8 grants authorization to U7
 DBA revokes authorization from U7
 Must revoke grant U7 to U8 and from U8 to U7 since there is no
path from DBA to U7 or to U8 anymore.
Security Specification in SQL
 The grant statement is used to confer authorization
grant <privilege list>
on <relation name or view name> to <user list>
 <user list> is:
 a user-id
 public, which allows all valid users the privilege granted
 A role (more on this later)
 Granting a privilege on a view does not imply granting any
privileges on the underlying relations.
 The grantor of the privilege must already hold the privilege on the
specified item (or be the database administrator).
Privileges in SQL
 select: allows read access to relation,or the ability to query using
the view
 Example: grant users U1, U2, and U3 select authorization on the branch
relation:
grant select on branch to U1, U2, U3
 insert: the ability to insert tuples
 update: the ability to update using the SQL update statement
 delete: the ability to delete tuples.
 references: ability to declare foreign keys when creating relations.
 usage: In SQL-92; authorizes a user to use a specified domain
 all privileges: used as a short form for all the allowable privileges
Roles
 Roles permit common privileges for a class of users can be
specified just once by creating a corresponding “role”
 Privileges can be granted to or revoked from roles, just like user
 Roles can be assigned to users, and even to other roles
 SQL:1999 supports roles
create role teller
create role manager
grant select on branch to teller
grant update (balance) on account to teller
grant all privileges on account to manager
grant teller to manager
Revoking Authorization in SQL
 The revoke statement is used to revoke authorization.
revoke<privilege list>
on <relation name or view name> from <user list> [restrict|cascade]
 Example:
revoke select on branch from U1, U2, U3 cascade
 Revocation of a privilege from a user may cause other users also
to lose that privilege; referred to as cascading of the revoke.
 We can prevent cascading by specifying restrict:
revoke select on branch from U1, U2, U3 restrict
With restrict, the revoke command fails if cascading revokes
are required.
Limitations of SQL Authorization
 SQL does not support authorization at a tuple level
 E.g. we cannot restrict students to see only (the tuples storing)
their own grades
Encryption
 Data may be encrypted when database authorization provisions
do not offer sufficient protection.
 Properties of good encryption technique:
 Relatively simple for authorized users to encrypt and decrypt data.
 Encryption scheme depends not on the secrecy of the algorithm but
on the secrecy of a parameter of the algorithm called the
encryption key.
 Extremely difficult for an intruder to determine the encryption key.
Encryption and Decryption
 Data Encryption Standard (DES) substitutes characters and rearranges
their order on the basis of an encryption key which is provided to
authorized users via a secured mechanism. Scheme is no more secure
than the key transmission mechanism since the key has to be shared.
 Advanced Encryption Standard (AES) is a new standard replacing DES,
and is based on the Rijndael algorithm, but is also dependent on shared
secret keys
 Public-key encryption is based on each user having two keys:
 public key – publicly published key used to encrypt data, but cannot be used
to decrypt data
 private key -- key known only to individual user, and used to decrypt data.
Need not be transmitted to the site doing encryption.
Encryption scheme is such that it is impossible or extremely hard to
decrypt data given only the public key.
 The public-key encryption scheme is based on the hardness of factoring
a very large number (100's of digits) into its prime components.
Authentication
 Password based authentication is widely used, but is susceptible
to sniffing on a network
 Challenge-response systems avoid transmission of passwords
 DB sends a (randomly generated) challenge string to user
 User encrypts string and returns result.
 DB verifies identity by decrypting result
 Can use public-key encryption system by DB sending a message
encrypted using user’s public key, and user decrypting and sending
the message back
 Digital signatures are used to verify authenticity of data
 E.g. use private key (in reverse) to encrypt data, and anyone can
verify authenticity by using public key (in reverse) to decrypt data.
Only holder of private key could have created the encrypted data.
 Digital signatures also help ensure nonrepudiation: sender
cannot later claim to have not created the data

More Related Content

PDF
Chapter 6 Database Security and Authorization (4).pdf
PPTX
Security and Authorization
PPT
Security and Authorization introductory notes.ppt
PPTX
Database Security and analyzing information
PPT
8034.ppt
PPTX
Database Security Methods, DAC, MAC,View
PPT
UNIT-1-Security.ppt
PPT
Database_Security.ppt
Chapter 6 Database Security and Authorization (4).pdf
Security and Authorization
Security and Authorization introductory notes.ppt
Database Security and analyzing information
8034.ppt
Database Security Methods, DAC, MAC,View
UNIT-1-Security.ppt
Database_Security.ppt

Similar to Database Management System Security.pptx (20)

PPTX
Presentation on Database Security in DBMS
PDF
ch23-Database Security and Authorization.pdf
PDF
ch23-Database Security and Authorization.pdf
PPTX
Database security and privacy
PPT
database security database systems for all
PPT
Database_Secnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnurity_sample.ppt
PPTX
databasemanagementsystemsecuritycyb.pptx
PPTX
security and privacy in dbms and in sql database
PDF
Database security
PPTX
01 database security ent-db
PPTX
Database security
PDF
Sql ch 15 - sql security
PPT
ELNA6eCh24.ppt
PPT
Data base security
PPTX
chapter30 Database Management Lecture Slides.pptx
PPTX
Discretionary access control(database).pptx
PPTX
Database concepts
PPT
PPTX
Security in Relational model
PPTX
Group 8 - Database Security Version 1.pptx
Presentation on Database Security in DBMS
ch23-Database Security and Authorization.pdf
ch23-Database Security and Authorization.pdf
Database security and privacy
database security database systems for all
Database_Secnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnurity_sample.ppt
databasemanagementsystemsecuritycyb.pptx
security and privacy in dbms and in sql database
Database security
01 database security ent-db
Database security
Sql ch 15 - sql security
ELNA6eCh24.ppt
Data base security
chapter30 Database Management Lecture Slides.pptx
Discretionary access control(database).pptx
Database concepts
Security in Relational model
Group 8 - Database Security Version 1.pptx
Ad

More from Roshni814224 (20)

PPTX
Ecommerce concepts and uses in Business.pptx
PPTX
Emerging Global Trends in Internet of Things.pptx
PPTX
Emerging IT Trends and Innovation Concepts.pptx
PPTX
Introduction to E-Commerce and Components.pptx
PPTX
Business Information Systems in firms.pptx
PPT
Strategic Information System in Business Firm.ppt
PPTX
Management Information System Applications.pptx
PPTX
The Concepts of Internet and Networking.pptx
PPT
Integrity Constraints in Database Management System.ppt
PPT
Data models in Database Management Systems.ppt
PPTX
Transaction Management, Recovery and Query Processing.pptx
PPTX
Computer System Software Component Details.pptx
PPTX
Social Engineering and Identity Theft.pptx
PPTX
Cyber Security and Data Privacy in Information Systems.pptx
PPTX
Information Systems, Organizations and Strategy.pptx
PPTX
Information Systems in Global Business Today.pptx
PPTX
Applications of Management Information System.pptx
PPT
Securing Management Information Systems.ppt
PPT
relational model in Database Management.ppt.ppt
PPTX
Normalization in Database Management System.pptx
Ecommerce concepts and uses in Business.pptx
Emerging Global Trends in Internet of Things.pptx
Emerging IT Trends and Innovation Concepts.pptx
Introduction to E-Commerce and Components.pptx
Business Information Systems in firms.pptx
Strategic Information System in Business Firm.ppt
Management Information System Applications.pptx
The Concepts of Internet and Networking.pptx
Integrity Constraints in Database Management System.ppt
Data models in Database Management Systems.ppt
Transaction Management, Recovery and Query Processing.pptx
Computer System Software Component Details.pptx
Social Engineering and Identity Theft.pptx
Cyber Security and Data Privacy in Information Systems.pptx
Information Systems, Organizations and Strategy.pptx
Information Systems in Global Business Today.pptx
Applications of Management Information System.pptx
Securing Management Information Systems.ppt
relational model in Database Management.ppt.ppt
Normalization in Database Management System.pptx
Ad

Recently uploaded (20)

PPTX
Computer Architecture Input Output Memory.pptx
PDF
advance database management system book.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Empowerment Technology for Senior High School Guide
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Computer Architecture Input Output Memory.pptx
advance database management system book.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Empowerment Technology for Senior High School Guide
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Computing-Curriculum for Schools in Ghana
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
AI-driven educational solutions for real-life interventions in the Philippine...
LDMMIA Reiki Yoga Finals Review Spring Summer
FORM 1 BIOLOGY MIND MAPS and their schemes
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Unit 4 Computer Architecture Multicore Processor.pptx
What if we spent less time fighting change, and more time building what’s rig...
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Introduction to pro and eukaryotes and differences.pptx
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα

Database Management System Security.pptx

  • 1. Access Control •A security policy specifies who is authorized to do what. •™ A security mechanism allows us to enforce a chosen security policy. ™ •Two main mechanisms at the DBMS level: – Discretionary access control – Mandatory access control
  • 2. 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. – DBMS 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
  • 3. Mandatory Access Control  ™ Based on system-wide policies that cannot be changed by individual users. – Each DB object is assigned a security class. – Each subject (user or user program) is assigned a clearance for a security class. – Rules based on security classes and clearances govern who can read/write which objects. ™  Most commercial systems do not support mandatory access control. Versions of some DBMSs do support it; used for specialized (e.g., military) applications.
  • 4. Why Mandatory Control?  ™ Discretionary control has some flaws, e.g., the Trojan horse problem: – Dick creates Horsie and gives INSERT privileges to Justin (who doesn’t know about this). – Dick modifies the code of an application program used by Justin to additionally write some secret data to table Horsie. – Now, Justin can see the secret info. ™ The modification of the code is beyond the DBMSs control, but it can try and prevent the use of the database as a channel for secret information.
  • 5. Security and Authorization  The data stored in the database need protection from a. Unauthorized access b. Malicious destruction or alteration c. Accidental introduction of inconsistency that integrity constraints provide  Among the forms of malicious access are: a. Unauthorized reading of data (theft of information) b. Unauthorized modification of data c. Unauthorized destruction of data
  • 6. Security  Security - protection from malicious attempts to steal or modify data.  Database system level  Authentication and authorization mechanisms to allow specific users access only to required data  We concentrate on authorization in the rest of this chapter  Operating system level  Operating system super-users can do anything they want to the database! Good operating system level security is required.  Network level: must use encryption to prevent  Eavesdropping (unauthorized reading of messages)  Masquerading (pretending to be an authorized user or sending messages supposedly from authorized users)
  • 7. Security (Cont.)  Physical level  Physical access to computers allows destruction of data by intruders; traditional lock-and-key security is needed  Computers must also be protected from floods, fire, etc.  Human level  Users must be screened to ensure that an authorized users do not give access to intruders  Users should be trained on password selection and secrecy
  • 8. Authorization Forms of authorization on parts of the database:  Read authorization - allows reading, but not modification of data.  Insert authorization - allows insertion of new data, but not modification of existing data.  Update authorization - allows modification, but not deletion of data.  Delete authorization - allows deletion of data
  • 9. Authorization (Cont.) Forms of authorization to modify the database schema:  Index authorization - allows creation and deletion of indices.  Resources authorization - allows creation of new relations.  Alteration authorization - allows addition or deletion of attributes in a relation.  Drop authorization - allows deletion of relations.
  • 10. Authorization and Views  Users can be given authorization on views, without being given any authorization on the relations used in the view definition  Ability of views to hide data serves both to simplify usage of the system and to enhance security by allowing users access only to data they need for their job  A combination of relational-level security and view-level security can be used to limit a user’s access to precisely the data that user needs.
  • 11. View Example  Suppose a bank clerk needs to know the names of the customers of each branch, but is not authorized to see specific loan information.  Approach: Deny direct access to the loan relation, but grant access to the view cust-loan, which consists only of the names of customers and the branches at which they have a loan.  The cust-loan view is defined in SQL as follows: create view cust-loan as select branch-name, customer-name from borrower, loan where borrower.loan-number = loan.loan-number
  • 12. View Example (Cont.)  The clerk is authorized to see the result of the query: select * from cust-loan  When the query processor translates the result into a query on the actual relations in the database, we obtain a query on borrower and loan.  Authorization must be checked on the clerk’s query before query processing replaces a view by the definition of the view.
  • 13. Authorization on Views  Creation of view does not require resources authorization since no real relation is being created  The creator of a view gets only those privileges that provide no additional authorization beyond that he already had.  E.g. if creator of view cust-loan had only read authorization on borrower and loan, he gets only read authorization on cust-loan
  • 14. Granting of Privileges  The passage of authorization from one user to another may be represented by an authorization graph.  The nodes of this graph are the users.  The root of the graph is the database administrator.  Consider graph for update authorization on loan.  An edge Ui Uj indicates that user Ui has granted update authorization on loan to Uj. U1 U4 U2 U5 U3 DBA
  • 15. Authorization Grant Graph  Requirement: All edges in an authorization graph must be part of some path originating with the database administrator  If DBA revokes grant from U1:  Grant must be revoked from U4 since U1 no longer has authorization  Grant must not be revoked from U5 since U5 has another authorization path from DBA through U2  Must prevent cycles of grants with no path from the root:  DBA grants authorization to U7  U7 grants authorization to U8  U8 grants authorization to U7  DBA revokes authorization from U7  Must revoke grant U7 to U8 and from U8 to U7 since there is no path from DBA to U7 or to U8 anymore.
  • 16. Security Specification in SQL  The grant statement is used to confer authorization grant <privilege list> on <relation name or view name> to <user list>  <user list> is:  a user-id  public, which allows all valid users the privilege granted  A role (more on this later)  Granting a privilege on a view does not imply granting any privileges on the underlying relations.  The grantor of the privilege must already hold the privilege on the specified item (or be the database administrator).
  • 17. Privileges in SQL  select: allows read access to relation,or the ability to query using the view  Example: grant users U1, U2, and U3 select authorization on the branch relation: grant select on branch to U1, U2, U3  insert: the ability to insert tuples  update: the ability to update using the SQL update statement  delete: the ability to delete tuples.  references: ability to declare foreign keys when creating relations.  usage: In SQL-92; authorizes a user to use a specified domain  all privileges: used as a short form for all the allowable privileges
  • 18. Roles  Roles permit common privileges for a class of users can be specified just once by creating a corresponding “role”  Privileges can be granted to or revoked from roles, just like user  Roles can be assigned to users, and even to other roles  SQL:1999 supports roles create role teller create role manager grant select on branch to teller grant update (balance) on account to teller grant all privileges on account to manager grant teller to manager
  • 19. Revoking Authorization in SQL  The revoke statement is used to revoke authorization. revoke<privilege list> on <relation name or view name> from <user list> [restrict|cascade]  Example: revoke select on branch from U1, U2, U3 cascade  Revocation of a privilege from a user may cause other users also to lose that privilege; referred to as cascading of the revoke.  We can prevent cascading by specifying restrict: revoke select on branch from U1, U2, U3 restrict With restrict, the revoke command fails if cascading revokes are required.
  • 20. Limitations of SQL Authorization  SQL does not support authorization at a tuple level  E.g. we cannot restrict students to see only (the tuples storing) their own grades
  • 21. Encryption  Data may be encrypted when database authorization provisions do not offer sufficient protection.  Properties of good encryption technique:  Relatively simple for authorized users to encrypt and decrypt data.  Encryption scheme depends not on the secrecy of the algorithm but on the secrecy of a parameter of the algorithm called the encryption key.  Extremely difficult for an intruder to determine the encryption key.
  • 22. Encryption and Decryption  Data Encryption Standard (DES) substitutes characters and rearranges their order on the basis of an encryption key which is provided to authorized users via a secured mechanism. Scheme is no more secure than the key transmission mechanism since the key has to be shared.  Advanced Encryption Standard (AES) is a new standard replacing DES, and is based on the Rijndael algorithm, but is also dependent on shared secret keys  Public-key encryption is based on each user having two keys:  public key – publicly published key used to encrypt data, but cannot be used to decrypt data  private key -- key known only to individual user, and used to decrypt data. Need not be transmitted to the site doing encryption. Encryption scheme is such that it is impossible or extremely hard to decrypt data given only the public key.  The public-key encryption scheme is based on the hardness of factoring a very large number (100's of digits) into its prime components.
  • 23. Authentication  Password based authentication is widely used, but is susceptible to sniffing on a network  Challenge-response systems avoid transmission of passwords  DB sends a (randomly generated) challenge string to user  User encrypts string and returns result.  DB verifies identity by decrypting result  Can use public-key encryption system by DB sending a message encrypted using user’s public key, and user decrypting and sending the message back  Digital signatures are used to verify authenticity of data  E.g. use private key (in reverse) to encrypt data, and anyone can verify authenticity by using public key (in reverse) to decrypt data. Only holder of private key could have created the encrypted data.  Digital signatures also help ensure nonrepudiation: sender cannot later claim to have not created the data

Editor's Notes