Database Security U1
Database Security U1
Database Security U1
in
Smartworld.asia Specworld.in
DATABASE SECURITY
UNIT-1
INTRODUCTION:
• INTRODUCTION TO DATA BASE SECURITY PROBLEM
IN DATABASE SECURITY CONTROLS CONCLUSIONS:
At its core, database security strives to insure that only authenticated users
perform authorized activities at authorized times. While database security
incorporates a wide array of security topics, notwithstanding, physical security,
network security, encryption and authentication, this paper focuses on the
concepts and mechanisms particular to securing data. Within that context,
database security encompasses three constructs: confidentiality or protection of
data from unauthorized disclosure, integrity or prevention from unauthorized data
access, and availability or the identification of and recovery from hardware and
software errors or malicious activity resulting in the denial of data availability.
pg. 1
Smartzworld.com 1 jntuworldupdates.org
Smartworld.asia Specworld.in
INTRODUCTION
The Verizon Business Risk Team, who have been reporting data breach statistics
since 2004, examined 90 breaches during the 2008 calendar year. They reported
that more than 285 million records had been compromised, a number exceeding
pg. 2
Smartzworld.com 2 jntuworldupdates.org
Smartworld.asia Specworld.in
the combined total from all prior years of study (Baker et al., 2009). Their
findings provide insight into who commits these acts and how they occur.
Consistently, they have found that most data breaches originate from external
sources, with 75% of the incidents coming from outside the organization as
compared to 20% coming from inside. They also report that 91% of the
compromised records were linked to organized criminal groups. Further, they cite
that the majority of breaches result from hacking and malware often facilitated by
errors committed by the victim, i.e., the database owner. Unauthorized access and
SQL injection were found to be the two most common forms of hacking, an
interesting finding given that both of these exploits are well known and often
preventable. Given the increasing number of beaches to database systems, there is
a corresponding need to increase awareness of how to properly protect and
monitor database systems.
At its core, database security strives to insure that only authenticated users
perform authorized activities at authorized times. It includes the system,
processes, and procedures that protect a database from unintended activity. The
Defence Information Systems Agency of the US Department of Defence (2004),
in its Database Security Technical Implementation Guide, states that database
security should provide “controlled, protected access to the contents of your
database and,in the process, preserve the integrity, consistency, and overall quality
of your data” (p. 9). The goal is simple, the path to achieving the goal, a bit more
complex. Traditionally database security focused on user authentication and
managing user privileges to database objects (Guimaraes, 2006).
pg. 3
Smartzworld.com 3 jntuworldupdates.org
Smartworld.asia Specworld.in
the material. Further, many topics related to database security are complex and
require students to engage in active learning to fully comprehend the fundamental
nature of database security issues. This paper presents a set of subtopics for
inclusion in a database security component of a course. These sub-topics are
illustrated using a set of interactive software modules.
pg. 4
Smartzworld.com 4 jntuworldupdates.org
Smartworld.asia Specworld.in
DATABASE VULNERABILITY
A Vulnerability Database is a platform aimed at collecting, maintaining, and
disseminating information about discovered vulnerabilities targeting real
computer systems. Currently, there are many vulnerabilities databases that have
been widely used to collect data from different sources on software vulnerabilities
(e.g., bugs). These data essentially include the description of the discovered
vulnerability, its exploitability, its potential impact, and the workaround to be
applied over the vulnerable system. Examples of web-based vulnerabilities
pg. 5
Smartzworld.com 5 jntuworldupdates.org
Smartworld.asia Specworld.in
databases are the National Vulnerability Database and the Open Source
Vulnerability Database.
Security breaches are an increasing phenomenon. As more and more databases are
made accessible via the Internet and web-based applications, their exposure to
security threats will rise. The objective is to reduce susceptibility to these threats.
Perhaps the most publicized database application vulnerability has been the SQL
injection. SQL injections provide excellent examples for discussing security as
they embody one of the most important database security issues, risks inherent to
non-validated user input. SQL injections can happen when SQL statements are
dynamically created using user input. The threat occurs when users enter
malicious code that ‘tricks’ the database into executing unintended commands.
The vulnerability occurs primarily because of the features of the SQL language
that allow such things as embedding comments using double hyphens (- -),
concatenating SQL statements separated by semicolons, and the ability to query
metadata from database data dictionaries. The solution to stopping an SQL
injection is input validation. A common example depicts what might occur when a
login process is employed on a web page that validates a username and password
against data retained in a relational database. The web page provides input forms
for user entry of text data. The user-supplied text is used to dynamically create a
SQL statement to search the database for matching records. The intention is that
valid username and password combinations would be authenticated and the user
permitted access to the system. Invalid username and passwords would not be
authenticated. However, if a disingenuous user enters malicious text, they could,
in essence, gain access to data to which they have no privilege. For instance, the
following string, ' OR 1=1 -- entered into the username textbox gains access to the
pg. 6
Smartzworld.com 6 jntuworldupdates.org
Smartworld.asia Specworld.in
system without having to know either a valid username or password. This hack
works because the application generates a dynamic query that is formed by
concatenating fixed strings with the values entered by the user.
For example, the model SQL code might be:
When a user enters a valid username, such as ‘Mary’ and a password of ‘qwerty’,
the SQL query
becomes:
WHERE UserName=‘Mary’
AND Password=‘qwerty’;
However, if a user enters the following as a username: ‘OR 1=1 -- the SQL query
becomes:
AND Password=‘‘;
The expression 1 = 1 is true for every row in the table causing the OR clause to
return a value of true. The double hyphens comment out the rest of the SQL query
string. This query will return a count greater than zero, assuming there is at least
one row in the users table, resulting in what appears to be a successful login. In
fact, it is not. Access to the system was successful without a user having to know
either a username or password. Another SQL injection is made possible when a
database system allows for the processing of stacked queries. Stacked queries are
the execution of more than one SQL query in a single function call from an
application program. In his case, one string is passed to the database system with
pg. 7
Smartzworld.com 7 jntuworldupdates.org
Smartworld.asia Specworld.in
This string when passed as an SQL query will result in the execution of two
queries. A listing of all information for all products will be returned. In addition
the Customers table will be removed from the database. The table structure will be
deleted and all customer data will be lost. In database systems that do not allow
stacked queries, or invalidate SQL strings containing a semicolon this query
would not be executed.
The ADbC courseware sub-module for SQL injections demonstrates the insertion
of malicious code during the login process. The sub-module steps through the
process by first showing the entry of valid data and then demonstrating entry of
malicious code, how it is injected into a dynamically created SQL statement and
then executed. Figure 5 shows the step where malicious code is entered. Figure 6
shows the dynamically created SQL command and the resulting display of all the
data in the user table. Additional steps present code resulting in the modification
or deletion of data.
pg. 8
Smartzworld.com 8 jntuworldupdates.org
Smartworld.asia Specworld.in
DATABASE INFERENCE
pg. 9
Smartzworld.com 9 jntuworldupdates.org
Smartworld.asia Specworld.in
The ADbC inference sub-module includes three animations that demonstrate how
users might be able to put together (infer) information when data is available to
those with a higher security access level or when they are only given access to
aggregate data. Inference often happens in cases where the actual intent is for
users to generate or view aggregate values when they have not been given access
to individual data items. However, because they are exposed to information about
the data, they are sometimes able to infer individual data values. Take for example
a scenario where a worker desires to find out their co-worker Goldberg’s salary In
this organization, salary data is confidential. The worker has rights to generate
aggregate data such as summarizing organizational salary data averaged across
specific criteria (i.e., salary averaged by gender). Although the worker does not
have access to individual data items, he or she does possess particular and unique
details about Goldberg; specifically that Goldberg is a female and has 11
dependents. Based on this information, the worker can derive an aggregate
function such as
pg. 10
Smartzworld.com 10 jntuworldupdates.org
Smartworld.asia Specworld.in
This will return Goldberg’s salary because the average is taken from an
aggregated data set of one. The ADbC inference sub-module animation for this
scenario is illustrated in Figure 7. The SQL-command window depicts the
construction of the requested query to ascertain salary averages. Employees Table
data is shown in the upper left and underneath is the result of the query
Inference can also occur when users are able to ascertain information from data
accessible to them at their security level even though that specific information is
protected at a higher security access level. It is difficult to explain this without the aid
of a demonstration. The second example in the ADbC Inference sub-module provides
a scenario where specific data, in this case company product prototype data, is not
made accessible to junior employees. However, junior employees are given access to
update the Storage table that tracks the contents in company storage areas. When
perusing this table, the junior employee is not able to read any rows containing
prototype products. The problem occurs if the employee tries to update a protected
row. This triggers an error message. Based on the error message, the junior employee
pg. 11
Smartzworld.com 11 jntuworldupdates.org
Smartworld.asia Specworld.in
could surmise that information was being hidden and might infer that something of a
secretive nature was being stored in the storage compartment referenced in the update
request. Figure 8 depicts an error being generated when a junior employee issues a
query against a protected row of data. The table on the top right shows all of the data
contained in the Storage table. The table on the bottom shows the data accessible to
junior employees. Notice that Compartment B containing ProductX is not displayed in
the lower table. A possible solution to this inference problem is polyinstantiation.
Polyinstantiation allows a database to retain multiple records having the same primary
key; they are uniquely distinguished by a security level identifier. If polyinstantiation
were enacted in the proceeding scenario, the insert would be successful. However,
this does not prevent the ‘double booking’ of the storage compartment area.
pg. 12
Smartzworld.com 12 jntuworldupdates.org
Smartworld.asia Specworld.in
AUDITING
Database auditing is used to track database access and user activity. Auditing
can be used to identify who accessed database objects, what actions were
performed, and what data was changed. Database auditing does not prevent
security breaches, but it does provide a way to identify if breaches have occurred.
Common categories of database auditing include monitoring database access
attempts, Data Control Language (DCL) activities, Data Definition Language
(DDL) activities, and Data Manipulation Language (DML) activities (Yang,
2009). Monitoring access attempts includes retaining information on successful
and unsuccessful logon and logoff attempts. DCL audits record changes to user
and role privileges, user additions, and user deletions. DDL audits record changes
to the database schema such as changes to table structure or attribute datatypes.
DML audits record changes to data. In addition, database errors should be
monitored (Yang, 2009).
pg. 13
Smartzworld.com 13 jntuworldupdates.org
Smartworld.asia Specworld.in
Database auditing is implemented via log files and audit tables. The real
challenge of database auditing is deciding what and how much data to retain and
how long to keep it. Several options exist. A basic audit trail usually captures user
access, system resources used, and changes made to the structure of a database.
More complete auditing captures data reads as well as data modifications. The
ADbC auditing sub-module provides step-by-step examples for creating audits of
user sessions, changes to database structure, and modifications to data. Figure 9
shows an example of code required to implement and trigger an audit of a user
login. Data recorded includes the username and the date and time of the user login
and
Figure 9. ADbC Database Audit Sub-module: Monitoring User Logins
An audit trail provides a more complete trace recording of not only user access but
also user actions.
This type of facility is included with many database management systems. The most
common items that are audited include login attempts, data read and data
modifications operations, unsuccessful attempts to access database tables, and
attempts to insert data that violates specific constraints. Figure 10 shows an example
audit trail of user access and user actions as demonstrated in the Audit Command
animation in the ADbC Database Audit sub-module. The SQL Commands window
displays the SQL statement used to retrieve data from the audit table.
pg. 14
Smartzworld.com 14 jntuworldupdates.org
Smartworld.asia Specworld.in
Figure 10. ADbC Database Audit Sub-module: Example Database Audit Trail
CONCLUSION
The need to secure computer systems is well understood and securing data must
be part of an overall computer security plan. Growing amounts of sensitive data
are being retained in databases and more of these databases are being made
accessible via the Internet. As more data is made available electronically, it can be
assumed that threats and vulnerabilities to the integrity of that data will increase as
pg. 15
Smartzworld.com 15 jntuworldupdates.org
Smartworld.asia Specworld.in
Data handling related to when you view, update, delete, transfer, mail, store, or
destroy data. It also relates to how you transfer the data from one location to
another. Data is not always stored electronically. Occasionally it could be paper
stored in a filing cabinet or in a binder.
pg. 16
Smartzworld.com 16 jntuworldupdates.org
Smartworld.asia Specworld.in
pg. 17
Smartzworld.com 17 jntuworldupdates.org
Smartworld.asia Specworld.in
used only if backed up by a court order. Opponents of this scheme argue that
criminals could hack Into the key-escrow database and illegally obtain, steal,
or alter the keys. Supporters claim that while this is a possibility,
implementing the key escrow scheme would be better than doing nothing to
prevent criminals from freely using encryption/decryption.
• Transaction security:
• Audit trail: A record showing who has accessed a computer system and what
operations he or she has performed during a given period of time. Audit trails
are useful both for maintaining security and for recovering lost transactions.
Most accounting systems and database management systems include an audit
trail component. In addition, there are separate audit trail software products
that enable network administrators to monitor use of network resources.
Secure storage: Storage security is the group of parameters and settings that
make storage resources available to authorized users and trusted networks - and
unavailable to other entities. These parameters can apply to hardware,
programming, communications protocols, and organizational policy.
pg. 18
Smartzworld.com 18 jntuworldupdates.org
Smartworld.asia Specworld.in
security holes. Updates to the operating system, supplied by the platform vendor,
should be installed on a regular basis. Redundancy, in the form of identical (or
mirrored) storage media, can help prevent catastrophic data loss if there is an
unexpected malfunction. All users should be informed of the principles and
policies that have been put in place governing the use of the network.
pg. 19
Smartzworld.com 19 jntuworldupdates.org
Smartworld.asia Specworld.in
Secure Connection
A wired home network is when you connect your computer or other compatible
device to your Virgin Media Hub or Super Hub with an Ethernet cable. With the
introduction of wireless routers, it’s less common these days for a home to only
use a wired network.
The best thing about a wired connection is the reliability and speed it gives you
(wired is faster than wireless). This makes it ideal for things that use a lot of
bandwidth, like playing online games on your Xbox.
What’s not?
A wireless network is when your computer (or other wireless compatible device) is
connected to your Virgin Media Hub or Super Hub without any wires.
pg. 20
Smartzworld.com 20 jntuworldupdates.org
Smartworld.asia Specworld.in
Want to check your emails on your laptop in the garden? No problem. Want to tell
your friends what you’ve been up to on Facebook? You can do that too.
And because you can connect lots of different devices to the web, everyone in your
home can go online at the same time.
What’s not?
how the sending device will indicate that it has finished sending a message how
the receiving device will indicate that it has received a message
There are a variety of standard protocols from which programmers can choose.
Each has particular advantages and disadvantages; for example, some are simpler
than others, some are more reliable, and some are faster.
pg. 21
Smartzworld.com 21 jntuworldupdates.org
Smartworld.asia Specworld.in
From a user's point of view, the only interesting aspect about protocols is that
your computer or device must support the right ones if you want to communicate
with other computers. The protocol can be implemented either in hardware or in
software.
c) Monitor for attacks: Local cellular operators monitor traffic in a bid to pick
up and stop distributed denial of service (DDOS) attacks, before they have a
major impact on service levels to subscribers.
DDOS attacks make use of multiple compromised systems, often infected with
a Trojan, to target a single system, which leads to a denial of service attack.
Victims of these attacks include the end targeted system and all systems
maliciously used and controlled by the hacker.
The only way to pick up the intrusion is to monitor the traffic in real-time to
detect unusual patterns, says Fryer. He adds that most mobile operators and
Internet service providers have deployed a DDOS mechanism, which forms
part of a global DDOS monitoring centre.
Most of the deployments have updated blacklisting capabilities to fend off
attackers, says Fryer. He adds that real-time monitoring is more effective, and
allows Vodacom to block the source IP, although hackers then come back with
a different address.
d) Virus: A computer virus is a computer program that can replicate itself and
spread from one computer to another. The term "virus" is also commonly, but
erroneously, used to refer to other types of malware, including but not limited
to adware and spyware programs that do not have a reproductive ability.
pg. 22
Smartzworld.com 22 jntuworldupdates.org
Smartworld.asia Specworld.in
to the computer user, but many are surreptitious or simply do nothing to call
attention to themselves. Some viruses do nothing beyond reproducing themselves.
One common method of attack involves saturating the target machine with
external communications requests, so much so that it cannot respond to legitimate
traffic, or responds so slowly as to be rendered essentially unavailable. Such
attacks usually lead to a server overload. In general terms, DoS attacks are
implemented by either forcing the targeted computer(s) to reset, or consuming its
resources so that it can no longer provide its intended service or obstructing the
communication media between the intended users and the victim so that they can
no longer communicate adequately.
pg. 23
Smartzworld.com 23 jntuworldupdates.org
Smartworld.asia Specworld.in
talking directly to each other over a private connection, when in fact the entire
conversation is controlled by the attacker. The attacker must be able to intercept
all messages going between the two victims and inject new ones, which is
straightforward in many circumstances (for example, an attacker within reception
range of an unencrypted Wi-Fi wireless access point, can insert himself as a man-
in-the-middle).
A man-in-the-middle attack can succeed only when the attacker can impersonate
each endpoint to the satisfaction of the other — it is an attack on mutual
authentication (or lack thereof). Most cryptographic protocols include some form
of endpoint authentication ecifically to prevent MITM attacks. For example, SSL
can authenticate one or both parties using a mutually trusted certification
authority.
f) Trusted IP addresses: When you set up your secure zone you can add trusted
IP addresses to is by selecting 'Trusted IP Addresses' menu item. When you
trust one or more IP addresses, any visitor accessing secure content inside
your secure zone will gain instant access to that content without needing to be
registered or log in. Its a great feature for intranet setups such as internal
faculty and staff pages in universities, or even corporate directories.
There are many ways to develop a role-based security system. All of them
start with the definition of various roles and what users assigned to those roles
can and can’t do or see. The resulting levels of functionality must be coded
into the system using specific parameters.
pg. 24
Smartzworld.com 24 jntuworldupdates.org
Smartworld.asia Specworld.in
Any role-based security system depends on the code's ability to correctly and
thoroughly control a given user by his or her assigned role and therefore guard
against unauthorized use of proprietary identifiers of a specific role.
Alternative models include mandatory access control, where certain specifics
are coded into an operating system, and discretionary access control, where
some elements of security may be more flexible. For example, a more
privileged user may be able to "pass" access to another user in a simple
discretionary event or process.
The port mirroring process is generally hidden from the source and other
nodes on the network.
Port mirroring is also known as switched port analyzer (SPAN) and roving
analysis port (RAP).
pg. 25
Smartzworld.com 25 jntuworldupdates.org
Smartworld.asia Specworld.in
pg. 26
Smartzworld.com 26 jntuworldupdates.org