Reader small image

You're reading from  Oracle 11g Anti-hacker's Cookbook

Product typeBook
Published inOct 2012
Reading LevelBeginner
PublisherPackt
ISBN-139781849685269
Edition1st Edition
Languages
Right arrow
Author (1)
Adrian Neagu
Adrian Neagu
author image
Adrian Neagu

Adrian Neagu has over ten years of experience as a database administrator, mainly with DB2 and Oracle databases. He is an Oracle Certified Master 10g, Oracle Certified Professional 9i, 10g, and 11g, IBM DB2 Certified Administrator version 8.1.2 and 9, IBM DB2 9 Advanced Certified Administrator 9, and Sun Certified System Administrator Solaris 10. He is an expert in many areas of database administration such as performance tuning, high availability, replication, backup, and recovery. In his spare time, he likes to cook, take photos, and to catch big pikes with huge jerkbaits and bulldawgs.
Read more about Adrian Neagu

Right arrow

Chapter 4. Authentication and User Security

In this chapter we will cover:

  • Performing a security evaluation using Oracle Enterprise Manager

  • Using an offline Oracle password cracker

  • Using user profiles to enforce password policies

  • Using secure application roles

  • How to perform authentication using external password stores

  • Using SSL authentication

Introduction


Account security probably raises the most controversies and is the most difficult aspect of database security. For example your database could have third-party applications schemas that have more privileges than they actually need.I have seen during my experience many application schema users with all ANY type privileges or DBA and SYSDBA role granted due to a misguided application design. In such a situation, it could be very difficult to revoke privileges because there is a risk of affecting the entire application functionality. The access to the database is granted through a form of authentication, and all access to database objects is performed through user accounts. Too many privileges and weak passwords will open the door to sensitive data. Probably, one of the most successful outcomes of a hacker's attack would be to find or crack passwords for users with administrative rights. For example, in previous Oracle versions, such as 9i and 10g, there were active users installed...

Performing a security evaluation using Oracle Enterprise Manager


A good way to check a user's rights and the privileges granted to users or to a public role and other security weaknesses can be to initiate it from Oracle Enterprise Manager Database Control by using the secure configuration evaluation feature.

Getting ready

All the steps will be performed on the HACKDB database.

How to do it...

If you do not have OEM installed and configured, you may use the dbca or emca command line utility to perform interactive installation and configuration (for example, emca –config dbcontrol db):

  1. Log in to Oracle Enterprise Manager (OEM) as an administrative user. Navigate to the Server tab, go to the Related Links panel, and click on the Policy Groups link shown as follows:

  2. The Policy Group Library page will open. In line with the Policy Group Secure configuration for Oracle in the Scheduled Evaluation column, click on the opened notebook icon as shown in the following screenshot:

  3. Next, Scheduled Evaluations...

Using an offline Oracle password cracker


As we have mentioned and emphasized before you should perform security assessments against your databases regularly. Password crackers are the best tools to check your real passwords strength. These tools are used also by attackers to crack passwords. If you can crack a password then there is 100 percent probability that an attacker can do the same. In recent years, some very fast Oracle password crackers were developed. In this recipe we will use one of the fastest, an Oracle password-cracker tool developed by Laszlo Toth called woraauthbf.

This tool can be downloaded from Laszlo's personal page http://soonerorlater.hu (For a description of the tool and its download link, go to http://soonerorlater.hu/index.khtml?article_id=513); it has the capability of cracking passwords based on hash, dictionary, and brute force methods.

In this recipe we will connect to the HACKDB database, and we will collect the password hashes in a file that will be used as...

Using user profiles to enforce password policies


A user profile controls user password policies and resource control. Every user has an allocated profile.

The DEFAULT profile will be assigned if another profile is not specified for a user. It is recommended that you use your own custom profiles to enforce password aging policies, strong passwords, and resource utilization. In this recipe, we will create a customized profile named CUSTPROF that establishes a strong password policy through the use of password related profile resources and the use of a password verification function.

Getting ready

All the steps will be performed on the HACKDB database.

How to do it...

The profile CUSTPROF will be assigned to the HR user in the following steps:

  1. Create a new profile named CUSTPROF using the following statement:

    SQL> create profile custprof limit password_reuse_max 15;
    Profile created.
    
  2. To find information about the profile CUSTPROF, issue the following query:

    SQL> select PROFILE,RESOURCE_NAME...

Using secure application roles


Secure application roles can be used to grant roles selectively based on the specific needs of the application users. The main advantage is that secure application roles do not require hardcoded passwords in the application code, and can be enabled in the background using a stored procedure. In this way, you can develop some strict rules to allow users to receive certain privileges only while the application is in use. Also in this recipe we will create two users vw_america and vw_europe that will also be used in the further recipes.

Getting ready

All the steps will be performed on the HACKDB database.

How to do it...

The application role will be enabled by using the default context sys_context. A detailed coverage on contexts can be found in Chapter 5, Beyond Privileges: Oracle Virtual Private Database.

  1. Connect as the user system. Create two users vw_america and vw_europe and grant create session privilege to each of them as follows:

    SQL> create user vw_america...

How to perform authentication using external password stores


External password stores are useful in situations in which you want to prevent the connection credentials from being exposed in scripts or application code. In this recipe, we will create a password store that will contain the password for the HR user.

Getting ready

The steps in this recipe will be performed on the HACKDB database and the client node nodeorcl5.

How to do it...

During this recipe, we will use the mkstore utility for wallet management:

  1. Create the wallet by using the mkstore utility. Use ly8T%QX;r for the wallet password as follows:

    mkstore -wrl  /security/wallets/pass_store -create
    Oracle Secret Store Tool : Version 11.2.0.3.0 - Production
    Copyright (c) 2004, 2011, Oracle and /or its affiliates. All rights reserved.
    
    Enter password:
    
    Enter password again:
    
  2. Create a net service name used for working with the password store, as follows:

    HACKDB_PASS_STORE =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL ...

Using SSL authentication


The Secure Sockets Layer, commonly referred to as SSL, is another method of authentication based on externally stored credentials. The mechanism is very similar to that used in authentication based on external stores. The major difference is that in authentication based on external stores, we are still using passwords, and the normal user authentication is unaltered. In SSL-based authentication, users are defined externally or globally, and authorization is based on certificates.

Getting ready

In this recipe we will re-use the SSL-based connection setup that was described in Chapter 2, Securing the Network and Data in Transit. Additionally we will create a user named ssluser defined with an external identification. Before starting with the steps, set up the SSL communication as instructed in Chapter 2, Securing the Network and Data in Transit.

How to do it...

  1. Edit $ORACLE_HOME/network/admin/sqlnet.ora and set SSL_CLIENT_AUTHENTICATION to TRUE, as follows:

    SSL_CLIENT_AUTHENTICATION...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Oracle 11g Anti-hacker's Cookbook
Published in: Oct 2012Publisher: PacktISBN-13: 9781849685269
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Adrian Neagu

Adrian Neagu has over ten years of experience as a database administrator, mainly with DB2 and Oracle databases. He is an Oracle Certified Master 10g, Oracle Certified Professional 9i, 10g, and 11g, IBM DB2 Certified Administrator version 8.1.2 and 9, IBM DB2 9 Advanced Certified Administrator 9, and Sun Certified System Administrator Solaris 10. He is an expert in many areas of database administration such as performance tuning, high availability, replication, backup, and recovery. In his spare time, he likes to cook, take photos, and to catch big pikes with huge jerkbaits and bulldawgs.
Read more about Adrian Neagu