Professional Documents
Culture Documents
Difficulty
There are some actual issues with Oracle Security. There is a new
book The Oracle Hacker’s Handbook written by David Litchfield. It
covers possible methods to attack the Oracle server. Some of the
examples shown in that book are based on traffic sniffing, direct
access to Oracle's Shared Global Memory, or just accessing the
raw data files.
S
ome of these risks could be prevented the OS Authentication case, security is traded
by adding Advanced Security features to for comfort resulting in a less secure environ-
an already existent database. This does ment. Network authentication is implemented
not mean that you would open the box and a using Secure Socket Layer or the help of
perfect unique shield will protect your database. Third-Party Services. These could for exam-
It does not work like this. All these features must ple be Kerberos or PKI-based authentications.
be carefully planned and velvety implemented. In my opinion the most commonly used meth-
In the event of a system crash/ configuration od of authentication is the Oracle Database is
error your data may never be recovered other- the text password. Thus far it achieves decent
wise. However if the implementation is carefully security, and ease of use. However this is all
planned, and you have an experienced DBA governed by the complexity of the password
there is way to better defend your database. as well as it's resistance to social engineering.
There is no need to install any other system
Authentication authentication. Nor is it a simple walk around
Authentication means verifying the identity of a poorly secured operating system. Database
subject who wants to access database objects.
When authentication is successfully passed,
authorization processes comes into play. Au- What you will learn...
thorization is the process that controls access
• What is Oracle Wallet,
to database objects. There are different meth- • What is Transparent Data Encryption,
ods of authentication. The most commonly • What is Oracle Advanced Security.
used are authentication by the Operating Sys-
tem, Network, Database, Multi-Tier System, or
What you should know...
Secure Socket Layer. When OS Authentica-
tion is used there is no need for any further • Basic knowledge of SSL,
validation. Users can connect to database just • Basic knowledge of computer Cryptography
by running the database client (e.g. sqlplus). In
authentication is based on the layer that handles queries and user esses. First is to ensure that only
comparison of a given username/ controls. Multiple users can access certain users can access, process,
password combination. As well as a data server without separate con- or alter data. The second is to ap-
information encrypted and stored in nections for each of them. For these ply limitations on user access or
a data dictionary. Users can change purposes an Oracle Call Interface actions (e.g. limitations of objects
their passwords at any time. One could be used. It has some advan- and/or resources). When speaking
of the basic tasks in securing the tages but generally it is not recom- of authorization – One of the first
database should be enabling pass- mended due to poor security. Once questions to ask is what privileges
word encryption while connecting, an account has been compromised a particular user has? A privilege is
account locking, password lifetime the attacker gains full access to the a right to execute a particular type
and expiration, password history application, and may seek higher of SQL statement or to access an-
and password complexity verifica- account privileges. other user’s object. Privileges could
tion. These requests are explained be granted to a user one by one or
in detail in the Oracle Database Authorization in groups through roles. Roles are
Security Guide. This was my prior Post-authentication tasks (that incorporated into the database to
reference source for this article. My verifies user identity) have to control simplify the process of adminis-
intentions were not to rewrite the user's access to database objects. trating users and their rights to do
entire manual. I wanted to give you At first we used profiles and iden- something in the database. There
short overview and save you sev- tification methods to complete the are two main categories of privi-
eral hours of reading. Other ways first task. Now we need to manipu- leges. System privileges should be
to control access to the database is late privileges, roles, profiles and granted with care. They should
to create Multi-Tier Application. This resource limitations. The authori- never be given to common database
provides access to database with a zation consists of two main proc- users. They should be granted only
to administrators and application
developers. The SQL statements to
Tables that are Used to Build the Views use with privileges are GRANT and
REVOKE. There is one unique fac-
• user$ – table of users identified by name, type and number.
tor about privileges in Oracle. It is
• defrole$ – default roles (columns are user# and role#).
possible to grant privileges with the
• objauth$ – table of authorization.
admin option. This option allows the
• sysauth$ – system authorization (system privileges, grantee, options).
• ts$ – tablespaces.
target user to grant or revoke such
• obj$ – Objects. Identifies objects by name, type and owner number. privileges to/from another person.
• cols$ – Columns. Object privileges control user’s ac-
• profile$ – Connects profiles and resource privileges. cess to tables, views, procedures,
• resource _ map – description of resources. functions or packages.
• system _ privilege _ map – description of system privileges.
• table _ privilege _ map – description of auditing privileges. Concept
• user _ astatus _ map – status of password and account status. I must begin at the starting point for
exploring the Oracle Database. This
is a Conceptual Guide. The basic
idea of Security is to deny or allow
Security Related Views users actions. The ideal model of
VIEWS RELATED TO PROFILES: security implementation in Oracle
is discretionary access control. This
DBA_PROFILES, DBA_SQL_PROFILES. means that privileges are granted to
users at the discretion of other us-
VIEWS RELATED TO ROLES:
ers. The database itself stores a list
DBA_APPLICATION_ROLES, DAB_CONNECT_ROLE_GRANTEES, DBA_ROLE_PRIVS, DBA_ROLES,
of users. When a user is trying to ac-
PROXY_ROLES, PROXY_USER_AND_ROLES.
cess a database application a valid
username and password must be
VIEWS RELATED TO PRIVILEGES: provided. A security domain exists
for each user. A security domain
DAB_COL_PRIVS, DBA_ROLE_PRIVS, DBA_SYS_PRIVS, DAB_TAB_PRIVS.
is set of privileges and roles, table
VIEWS RELATED TO USERS: space quotas and system resources
limits. A privilege is an implemen-
DBA_USERS. tation of access control. Oracle
is very flexible and offers precise
users from ten different departments. Another case of using roles would be ated for this purpose. However this
This could become very frustrating necessary when there is need to use principle allows the implementation
without having to associate each several different applications. It’s the element that changes the access
user with at least five different privi- same principle, however it differs a bit privileges during runtime just by us-
leges. Things would become even in the reason to create role. Imagine ing the SET ROLE clause on the fly.
worse if you had to change privileges applications that use a table of offers. The most powerful role in the system
for all users in the department. This With the use of roles in the game it’s is DBA (stands for Database Admin-
is where user roles come into play. much easier to change the access istrator). This role is implicitly asso-
For each department a role could be depending on the user that is logged ciated with the SYS and SYSTEM
created. Then changing privileges for into the application. For example account. However I must again note
all departments would be as easy when regular user is logged into an that access control to these accounts
as grant/revoke privilege from role. application there could be a role cre- is a critical task. In obsolete versions
of Oracle (8i and older) there was a
special user named INTERNAL that
could access the database whether
it was in a MOUNT or NOMOUNT
state. This account had the default
password set to oracle. This account
wasn’t maintained in the database
data dictionary, but in an Oracle
password file. In past versions the
INTERNAL mechanism has been re-
place by the SYSDBA and SYSOPER
privilege. SYSDBA privileges allows
user to startup, shutdown, backup,
recover and create databases. The
list of all users who has SYSDBA or
SYSOPER privileges could be found
in v$defile users. There is a limitation
for the SYSDBA role – it cannot be
granted to the public. Another is-
sue when creating databases is the
default action of creating the role
PUBLIC. This role is often used in
hacking methods. There are two
main reasons. The first is that some
Figure 1. ORACLE.WALLET.SCREENSHOT people don’t even know that it exists.
That’s because it cannot be seen in
dab_roles. Another and even more
important reason is because chang-
ing the privileges in this role applies
to other users as well. This role is cre-
ated when a new database is created
(to create new database Oracle uses
the script sql.bsq). To determine the
type of account the user is connected
to database with could be shown with
SHOW USER (SQL*Plus). There is
one more thing in using these ac-
counts. The objects owned by user
SYS cannot be exported via standard
tools (exp, imp). Another rule tells
us that No objects may be created
in SYS schema. The SYS schema
has the job of storing data dictionary
objects and it is fully managed by the
Figure 2. ORACLE.NETWORK.MANAGER database itself.
Application tokens etc. The third reason against to compromise data integrity as it is
Security Roles this is user access to the database moved between sites. User identify
Application security roles could be is less effective than with the usage falsifying is an attack vector based
enabled only by authorized PL/SQL of roles. This restriction could be on the premise that an attacker can
packages. To ensure higher level of overcome by using a set role dy- pretend that he/she is someone else.
security it is better not to embed pass- namically. And last but not least is to Another type of attack in this group is
words in the source code or the table. disable the Oracle Identity Manager. to hijack the connection of the user.
In order to achieve this it is necessary The fundamentals in implementing a
to create a secure application role Secure Application Role are based Oracle Advanced
that could define which PL/SQL pack- validating the identity by looking into Security Secure
age has sufficient privileges to enable the context. Application roles could Sockets Layer
this role. This concept could be en- be also used for controlling the value Authentication
hanced by adding additional checks of IP an address, where is the user Oracle Advanced security supports
of conditions for authorization by the connecting from? Application roles both Secure Sockets Layer (SSL)
application. However implementing could be implemented in separate and Transport Layer Security (TLS)
authorization on the client side of the packages. The basic principle of us- protocols. The SSL protocol is au-
application is always tricky. The main ing a secure application role is to as- thentication and encryption method
reason for this is the fact, that an ap- sociate privileges with User Database that enhances TCP clients with secure
plication could be skipped by using Roles. Let’s focus on some of the services. This protocol was originally
sqlplus client or any other tool to con- details of using roles. Roles are used developed by Netscape Communica-
nect to the database. Another reason to simplify the process of granting tion Company to secure the HTTP
to use security mechanisms on the and revoking user privileges. A role is protocol communication between
server side is re-usability. There is a set of privileges that allows a user client and server. This still remains
no need to implement the security ac- to access objects (see SQL code). its primary usage. The SSL protocol
cess control twice when we change Another interesting query to view is on based on IETF standard RFC-
the application. It is enough to store it could provide information about the 2246 under name TLS (Transport
once on the server and then reuse it default privileges assignment. This Layer Security). Each side in the com-
with different applications. Also when could be done by querying the list of munication gives proof of identity with
using database server side security all privileges with restrictions only to a digital certificate (encrypted block of
we could use all the security features the PUBLIC grantee. It is highly rec- data). A certificate is validated by a
that Oracle offers (fine-grained ac- ommended that privileges be revoked trusted third-party which then verifies
cess control with application context), from the PUBLIC. So from this we the communication between identity
roles, stored procedures and auditing. could derive the most popular method and a given encrypted key. This third-
For this reasons Use of Ad Hoc Tools used to hack the database. This is to party is called Certification Authority
is a potential security problem. obtain the highest privileges or the (see http://www.openssl.org) for more
It is recommended by Oracle to most powerful role in the system. details. Using this feature ensures
equal application users to database encrypted connections between cli-
users. This would give us the potential Oracle Advanced ents and servers, and it could also be
to use all security features that Oracle Security used to validate a secure client/server
has to offer. However this is not true OAS is a collection of security fea- database connection. This feature
for many applications. Most of these tures related to Oracle Net Services,
applications use one user to connect Oracle Database, Oracle Application
to the database with higher privileges. Server and Oracle Identity Man- Frequently Used Terms
It is the so-called One Big Application agement infrastructure. It provides in Cryptography
User model. There are some disad- defenses against most common
vantages while using this model to security threats. Eavesdropping, • Encrypt – Scrambling data to make
access the database. For example data theft, data tempering, falsifying it unrecognizable.
• Decrypt – Unscrambling data to its
there is no way to audit the actions user identities and password-related
original format.
of each user using this application. threats. Eavesdropping is the illegal
• Cipher – Another word for algo-
The database doesn’t recognize each interception of conversations by unin- rithm.
user. If we would like to use auditing in tended recipients. This is the method • Certificate Authority (CA) – third-
the One User Model we must imple- used by an intruder once data is sent party, e.g. Verisign, CyberTrust or
ment our own auditing mechanisms. over an insecure network (de facto RSA.
The second disadvantage of using whole Internet). However even in a • Digital Certificates – Consists of
the one user model is the possible de-militarized zone network sniffers private key and public key the pri-
inability to use Advanced Security could be used to capture secret com- vate key has to be verified by CA.
Authentication. These include SSL, munications. Data Tempering means
A D V E R T I S E M E N T
makes the public key freely available. the private key and configure trusted Oracle Wallet Manager
The public key is used to encrypt mes- certificates. And finally Hardware Se- Is used as place to store, manage
sages that can only be decrypted by curity Modules are devices that stores and edit authentication and signing
the holder of the associated private cryptographic information, such as pri- credentials. This includes private
key. The private key is securely stored vate keys or to perform cryptographic keys, certificates and trusted certifi-
together with other security creden- operations to off load RSA operations cated needed by SSL. It could also
tials in an encrypted container called a from server. There are two types of be used as storage for credentials
wallet. A wallet is a data structure used this device: server-side (stores keys) for a hardware security module.
to store and manage security creden- and client-side (smart card readers). To protect the content a password
tials for an individual entity. A Wallet To improve the security, it is possible must be chooses that complies with
Resource Locator (WRL) provides all to use additional authentication meth- the Password Management Policy
the necessary information to locate ods (RADIUS, Kerberos). SSL brings guidelines (min. 8 chars, alphanu-
the wallet. Public-key algorithm has some issues with using Firewalls. meric required). It could be used
a weakness that could be exploited Firewalls that perform packet inspec- to store certificates (X.509) under
in the absence of the communicating tions must have this feature disabled Triple-DES encryption. For optimum
party’s identity verification. This type otherwise they are unable to read wallet access and administration
of attack is called the man-in-the- the packet. In this case Oracle Net Oracle provides an option to store
middle. It’s based on the idea that an Firewall Proxy kit can provide some your user profile in the registry. [6]
intruder captures the public key of the specific support for database network OWM enables one to store
sender. Then uses his/her own public traffic. U.S. government regulations multiple certificates in each wal-
key to send messages to the receiver. prohibit double encryption. This is the let supporting SSL authentica-
When the receiver responds, the reason why this will not work concur- tion, S/MIME signature, S/MIME
intruder is able to re-encrypt the mes- rently with SSL encryption or another encryption, Code-Signing and CA
sage with public key of sender and encryption method. Certificate Signing. The process of
forwards the message to the sender. obtaining a new certificate consists
It gives the intruder the possibility to OAS SSL of several steps. First is to gener-
read the message (eavesdropping). Authentication Practice ate a unique private/public key pair.
To prevent this type of attack, it is nec- When implementing advanced secu- The private key stays in the wallet
essary to verity the owner of the public rity features there are some options. and the public key is sent with the
key through authentication. This is the You can utilize third-party software request to a certificate authority.
point where CA comes to play. The like Kerberos or RADIUS; it is pos- Once the certificate authority gen-
CA issues public key certificate that sible to use Secure Socket Layer erates and signs the certificate it
contains information about the prin- (SSL). Oracle has a specific set of could then be imported into the
cipal entity’s security credentials and tools used to manage certificates, wallet that has the corresponding
encrypts a message with private key. wallets and certificate revocation private key. There is X.509 Version
This provides an opportunity to verify lists. Oracle’s Wallet Manager is an 3 Key Usage extension to define
that the key was issued by the CA. In application that stores security cre- Oracle PKI certificate usage. Ora-
an Oracle Environment the PKI com- dentials in the users Oracle wallets. cle’s Wallet also supports LDAP.
ponents include Certificate Authority, This Manager can be used to create This feature allows users to retrieve
Certificates, Certificate Revocation public and private key pairs, store and their wallets from LDAP directory.
Lists, Wallets and Hardware Secu- manage user credentials, generate This allows users to access wallets
rity Modules. CA issues the certificate certificate requests, store and man- from multiple locations or devices.
signed with its own private key. To age certificate authority certificates, Only functional wallets could be up-
verify the certificate was in fact issued upload and download wallets to and loaded to LDAP. To protect access
by the CA its public key is used. The from an LDAP directory and create Oracle’s wallets are stored in LDAP
certificate is created only in the event wallets to store hardware security there are passwords to access
that the entity’s public key is signed by module credentials. OWM could be Wallets from LDAP and another to
a trusted CA. Certification Revocation found on UNIX in $ORACLE _ HOME/bin/ open the Wallet itself. It is recom-
(CLR) lists is a list where CA stores ex- owm . See Figure 1. Another important mended that separate password
pired or invalid certificates. The server tool is Oracle’s Net Manager. It is be used where neither one can
searches for CLRs in the following well known common database ad- logically be derived from the other.
locations: local file system, Oracle ministration however when oracle’s The description of creating a new
Internet Directory and CRL Distribu- advanced security is installed Oracle wallet could be found in [9 Chap-
tion Point. Oracle Wallet is used for Net Manager allows one to configure ter 9.3]. Here is a short overview
generating a public-private key pair strong authentication, network en- of possible actions: Create wallet
and create certificate request, store cryption and check summing for data (standard or stored on a hardware
a user certificate that matches with integrity. See Figure 2. security module [ PKCS #11]), Open,