Chapter 2 Database Security and Authorization
Chapter 2 Database Security and Authorization
DATA SECURITY
It’s your data – are you sure it’s safe?
data. The user with this privilege is allowed only to read the
content of the data object
Insert authorization - allows insertion of new data, but not
modification of existing data. The user with this privilege is
allowed only to insert new records or items to the data object
Update authorization - allows modification, but not deletion of
data. The users with this privilege are allowed to modify
content of attributes but are not authorized to delete the
records
Delete authorization - allows deletion of data. The users with
this privilege are only allowed to delete a record and not
anything else. 14
Advanced Database By Dagne W 04/10/2024 14
Authorization
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.
23
Advanced Database By Dagne W 04/10/2024
DATABASES SECURITY VULNERABILITY
28
Advanced Database By Dagne W 04/10/2024
DATABASE SECURITY ISSUES
The security mechanism of a DBMS must
include provisions for restricting access to
the database as a whole
This
function is called access control and is
handled by creating user accounts and
passwords to control login process by the
DBMS.
35
Advanced Database By Dagne W 04/10/2024
DISCRETIONARY ACCESS CONTROL BASED ON GRANTING AND REVOKING PRIVILEGES
44
Granting Object Privileges
, ,
Schema. role
PUBLIC
46
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
DBA U2 U5
U3
A B C A B C A B C
A D
C F
A revokes D’s privileges
B
A
64
Non-cascading Revoke
B E
A D
C F
A revokes D’s privileges
E
B
A
C F
65
Creating Users
USER_USERS
ALL_USERS
DBA_USERS
USER_TS_QUOTAS
DBA_TS_QUOTAS
DROP command
Lock the account or revoke the CREATE SESSION privilege
71
Advanced Database By Dagne W 04/10/2024 71
ROLE-BASED ACCESS CONTROL
Role-based access control (RBAC) emerged
rapidly in the 1990s as a proven technology for
managing and enforcing security in large-scale
enterprise wide systems.
Its basic notion is that permissions are associated
with roles, and users are assigned to appropriate
roles.
Roles can be created using the CREATE ROLE and
DESTROY ROLE commands.
TheGRANT and REVOKE commands discussed under
DAC can then be used to assign and revoke privileges
from roles.
Advanced Database By Dagne W 04/10/2024
Slide 23- 72
ROLE-BASED ACCESS CONTROL
RBAC appears to be a viable alternative to
traditional discretionary and mandatory
access controls; it ensures that only
authorized users are given access to certain
data or resources.
Many DBMSs have allowed the concept of
roles, where privileges can be assigned to
roles.
Role hierarchy in RBAC is a natural way of
organizing roles to reflect the organization’s
lines of authority and responsibility.
Advanced Database By Dagne W 04/10/2024
Slide 23- 73
ROLE-BASED ACCESS CONTROL
Another important consideration in RBAC systems
is the possible temporal constraints that may exist
on roles, such as time and duration of role
activations, and timed triggering of a role by an
activation of another role.
Using an RBAC model is highly desirable goal for
addressing the key security requirements of Web-
based applications.
In contrast, discretionary access control (DAC)
and mandatory access control (MAC) models lack
capabilities needed to support the security
requirements emerging enterprises and Web-
based applications.
Advanced Database By Dagne W 04/10/2024
Slide 23- 74
Roles
IDENTIFIED BY password
Where: EXTERNALLY
– Role Name of the role to be created
– NOT IDENTIFIED Users granted the role do not need to be verified by
ORACLE to enable it
– IDENTIFIED Indicates that the users granted the role must be
verified by ORACLE to enable the role
– BY password Specifies the password that authorizes enabling the
role
– EXTERNALLY Specifies that ORACLE will verify user access to the
role
using an operating system utility
Note : If the IDENTIFIED option is chosen, users can enable/disable the role
by using the SET ROLE command.
Advanced Database By Dagne W 04/10/2024 76
Benefits of Using Roles
85
MAC
Access rights: defined by comparing the security
classification of the requested objects with the
security clearance of the subject
If access control rules are satisfied, access is
permitted
Otherwise access is rejected
Granularity of access rights!
86
MAC – BELL-LAPADULA (BLP)
MODEL
Single security property: a subject S is allowed a
read access to an object O only if label(S)
dominates label(O)
Star-property: a subject S is allowed a write access
87
MULTILEVEL SECURITY
Multilevel security users at different
security level, see different versions of the
database
Problem: different versions need to be kept
consistent and coherent without downward
signaling channel (covert channel)
88
MULTILEVEL RELATION
Schema R(A1,C1,…,An,Cn,Tc)
R: relation name
A : attribute name
i
C : security classes
i
T : Tuple security classes
c
Instantiation of relation: sets of tuples of
the form <a1,c1,…,an,cn,tc>
a : attribute value
i
c : attribute classification label
i
t : tuple classification label
c
89
Multilevel Relation Example
90 90
Polyinstantiation
Secret user sees Secret-View:
SSN (SSN) Course (Course) Grade (Grade)
111-22-3333 S CSCE 786 S null S
444-55-6666 S CSCE 567 S null S
92
COMPARING DISCRETIONARY ACCESS
CONTROL AND MANDATORY ACCESS CONTROL
Slide
30- 97
SQL INJECTION
Unauthorized privilege escalation – individual
attempting to elevate his or her privilege by
attacking vulnerable points in the database
systems.
Privilege abuse – by a privileged user. E.g. an
administrator who is allowed to change student
information can use this privilege to update student
grades without the instructor’s permission.
Denial of service (DOS) attack - making resources
unavailable to its intended users. access to network
apps or data is denied by overflowing the buffer or
consuming resources.
Weak Authentication - If user authentication
scheme is weak, an attacker can impersonate
Chapte the
identity of a legitimate user by obtaining rtheir
23- login
98
SQL INJECTION METHODS
SQL Manipulation - adding conditions to the
WHERE-clause of a query, or expanding query -
using set operations such as UNION, INTERSECT, or
MINUS.
SELECT * FROM users WHERE username = ‘jake’ and
(PASSWORD = ‘jakespasswd’ or ‘x’ = ‘x’)
Chapte
r 23-
100
SIMPLE SQL INJECTION
SELECT email
FROM Email-Addresses
WHERE email = ‘[email protected]’
SELECT email-address
FROM Email-Addresses
WHERE email = 'anything' OR 'x'='x';
Slide 23-
101
RISKS ASSOCIATED WITH SQL
INJECTION
Database fingerprinting (the type of
database)
Denial of service (flood the server)
Bypassing authentication
Identifying injectable parameters
Executing remote commands
Performing privilege escalation
Slide 30-
102
PROTECTION TECHNIQUES
Bind variables (using parameterized
statements)