Chapter 3
Database Integrity,
Security and Recovery
Database Security
Data is a valuable resource that must be strictly
controlled and managed, as with any corporate
resource.
Part or all of the corporate data may have strategic
importance and therefore needs to be kept secure
and confidential.
2 Database Integrity, Security and Recovery 04/13/2024
Database Security
Mechanisms that protect the database against
intentional or accidental threats.
Security considerations do not only apply to the
data held in a database. Breaches of security may
affect other parts of the system, which may in
turn affect the database.
Most systems implement Database Integrity
Constraints to protect the system from accidental
misuse while there are many computer-based
measures to protect the system from intentional
misuse, which is termed as Database Security
3 measures 04/13/2024
Database Security
Involves measures to avoid the following threats:
Theft and fraud
Loss of confidentiality (secrecy)
Loss of privacy
Loss of integrity
Loss of availability
4 Database Integrity, Security and Recovery 04/13/2024
Database Security
Threat
Any situation or event, whether intentional or
unintentional, that will adversely affect a system and
consequently an organization.
5 Database Integrity, Security and Recovery 04/13/2024
Summary of Threats to Computer Systems
6 Database Integrity, Security and Recovery 04/13/2024
Typical Multi-user Computer
Environment
7 Database Integrity, Security and Recovery 04/13/2024
Levels of Security Measures
Physical Level: physically Securing the site containing the
computer system. The backup systems should also be
physically protected from access except for authorized
users.
Human Level: concerned with authorization of database
users for access to the content at different levels and
privileges.
Operating System level: concerned with the weakness and
strength of the operating system security on data files.
Weakness may serve as a means of unauthorized access to
the database. This also includes protection of data in
primary and secondary memory from unauthorized access.
8 Database Integrity, Security and Recovery 04/13/2024
Levels of Security Measures Cont’d…
Database System level: concerned with data
access limit enforced by the database system.
Access limit like password, isolated transaction
etc.
Communication Network level : Securing Data
in transit.
Application Level: Different Application
Software need to have their own Security
mechanism. –eg Authentication /Authorization
9 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer-Based Controls
Concerned with the set of all controls ranging from
physical controls to administrative procedures and
includes:
Authorization
Access controls
Views
Backup and recovery
Integrity
Encryption
RAID technology
10 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer-Based
Controls
Authorization
The granting of a right or privilege, which enables a
subject to legitimately have access to a system or a
system’s object(resources).
Authentication is a mechanism that determines
whether a user is, who he or she claims to be.
11 Database Integrity, Security and Recovery 04/13/2024
Authorization
The granting of a right or privilege that enables a subject to
have legitimate access to a system or a system’s object
The access allowed to a user could be for data manipulation
or control
Authorization controls can be built into the software, and
govern not only what system or object a specified user can
access, but also what the user may do with it(Mode of Access)
Authorization controls are sometimes referred to as access
controls
The process of authorization involves authentication of
subjects (i.e. a user or program) requesting access to objects
(i.e. a database table, view, procedure, trigger, or any other
object that can be created within the system)
12 Database Integrity, Security and Recovery 04/13/2024
Forms of user authorization on data
User authorization on the data/extension
Read Authorization: the user with this privilege is
allowed only to read the content of the data object.
Insert Authorization: the user with this privilege
is allowed only to insert new records or items to the data
object.
Update Authorization: users with this privilege
are allowed to modify content of attributes but are not
authorized to delete the records.
Delete Authorization: users with this privilege
are only allowed to delete a record and not anything else.
13 Database Integrity, Security and Recovery 04/13/2024
User authorization on the database
schema
User authorization on the Metadata/Intension
Index Authorization: deals with permission to
create as well as delete an index table for
relation.
Resource Authorization: deals with permission
to add/create a new relation in the database.
Alteration Authorization: deals with
permission to add as well as delete an attribute.
Drop Authorization: deals with permission to
delete and existing relation.
14 Database Integrity, Security and Recovery 04/13/2024
Roles of the DBA in DB security
Account Creation: involves creating different accounts for
different USERS as well as USER GROUPS.
Security Level Assignment: involves in assigning different
users at different categories of access levels.
Privilege Grant: involves giving different levels of
privileges for different users and user groups.
Privilege Revocation: involves denying or canceling
previously granted privileges for users due to various
reasons.
Account Deletion: involves in deleting an existing account
of users or user groups. Is similar with denying all
privileges of users on the database (Complete Revocation).
15 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer-Based
Controls
Access control
Based on the granting and revoking of
privileges.
A privilege allows a user to create or access
(that is read, write, or modify) some
database object (such as a relation, view, and
index) or to run certain DBMS utilities.
Privileges are granted to users to
accomplish the tasks required for their jobs.
16 Database Integrity, Security and Recovery 04/13/2024
Security at different Levels of Data
Almost all RDBMSs provide security at different
levels and formats of data. This includes:
Relation Level: permission to have access to a
specific relation.
View Level: permission to data included in the
view and not in the named relations
Hybrid (Relation/View): the case where only
part of a single relation is made available to users
through View.
17 Database Integrity, Security and Recovery 04/13/2024
Database Access Request
Any database access request will have the following
three major components
Requested Operation: what kind of operation is requested
by a specific query?
Requested Object: on which resource or data of the
database is the operation sought to be applied?
Requesting User: who is the user requesting the operation
on the specified object?
The database should be able to check for all the three
components before processing any request. The checking
is performed by the security subsystem of the DBMS.
18 Database Integrity, Security and Recovery 04/13/2024
Access Control models
Most DBMS provide an approach called
Discretionary Access Control (DAC).
SQL standard supports DAC through the
GRANT and REVOKE commands.
Whereas, DENY allows to prevent access to an
object.
The GRANT command gives privileges to
users, and the REVOKE command takes
privileges away.
19 Database Integrity, Security and Recovery 04/13/2024
Access control models
DAC while effective has certain weaknesses. In
particular an unauthorized user can trick an
authorized user into disclosing sensitive data.
An additional approach is required called Mandatory
Access Control (MAC).
Also an improvement to DAC is
Role Based Access Control (RBAC)
In the role-based access control model, rights and
permissions are assigned to roles instead of individual
users. This added layer of abstraction permits easier
and more flexible administration and enforcement of
access controls.
20 Database Integrity, Security and Recovery 04/13/2024
Access Control models
MAC is based on system-wide policies
that cannot be changed by individual
users.
Each database object is assigned a
security class and each user is assigned a
clearance level for a security class, and
rules are imposed on reading and writing
of database objects by users.
21 Database Integrity, Security and Recovery 04/13/2024
Access Control Models
MAC determines whether a user can read or write an
object based on rules that involve the security class of
the object and the clearance level of the user( the
subjects). These rules ensure that sensitive data can
never be ‘passed on’ to another user without the
necessary security clearance.
Subject S is allowed to read object O only if class (S)
>=class (O). (No Read Up)
Subject S is allowed to write object O only if class (S)
<=class (O). (No Write Down)
The SQL standard does not include support for MAC.
22 Database Integrity, Security and Recovery 04/13/2024
Popular Model for MAC called Bell-
LaPudula
It is described in terms of objects (such as relations, views,
tuples, and attributes), subjects (such as users and
programs), security classes, and clearances. Each database
object is assigned a security class, and each subject is
assigned a clearance level for a security class.
The classes may be designed, say as follows
Top secret (TS), secret (S), confidential (C), and unclassified
(U)
23 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer-Based
Controls
View
Is the dynamic result of one or more relational operations
operating on the base relations to produce another relation.
A view is a virtual relation that does not actually exist in the
database, but is produced upon request by a particular user,
at the time of request.
The view mechanism provides a powerful and flexible
security mechanism by hiding parts of the database from
certain users
Using a view is more restrictive than simply having certain
privileges granted to a user on the base relation(s)
(Minimization of Resource not needed by a user. Hence,
reducing potential abuse)
24 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer-Based
Controls
Backup
Process of periodically taking a copy of the database and log file (and
possibly programs) to offline storage media.
Redundancy is a key principle.
Could be complete or incremental backups
Journaling
Process of keeping and maintaining a log file (or journal) of all changes
made to database to enable effective recovery in event of failure.
Restoring Database is done by restoring the database to the latest
Backup ( in the event of a complete failure) then applying the Log
file
25 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer-Based
Controls
Integrity
Prevents data from becoming invalid, and hence
giving misleading or incorrect results.
Different types of constraints
Primary key
Default
Foreign key
Unique key
Check
Nullity
26 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer-Based
Controls
Encryption
The encoding of the data by a special algorithm that
renders the data unreadable by any program/user without
the decryption key.
Encryption can be used for both storing securely in a
shared/Multiuser environment or for transmitting data
securely
Four main components in Cryptosystem
Encryption key
Encryption algorithm
Decryption key
Decryption algorithm
27 Database Integrity, Security and Recovery 04/13/2024
Countermeasures – Computer Based
Controls- Types of Cryptosystems
Cryptosystems can be categorized into two
Symmetric encryption – uses the same key for both encryption
and decryption and relies on safe communication lines for
exchanging the key. Also known as private key cryptosystem
Example: DES, AES
Asymmetric encryption – uses different keys for encryption and
decryption . These are also known as public key crypto systems
Example: RSA
Generally, symmetric algorithms are much faster to execute on a
computer than those that are asymmetric.
In the contrary, asymmetric algorithms are more secure than
symmetric algorithms.
28 Database Integrity, Security and Recovery 04/13/2024
Symmetric and Asymmetric Algorithms
combined ( Hybrid approach)
However, in practice, they are often used
together, so that a public key algorithm is used
to encrypt a randomly generated encryption
key ( for the symmetric key algorithm), and the
random key is then used to encrypt the actual
message using a symmetric algorithm.
29 Database Integrity, Security and Recovery 04/13/2024
RAID (Redundant Array of Independent
Disks) Technology
Hardware that the DBMS is running on must be
fault-tolerant, meaning that the DBMS should
continue to operate even if one of the hardware
components fails (Resilient Systems).
Suggests having redundant components that can be
seamlessly integrated into the working system
whenever there is one or more component failures.
30 Database Integrity, Security and Recovery 04/13/2024
RAID (Redundant Array of Independent
Disks) Technology
The main hardware components that should be
fault-tolerant include disk drives, disk controllers,
CPU, power supplies, and cooling fans.
Disk drives are the most vulnerable components
with the shortest times between failure of any of the
hardware components.
31 Database Integrity, Security and Recovery 04/13/2024
RAID (Redundant Array of Independent
Disks) Technology
One solution is to provide a large disk array
comprising an arrangement of several independent
disks (with independent failure modes) that are
organized to improve reliability and at the same
time increase performance.
32 Database Integrity, Security and Recovery 04/13/2024
RAID (Redundant Array of Independent
Disks) Technology
Performance is increased through data striping: the
data is segmented into equal-size partitions (the
striping units), which are transparently distributed
across multiple disks.
Reliability is improved through storing redundant
information across the disks using a parity scheme
or an error-correcting scheme.
33 Database Integrity, Security and Recovery 04/13/2024
Statistical Database Security
Statistical databases contain information about
individuals which may not be permitted to be seen by
others as individual records.
Such databases may contain information about various
populations.
Example: Medical Records, Personal Data like address,
salary, etc
Hence, these databases have a Personally Identifiable
Information (PII), which if disclosed could evade the
privacy of the individuals.
Such kind of databases should have special security
mechanisms so that confidential information about
people will not be disclosed for many users.
34 Database Integrity, Security and Recovery 04/13/2024
Statistical Database Security cont’d…
Only queries with statistical aggregate functions
like Average, Sum, Min, Max, Standard
Deviation, Mid, Count, etc should be executed.
Queries retrieving confidential attributes should
be prohibited.
Not to let the user make inference on the retrieved
data, one can also implement constraint on the
minimum number of records or tuples in the
resulting relation by setting a threshold.
35 Database Integrity, Security and Recovery 04/13/2024
DBMSs and Web Security
Internet communication relies on TCP/IP as the
underlying protocol.
However, TCP/IP and HTTP were not designed
with security in mind.
Without special software, all Internet traffic travels
‘in the clear’ and anyone who monitors traffic can
read it.
36 Database Integrity, Security and Recovery 04/13/2024
DBMSs and Web Security
A must to ensure while transmitting information
over the Internet is that data Must be :
inaccessible to anyone but sender and receiver
(privacy);
not changed during transmission (integrity);
receiver can be sure it came from sender
(authenticity);
sender can be sure receiver is genuine (non-
fabrication);
sender cannot deny he or she sent it (non-
repudiation).
37 Database Integrity, Security and Recovery 04/13/2024
DBMSs and Web Security
Some Measures include:
Proxy servers
Firewalls
Message digest algorithms and digital signatures
Digital certificates
Kerberos
Secure sockets layer (SSL) and Secure HTTP (S-HTTP)
Secure Electronic Transactions (SET) and Secure
Transaction Technology (STT)
38 Database Integrity, Security and Recovery 04/13/2024
Write the Answer for the following
Questions
1. What are the three components of a database
access request?
2. What is Authentication?
3. List at least three levels of Database Security
4. Which of the following is not a security measure
for the web
a. ) HTTPS b.) Data center c.) Secured Electronic
Transaction(SET) d) None
5. What is a security threat?
39 Database Integrity, Security and Recovery 04/13/2024