Unit 3
Unit 3
AUTHORISATION
Structure Page Nos.
3.0 Introduction 59
3.1 Objectives 60
3.2 Database Security: The Scenario 60
3.3 Levels of Database Security 60
3.3.1 Server Security
3.3.2 Database Connections
3.3.3 Table Access Control
3.3.4 Restricting Database Access
3.4 Access Control 62
3.4.1 Granting Permissions
3.4.2 Removing Permissions
3.5 Statistical Database Security 66
3.5.1 Types of Disclosures
3.5.2 Security vs. Decisions
3.5.3 Security and Statistical Queries
3.6 Multilevel Security 68
3.7 Audit Trails in the Databases 69
3.8 Examples of Vendor-Specific E-Security 70
3.9 Summary 71
3.10 Solutions/Answers 72
3.11 Further Reading 72
3.0 INTRODUCTION
As the use of Internet technology is growing for both the Intranet and the Internet,
information security is becoming exceedingly crucial for organisations. The World
Wide Web provides a convenient, cheap, easily accessible and instantaneous way of
information dissemination. It makes the dissemination of very easy but, it is equally
important to ensure that information should only be accessible information to rightful
users who have access rights to it.
With many organisations using database based dynamic web pages, corporate
information security has become extremely important. Earlier, strict database access
or specialised client software was required for viewing the data, but today a simple
web browser is sufficient to view data in a database that is not properly protected.
Thus, information security is at a vulnerable stage. Hence, the more a computing firm
moves from the mainframe of the client/server to the Internet the more possibilities of
security penetration.
59
DBMS Advanced
Features and 3.1 OBJECTIVES
Distributed Database
After going through this unit, you should be able to:
60
Database security is of paramount importance for an organisation, but many Database Security and
organisations do not take this fact into consideration, till an eventual problem occurs. Authorisation
The common pitfalls that threaten database security are:
Weak User Account Settings: Many of the database user accounts do not contain the
user settings that may be found in operating system environments. For example, the
user accounts name and passwords, which are commonly known, are not disabled or
modified to prevent access.
The user account settings allow limited capabilities for security, without password
controls on dictionary checks or account controls supporting expiration of user
account.
Insufficient Segregation of Duties: No established security administrator role is
defined in the database management of the organisation. This results in database
administrators (DBAs) performing both the functions of the administrator (for users
accounts), as well as the performance and operations expert. This may result in
management inefficiencies.
Inadequate Audit Trails: The auditing capabilities of databases since it require
keeping track of additional requirements, are often ignored for enhanced performance
or disk space. Inadequate auditing results in reduced accountability. It also reduces the
effectiveness of data history analysis. The audit trails records information about the
actions taken on certain critical of data. They log events directly associated with the
data, thus, they are essential for monitoring the access and the activities on a database
system.
Unused DBMS Security Features: The security of an individual application is
usually independent of the security of the DBMS. Please note that security measures
that are built into an application apply to users of the client software only. The
DBMS itself and many other tools or utilities that can connect to the database directly
through ODBC or any other protocol, may bypass this application level security
completely. Thus, you must try to use security restrictions that are reliable, for
instance, try using security mechanism that are defined within the database.
Basically database security can be broken down into the following levels:
• Server Security
• Database Connections
• Table Access Control
• Restricting Database Access.
3.3.1 Server Security
Server security is the process of controlling access to the database server. This is the
most important aspect of security and should be carefully planned.
The basic idea here is “You cannot access what you do not see”.
For security purposes, you should never let your database server be visible to the
world. If a database server is supplying information to a web server then it should be
configured in such a manner that it is allowed connections from that web server only.
Such a connection would require a trusted IP address.
Trusted IP Addresses
To connect to a server through a client machine, you would need to configure the
server to allow access to only trusted IP addresses. You should know exactly who
should be allowed to access your database server. For example, if it is the back end of
a web server, then only that web server address should be allowed access to the
database server. If the database server is the back end of a local application that is
running on the internal network, then it should only talk to addresses from within the
internal network.
3.3.2 Database Connections
61
DBMS Advanced With the ever-increasing number of Dynamic Applications, an application may allow
Features and
immediate unauthenticated updates to some database. If you are going to allow users
Distributed Database
make updates to some database via a web page, please ensure that you validate all
such updates. This will ensure that all updates are desirable and safe. For example,
you may remove any possible SQL code from a user-supplied input. If a normal user
does not input SQL code then we need not allow such data to be submitted.
• Special Tools : Some customised tools, for example, Real Secure, send an alert
when an external server is attempting to breach your system security. There are
many such similar products available for the protecting of the DBMS from
unauthorised Internet access.
An excellent practice is to create individual user accounts for each database user.
Although, sharing of user accounts among various users is possible or even one user
62
account can be created for each type of user, however, such a practice should be Database Security and
discouraged. Why? It could be because of the following reasons: Authorisation
It will eliminate individual accountability: If any one of the users make a change in
the database, we will not be able to trace it back to a specific individual even after
going through audit logs. Imagine what would happen when a specific user leaves the
organisation and his or her access from the database is to be removed? It will require
change in the password and this will cause inconvenience to other users.
Thus, it is important that we provide separate user accounts for separate users.
Does this mechanism have any drawbacks? If the expected number of database users
are small then it is all right to give them individual user name and passwords and all
the database access privileges that they need to have on the database items.
However, consider a situation when there are a large number of users. Specification
of access rights to all these users individually will take a long time. That is still
manageable as it may be a one time effort, however, the problem will be compounded
if we need to change the access right for a particular type of users. Such an activity
would require a huge maintenance cost. This cost can be minimised if we use a
specific concept called “Roles”. A database may have hundreds of users but their
access rights may be categorised in specific roles for example, teachers, student in a
university database. Such roles would require specification of access rights only once
for the role. The users then can be assigned username, password and specific role.
Thus, the maintenance of user accounts becomes easier as now we have limited roles
to be maintained.
Let us explain SQL related security commands in more details.
3.4.1 Granting Permissions
You would need to create the users or roles before you grant them permissions. Then
permissions can be granted to a user or a role. This can done with the use of the SQL
GRANT statement.
The syntax of this statement is:
GRANT <permissions>
[ON <table>]
TO <user/role>
[WITH GRANT OPTION]
Now, let us define this statement line-by-line. The first line, GRANT <permissions>,
allows you to specify the specific permissions on a table. These can be either relation-
level data manipulation permissions (such as SELECT, INSERT, UPDATE and
DELETE) or data definition permissions (such as CREATE TABLE, ALTER
DATABASE and GRANT). More than one permission can be granted in a single
GRANT statement, but data manipulation permissions and data definition permissions
may not be combined in a single statement.
The second line, ON <table>, is used to specify the table on which permissions are
being given. This line is not needed if we are granting data definition permissions.
The third line specifies the user or role that are being granted permissions.
Finally, the fourth line, WITH GRANT OPTION, is optional. If this line is included in
the statement, the user is also permitted to grant the same permissions that s/he has
received to other users. Please note that the WITH GRANT OPTION cannot be
specified when permissions are assigned to a role.
63
DBMS Advanced Example 1: Assume that you have recently hired a group of 25 data entry operators
Features and
who will be adding and maintaining student records in a university database system.
Distributed Database
They need to be able to access information in the STUDENT table, modify this
information and add new records to the table. However, they should not be able to
entirely delete a record from the database.
Solution: First, you should create user accounts for each operator (please refer to
MCS-023, Block 2, Unit-1) and then add them all to a new role-Dataentry. Next, we
would need to use the following SQL statement to grant them the appropriate
permissions:
GRANT SELECT, INSERT, UPDATE
ON STUDENT
TO Dataentry
And that is all that you need to do. Let us now examine a case where we are assigning
data definition permissions.
Example 2: We want to allow members of the DBA role to add new tables to our
database. Furthermore, we want them to be able to grant other users permission to do
the same.
Solution: The SQL statement to do so is:
GRANT CREATE TABLE
TO DBA
WITH GRANT OPTION
Notice that we have included the WITH GRANT OPTION line to ensure that our
DBAs can assign this permission to other users.
At this point, we have discussed how to assign permissions to users and roles as
necessary. We will now look at the methods for removing permissions from users.
3.4.2 Removing Permissions
Once we have granted permissions, it may be necessary to revoke them at a later date.
SQL provides us with the REVOKE command to remove granted permissions. The
following is the syntax of this command:
REVOKE [GRANT OPTION FOR] <permissions>
ON <table>
FROM <user/role>
Please notice that the syntax of this command is almost similar to that of the GRANT
command. Please also note that the WITH GRANT OPTION is specified on the
REVOKE command line and not at the end of the command as was the case in
GRANT. As an example, let us imagine we want to revoke a previously granted
permission to the user Usha, such that she is not able to remove records from the
STUDENT database. The following commands will solve the problem:
REVOKE DELETE
ON STUDENT
FROM Usha
There is one additional mechanism supported by some commercial DBMS that is
worth discussing − the DENY command. This command can be used to explicitly
deny permission to a user that s/he might otherwise have received because of his/her
membership of a role. Here is the syntax:
DENY <permission>
ON <table>
TO <user/role>
Consider the last problem again, let us imagine that Usha was also a member of the
Teachers role that also had access to the STUDENT table. The previous REVOKE
64
statement would not be sufficient to deny her access to the table. It will remove the Database Security and
permission granted to her through a GRANT statement, but would not affect the Authorisation
permissions gained through her membership in the Teachers role. However, if we use
a DENY statement it will block permission for any role. Here is the command:
DENY DELETE
ON STUDENT
TO Usha
Thus DENY command creates a “NOT PERMITTED” statement in the database
access controls. If we later want to give Usha permission to remove student records
again from the STUDENT table, we cannot simply use the GRANT command. This is
because of the fact that the GRANT command permission to DELETE record would
be overridden by the existing DENY. Thus, first we use the REVOKE command to
remove the DENY Not permission as:
REVOKE DELETE
ON STUDENT
FROM Usha
Please notice that this command is exactly the same as the REVOKE used to remove a
granted permission. Thus, the DENY and GRANT commands both work in a similar
fashion -- they both create permissions in the database access control mechanism. The
REVOKE command removes all such permissions for the specified user. Once this
command has been issued, Usha will be able to delete student records from the table if
she is a member of a role that possesses that permission. You can also issues a
GRANT command to provide the DELETE permission to Usha’s account.
The access control mechanisms supported by the Standard Query Language is a good
starting point, but you must look into the DBMS documentation to locate the
enhanced security measures supported by your system. You will find that many
DBMS support more advanced access control mechanisms, such as granting
permissions on specific attributes.
……………………………………………………………………………………
……………………………………………………………………………………
4) What are the different ways of preventing open access to the Internet?
……………………………………………………………………………………
……………………………………………………………………………………
5) Write the syntax for granting permission to alter database.
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
6) Write the syntax for ‘Revoke Statement’ that revokes with grant option.
65
DBMS Advanced
Features and ……………………………………………………………………………………
Distributed Database
……………………………………………………………………………………
……………………………………………………………………………………
7) What does DENY command do?
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
66
Let us discuss some of the queries that may result in the disclosure of sensitive data. Database Security and
Consider the relation in the following Table: Authorisation
Assume that a student can not only view his/her details in the Table, but also the
names of his/her colleagues, and that s/he is allowed to make queries as well. Let us
see how s/he can attack the database.
Simple Attacks: A simple form of direct attack may be by using the following type
of query:
SELECT name
FROM STUDENT
WHERE (Hostel = ‘Yamuna’ AND Gender = ‘F’).
The query above will show the result as ‘Himani’. Thus, the information that Himani
stays in Yamuna hostel has been disclosed. Please note this is a direct query and can
be caught, but a person can hide this query in many ways, without changing the basic
meaning of the query.
But how do we stop such disclosures? A very simple solution in this case may be: If a
query that processes N records, however produces very few records (M) such that
N>>M then this query may compromise security and should not be allowed to
produce results.
Inference Based Attacks: Such an attack is very interesting case for determination of
data through mathematical logic. For example, to determine the age of the female
candidate, a series of commands can be used for determining the required information.
These commands may be:
(i) Determine the sum of age of all the female candidates,
(ii) Determine the sum age of female candidates not residing in Hostel Yamuna.
Since all these queries will result in a sizable number of records they would be
answered, however, they can be used to determine the age of ‘Himani’ who stays in
Yamuna and is a sole female student staying there as:
Age of Himani= Result of Query (i) – Result of Query (ii).
Similarly many statistical functions like average, count, sum and their combinations
can be used on various combinations of records. This sequence may be used to
disclose the sensitive database values.
Thus, the database security has been compromised. In such situation the solution may
be – not to allow consecutive queries whose output record set intersection is very
small.
But how actually these problems be solved? Let us discuss the solution to such
problems in the next subsection.
67
DBMS Advanced i) Controlling the queries themselves, (such solutions may help in solving the
Features and
queries that can be identified as causing problems).
Distributed Database
ii) The queries that result in limited value can be checked by either rejecting a
query. If the result set size is too small, it is also called ‘suppression’ or if the
information that is to be displayed as a result of the query is changed slightly so
that it does not match the actual value it is also called concealing.
) Check Your Progress 2
1)
Subject Neha Richa Neelam
Maximum
Marks = 100
Maths 50 70 90
Science 60 80 50
Total 110 150 140
Write a sequence of queries that would disclose the name of the person who
scored the highest marks.
3) With ……………………… sensitive data values are not provided; the query is
rejected without response.
Encryption
68
Encryption of critical information may help in maintaining security as a user who Database Security and
accidentally receives them cannot interpret the data. Such a scheme may be used when Authorisation
a user password file is implemented in the database design. However, the simple
encryption algorithms are not secure, also since data is available in the database it may
also be obtained in response to a query.
There are many more schemes to handle such multi-level database security. These
references are given in the further reading.
69
DBMS Advanced
Features and 3.8 EXAMPLES OF VENDOR-SPECIFIC
Distributed Database
E-SECURITY
Individual vendors largely determine the security schemes that may be implemented
to provide the link between the database and its interfaces. Following are some of the
security components provided by the major vendors. Like client/server systems,
security solutions must be combined together using multiple vendor products.
Oracle
Oracle, provides SSL and S-HTTP security. Oracle uses Java as a basic component of
its security model. The company created its Oracle Web Server to work most
effectively with Oracle clients such as the solutions created with the Developer/2000
or other development tools.
Oracle modified the HTTP protocol to allow a straight/direct connection between the
client and the server. This connection defines a session in which the user is identified
by a generated ID.
These enhancements are also present in the Secure Network Server (SNS) that is
included in the Oracle Universal Database a single login permits access to any Oracle
database in an enterprise system.
The Java security classes are used by the oracle development tools to give complete
security integration to the client.
Sybase
Sybase provides a rather elegant way of protecting data access through the Web. It
extends the logon security present in the Web server to the database server for
authentication. Thus, it takes advantage of the native security present in the database.
Sybase provides a middleware called Web.sql that is used to interface with the
Netscape Web servers.
Informix
Informix, like Sybase, relies on the logon security present in the Web server.
Therefore, any database access is specified through traditional ODBC-type login
channels that passes the user and password information through the connectivity
middleware. Specific drivers known as Universal Web Connect integrates Informix
database security with Microsoft Web servers.
Microsoft
Microsoft has included most of the key security technologies with Internet
Information Server (IIS). For user authentication, Microsoft provides its tried-and-true
challenge/response mechanism. Traditional login on the Web presents the same
security as in the basic Windows NT login. Unfortunately, only Microsoft Internet
Explorer browser supports this login approach.
For database access, IIS security has been integrated with Microsoft SQL Server
through the Internet Database Connector. Although, users must login through an
HTML login form, the information may be verified by a SQL Server stored procedure.
Microsoft has also integrated the Kerberos security architecture into Windows NT
Server. By releasing the server, Microsoft hopes to integrate the Kerberos native to the
NT Server with public key security. Microsoft has already released a Certificate
Server API in an attempt to create a Certificate Server standard.
Netscape
Netscape Communications intends its suite of servers as a complete system for
security on the Internet. Login occurs originally through the browser and then, as in
the Novell Directory Services, all certification is unified in this model. Therefore,
70
once login to the browser occurs, any resources that are permitted to the user are now Database Security and
accessible. Authorisation
Currently, user authentication occurs by passing information to the data source via the
middleware. Most companies, including Sybase, Oracle, and Informix, provide the
necessary connectors for this process.
3.9 SUMMARY
This unit provides basic information about database security. It introduces various
levels of database security. Some of the information that is covered in this unit include
the commands to GRANT and REVOKE assess rights. In addition, a command
DENY has also been discussed. Please note DENY is not available in all DBMSs. We
have then discussed security in databases with statistical queries. We have also
suggested certain mechanism to ensure data base security, even through statistical
queries may be allowed-definitely with some restriction. We have also defined the
concept of audit trail and given few DBMS security support. You must go through
any commercial DBMS documents for more details on security implemented in them.
3.9 SOLUTIONS/ANSWERS
Check Your Progress 1
1) Second graded Bunkers.
2) Operating System,
Application that use the database,
Service that interact, and
The Web Server.
3) Server Security
4) Trusted IP address.
Server Account Disabling
Special Tools, Example: Real source by ISS.
71
DBMS Advanced 5) GRANT ALTER DATABASE TO Usha
Features and
Distributed Database
6) REVOKE GRANT OPTION FOR <permissions>
ON <table>
FROM <user/role>
72