Course3 DBSecurity
Course3 DBSecurity
Course 3
Database Security Foundations (part 2)
Discretionary aspects of the security in
databases
Plan
1. Security Policies
1.1 Access control policies
• Authorization policies
• Role-based access control
1.2 Administration policies
1.3 Identification and authentication
1.4 Audit of a database system
1.5 Views in the security context
2. Enforcement of Security Policies
2.1 SQL extensions for security
2.2 Query rewrite
3
1. Security Policies
4
1. Security Policies (1)
• Security policies are sets of rules that ensure the security of
the system. These policies include 2 categories:
• Mandatory policies – previously presented;
• Discretionary policies.
5
1. Security Policies (2)
We recall:
Mandatory policies are those that are mandatory by
nature, independent of the application.
Discretionary policies are those that are specified by the
administrator or by a person responsible for the
environment in which the system will operate.
6
1. Security Policies (3)
7
1. Security Policies (4)
• Another class of discretionary security policies includes
administration policies.
• We will also discuss identification and authentication in the
frame of discretionary policies.
8
1.1. Access control policies (1)
• These policies were first investigated for operating systems.
• The key issue in the context of OSs is whether a process can be
granted access to a file.
• Access can be for read or write, and the latter can include access to
edit, add or delete.
• Subsequently, these principles were transferred to database
systems such as INGRES and System R.
• Since then, various forms of access control have been studied.
• These include role-based policies currently implemented in a lot of
commercial systems.
9
1.1. Access control policies (2)
• Access control policies also include mandatory policies, discussed earlier.
• The different types of access control are shown in Figure 1 and will be
described in the following.
11
1.1. Access control / Authorization
policies (2)
Authorization rules:
• Positive authorizations
• Early systems focused on the rules that are now called positive
authorization rules.
• For example, user John is granted access to the relation EMP, or user Jane is
granted access to the relation DEPT. These are the rules of access control
over relations.
• We can also grant access to attributes and tuples. For example, John has
access to read the salary attribute and access to write the name attribute
in the relation EMP.
12
1.1. Access control / Authorization
policies (3)
Authorization rules (continued):
• Negative authorizations
• If John's access to an object is not specified, does this mean that John does
not have access to that object?
• In some systems, the non-specification of an authorization rule implicitly
means negative authorization, while in other systems negative
authorizations should be explicitly specified.
• For example, we can enforce rules so that John does not have access to the
relation EMP, or Jane does not have access to the relation DEPT.
13
1.1. Access control / Authorization
policies (4)
• Conflict resolution
• When we have conflicting rules, how are they resolved?
• For example, we can have a rule that grants John read access to the
relation EMP.
• We can also have a rule that does not give John read access to the
attribute salary in EMP. This is a conflict.
• Usually, the system applies the rule of the least privilege, meaning
that John has access to EMP except the values of the attribute
salary.
14
1.1. Access control / Authorization
policies (5)
• Strong and weak authorization
• In the case of a strong authorization, the rule is valid regardless of
conflicts, and in the case of a weak one, the rule does not apply if
there is a conflict.
• For example, if John is granted access to EMP and this is a strong
authorization rule, and the rule by which John does not receive
access to the salary attribute is a weak rule, we have a conflict
situation.
• This means that the strong authorization remains valid.
15
1.1. Access control / Authorization
policies (6)
• Propagation of authorization rules
• For example, if John has read access to the relation EMP, does that mean
that John has access to every item in EMP?
• This usually happens unless there are rules that prevent the automatic
propagation of an authorization rule.
• If such a rule exists, we must explicitly establish authorization rules that
specify the objects to which John has access.
16
1.1. Access control / Authorization
policies (7)
• Special rules
• Content and context constraints are rules by which access is granted based on
the content of the data or the context in which it is displayed.
• These rules are extensions of mandatory policies but can also be applied in the
frame of discretionary security.
• For example, in the case of content-based constraints, John has read-only
access only to tuples in department 100.
• In the case of context or association constraints, John does not have read access
to names and salaries taken together but may have individual access to them.
• In the case of event-based constraints, after the elections (event), John has
access to all elements of the EMP relationship.
17
1.1. Access control / Authorization
policies (8)
• Consistency and completeness of the rules
• One of the problems is ensuring the consistency and completeness of the
constraints.
• Does this mean that if the rules or constraints are inconsistent, do we have
conflict resolution rules to deal with the situation?
• How can we ensure that all entities (attributes, relations, elements etc.) are
included in users’ access control rules? In other words, are the rules
complete?
• If not, what assumptions should we make about entities that have neither
positive nor negative authorizations specified on them for a particular user
or class of users?
18
1.1. Access control / Role-Based Access
Control policies (1)
• Role-Based Access Control (RBAC) has become one of the
most popular methods of access control.
• The method has been implemented in commercial systems,
including Oracle.
• The idea is to grant users access based on their roles and functions.
19
1.1. Access control / Role-Based Access
Control policies (2)
• Users need access to data according to their functions.
• For example, a corporate president may have access to information
about his vice presidents and board members, and the chief
financial officer may have access to financial and subordinate
employees' information.
• A department manager may have access to data about those who
work in that department and the human resources director may
obtain information about the personal data of employees in the
corporation.
20
1.1. Access control / Role-Based Access
Control policies (3)
• Role-based access control is a type of authorization policy
that depends on the user's role and activities associated to
it.
• The literature contains the research directions on
hierarchies of roles.
• Some of the issues that arise in this area relate to how access is
propagated or the possibility that one role contains another role.
21
1.1. Access control / Role-Based Access
Control policies (4)
23
1.1. Access control / Role-Based Access
Control policies (6)
24
1.1. Access control / Role-Based Access
Control policies (7)
26
1.2. Administration Policies (2)
• The database administrator (DBA) is responsible for updating metadata,
indexes and access methods and also for ensuring that access control
rules are properly applied.
• An important role can also be played by the System Security Officer
(SSO).
Security issues may be the responsibility of the SSO and data issues may
be the responsibility of the DBA.
• Other administration policies refer to the appointment of persons which
should be responsible for the data.
• Usually, the owners of the schemas have control over the data they create and
can manage them during their existence.
• There are situations in which the owners are not available for data
management, in which case someone else is appointed to be responsible for
them.
27
1.2. Administration Policies (3)
Figure 5
28
1.3. Identification and Authentication
• Identification requires users to provide a user ID and a password.
• Authentication is the stage in which the system must match the user ID
with the password to ensure that the person is the one who pretends he
is. A user can have multiple identities, depending on his roles.
• A lot of issues have been reported regarding the password-based
schema. One of these is that hackers can break into the system. In a
centralized system the problems are simpler than in a distributed one.
• More recently, biometric techniques have begun to be used. These
include face and voice recognition for user authentication. The
widespread use of biometric techniques is expected as these
technologies evolve.
29
1.4. Audit of a database system (1)
• Database audit is performed for several purposes.
• For example, databases can be audited in order to record:
• Number of launched queries,
• Number of updates,
• Number of executed transactions,
• Number of user connections.
30
1.4. Audit of a database system (2)
31
1.4. Audit of a database system (3)
• Audits create an audit trail, and audit data can be stored in a database.
• This database can be analyzed in order to detect any abnormal
sequence or behavior.
• There have been many concerns about using data mining to analyze
audit and detect unauthorized access.
• The analysis of audit information is particularly important in present, in
the context of web transactions.
• An organization should be able to initiate the analysis and determine issues
such as credit card fraud and identity theft.
32
1.5. Views in the security context
• As a security mechanism, views have been studied for both mandatory
and discretionary security.
• For example, we may not want to grant access to an entire relationship,
especially if it has many attributes. Therefore, the DBA could create views
and grant access to them. As with mandatory security, security levels can
be associated with views.
33
2. Enforcement of Security
Policies
34
2. Enforcement of Security Policies
35
2.1. SQL extensions for security (1)
36
2.1. SQL extensions for security (2)
37
2.1. SQL extensions for security (3)
38
2.2. Query rewrite (1)
• The query rewrite was first proposed in the INGRES project. The idea is to
modify the query based on constraints.
• We consider a query from John which retrieves all the tuples in EMP. We
assume that John has read access only to tuples for which the salary is less
than 30,000 and the employee does not work in the security department.
• The query:
SELECT * FROM EMP;
will be rewritten as:
SELECT * FROM emp
Where salary < 30000
And dept != ‘Security’;
39
2.2. Query rewrite (2)
40
2.2. Query rewrite (3)
• The high-level algorithm is presented below:
Input : The query Q, the set S of security constraints
Output : The rewritten query Q'
For c in S
If c relevant_for Q then
Modify the where clause of Q via a negation
End if;
End for;
Return Q';
41
A perspective on the inference problem (1)
42
A perspective on the inference problem (2)
43
A perspective on the inference problem (3)
44
A perspective on the inference problem (4)
45
A perspective on the inference problem (5)
46