Database Security
Database Security
Database Security
Database Security
Outline
Looping
• What is data security?
• Security v/s Integrity
• Authentication v/s Authorization
• Data encryption
• Access control
• DAC (Discretionary access control)
• MAC (Mandatory access control)
• RBAC models
• Intrusion detection
• SQL injection
What is data security?
Section – 1
What is data security?
Data security is the protection of the data from unauthorized users.
Only the authorized users are allowed to access the data.
Most of the users are allowed to access a part of database i.e., the data that is related to them
or related to their department.
Mostly, the DBA or head of department can access all the data in the database.
Some users may be permitted only to retrieve data, whereas others are allowed to retrieve as
well as to update data.
Security Integrity
Data security deals with protection of data. Data integrity deals with the validity of
data.
Data security is making sure that only the Data integrity is making sure that the data
people who should have access to the data is correct and not corrupt.
are the only ones who can access the data.
Data security avoids from unauthorized Data integrity avoids from human errors,
access of data. when data is entered.
Data security is implemented through user Data integrity is implemented through
account (passwords). constraints such as Primary key, Foreign
key, Check constraints etc.
Authentication Authorization
It is the process of validating a user on the It is the process of verifying whether
credentials (username and password). access is allowed or not.
Logging on to a PC or some website or app Accessing a file (data) from hard disk or
with username and password is some database is authorization.
authentication.
It is the process of verifying who you are. It is the process of verifying what you are
authorized to do or not to do.
It is providing integrity control and security It is protecting the data to ensure privacy
to the data. and access control of data.
Student
• Read (Partial rights) • Read and Write (Full rights)
• Partial table (Only 1 tuple) RollNo Name Branch Sem SPI BL • On entire table (3 tuples)
101 Raju CE 3 6 1
101 Mitesh CE 5 9 0
• Read (Partial rights) • Read and Write (Full rights)
• Partial table (2 or 1 tuples) 102 Jay CE 3 8 0 • Partial table (2 or 1 tuples)
Faculty Coordinator
GRANT
This command gives rights to user for an object.
Syntax:- GRANT privilege ON object TO user [WITH GRANT OPTION]
REVOKE
This command takes back rights from user for an object.
Syntax:- REVOKE privilege ON object FROM user {RESTRICT/CASCADE}
Each user is assigned a clearance level and each object is assigned a security level.
A user can access object of particular security level only if he has proper clearance level.
The DBMS (system) determines whether the given user can read or write a given object based
on some rules.
This rule makes sure that sensitive data can never be passed to a user without necessary
clearance.