Week 14- Database Security
Week 14- Database Security
DATABASE SECURITY
2
Databases
Query language
Provides a uniform
interface to the database
Database Concepts
Database
a collection of data & set of rules that organize the data
user works with a logical representation of the data
Relational database
in the relational model, data is organized as a collection of
RELATIONS or tables
relations is a set of ATTRIBUTES or columns
each row (or record) of a relation is called a TUPLE
Database management system (DBMS)
maintains the DB and controls read write access
Database administrator (DBA)
sets the organization of DB and access rules to the DB
Database Concepts
Element integrity
integrity of specific database elements is their
correctness or accuracy
field checks
– allow only acceptable values
access controls
– allow only authorized users to update elements
change log
– used to undo changes made in error
referential Integrity (key integrity concerns)
two phase locking process
Auditability
log read/write to database
Security Requirements
Columns
medical record analysts have READ/WRITE access to
confidential columns
managers have READ access to non-confidential columns
Rows:
medical record analysts can read and update all the
records
managers can read but not update client records for their
department
Database Access Control 18
Centralized administration
If the user has access to the
• Small number of privileged users may
entire database or just portions grant and revoke access rights
of it
Ownership-based administration
What access rights the user has
• The creator of a table may grant and
(create, insert, delete, update, revoke access rights to the table
read, write)
Decentralized administration
• The owner of the table may grant and
revoke authorization rights to other users,
allowing them to grant and revoke access
rights to the table
19
SQL Access Controls
• An end user who owns • An end user who • User who has
database objects as part operates on database administrative
of an application objects via a particular responsibility for part or
application but does not all of the database
own any of the database
objects
INFERENCE
22
INFERENCE EXAMPLE…
Two approaches
Approach seeks to
eliminate an inference
channel violation during a
query or series of queries
Inference detection at
query time
If an inference channel is
detected, the query is
denied or altered
2
2. Perturbation:
Provides answers to all queries, but the answers are
approximate.
Due to the addition of noise to the statistics generated from the
original data.
This can be done in one of two ways:
1. Data Perturbation :
The data in the database can be modified (perturbed) so as to produce statistics that
cannot be used to infer values for individual records.
2. Output Perturbation :
2
Database Encryption 28
The database is typically the most valuable information resource for any
organization
Protected by multiple layers of security
Firewalls, authentication, general access control systems, DB access control systems,
database encryption
Encryption becomes the last line of defense in database security
Can be applied to the entire database, at the record level, the attribute
level, or level of the individual field
Disadvantages to encryption:
Key management
Authorized users must have access to the decryption key for the data for which they
have access
Inflexibility
When part or all of the database is encrypted it becomes more difficult to perform
record searching
29
1. The user issues an SQL query for fields from one or more
records with a specific value of the primary key.
4. The query processor decrypts the data and returns the results.
3
Summary
31
The need for database
security • Database access
Database management control
systems
SQL-based access
Relational databases definition
Elements of a relational Cascading
database system authorizations
Structured Query Language Role-based access
SQL injection attacks control
A typical SQLi attack • Database
The injection technique encryption
SQLi attack avenues and
types
SQLi countermeasures
Inference
32
Further Readings
https://www.owasp.org/index.php/Testing_for_SQL_
Injection_(OTG-INPVAL-005
)
https://www.w3schools.com/sql/sql_injection.asp