Using Oracle for the KerbNet database

Copyright © 1993, 1994, 1995, 1996, 1997 Cygnus Solutions.

KerbNet includes software and documentation developed at the Massachusetts Institute of Technology, which includes this copyright information:

Copyright © 1995, 1997 by the Massachusetts Institute of Technology.

Export of software employing encryption from the United States of America is assumed to require a specific license from the United States Government. It is the responsibility of any person or organization contemplating export to obtain such a license before exporting.

WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.


KerbNet includes software and documentation developed by OpenVision Technologies, Inc., which includes this copyright notice:

The following copyright and permission notice applies to the OpenVision Kerberos Administration system located in kadmin/create, kadmin/dbutil, kadmin/server, lib/kadm, and portions of lib/rpc:

Copyright, OpenVision Technologies, Inc., 1996, All Rights Reserved WARNING: Retrieving the OpenVision Kerberos Administration system source code, as described below, indicates your acceptance of the following terms. If you do not agree to the following terms, do not retrieve the OpenVision Kerberos administration system. You may freely use and distribute the Source Code and Object Code compiled from it, but this Source Code is provided to you "AS IS" EXCLUSIVE OF ANY WARRANTY, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ANY OTHER WARRANTY, WHETHER EXPRESS OR IMPLIED. IN NO EVENT WILL OPENVISION HAVE ANY LIABILITY FOR ANY LOST PROFITS, LOSS OF DATA OR COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, INCLUDING, WITHOUT LIMITATION, THOSE RESULTING FROM THE USE OF THE SOURCE CODE, OR THE FAILURE OF THE SOURCE CODE TO PERFORM, OR FOR ANY OTHER REASON.

OpenVision retains all rights, title, and interest in the donated Source Code. With respect to OpenVision's copyrights in the donated Source Code, OpenVision also retains rights to derivative works of the Source Code whether created by OpenVision or a third party. OpenVision Technologies, Inc. has donated this Kerberos Administration system to MIT for inclusion in the standard Kerberos 5 distribution. This donation underscores our commitment to continuing Kerberos technology development and our gratitude for the valuable work which has been performed by MIT and the Kerberos community.


KerbNet includes software and documentation developed at the University of California at Berkeley, which includes this copyright notice:

Copyright © 1983 Regents of the University of California.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
    This product includes software developed by the University of California, Berkeley and its contributors.
  4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.


Permission is granted to make and distribute verbatim copies of this manual provided the copyright notices and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.

Introduction

Normally, the KerbNet system uses Berkeley DB databases. However, for the Solaris platform, Cygnus Solutions offers the alternative option of Oracle databases. The Oracle database software allows you to not only create Kerberos databases, but store KerbNet logging information in a database, rather than in a plain file.

In order to use an Oracle database with KerbNet:

* You must be using the Solaris platform.

* You must have Oracle 7.3 installed and running on your local server.

* You must have KerbNet software that supports Oracle database installed.

With the exception of the details discussed in this manual, you can perform all the administrative tasks for the KerbNet system in the same way with Oracle databases as you can with Berkeley DB databases.

For information about installing and using Oracle, consult your Oracle documentation. For more information about installing and using the KerbNet authentication system, consult the KerbNet Installation System Administrator's, and User's Guides.

Using This Manual

In this manual, we will represent your prompt as "shell%". So an instruction to type the "ls" command would be represented as follows:

shell% ls

You should install the KerbNet programs in whichever directory makes the most sense for your system. We will use /usr/cygnus/kerbnet throughout this guide to refer to the top-level directory KerbNet directory. We will therefore use /usr/cygnus/kerbnet/bin to denote the location of the KerbNet user programs.

Linking the KerbNet and Oracle Systems

In order for the KerbNet system to use Oracle databases, the two systems need to be able to communicate with each other. The following setup procedure sets up an interface between the two systems.

  1. Add $ORACLE_HOME/lib to the LD_LIBRARY_PATH.

    If you are using a csh shell, add the following line to your .login file:

    
    	shell% setenv LD_LIBRARY_PATH $(ORACLE_HOME)/lib:$LD_LIBRARY_PATH
    
    

    If you are using a sh shell, add the following lines to your .login file:

    
    	shell% LD_LIBRARY_PATH=$(ORACLE_HOME)/lib:$LD_LIBRARY_PATH
    	shell% export LD_LIBRARY_PATH
    
    

    Note: the LD_LIBRARY_PATH variable may be specified in a different initialization file, depending on your operating system. Some of the files in which you might specify environment files include .login, .profile, and .cshrc.

  2. Create a Kerberos account within the Oracle system.

    From within the directory /usr/cygnus/kerbnet/lib/oracle, create the Kerberos account by typing the following lines:

    
    
    	shell% svrmgrl 
    	SVRMGR> connect system/<systempassword>;
    	SVRMGR> @mk_kerbnet;
    
    

    where <systempassword> is the Oracle master password.

    mk_kerbnet.sql is a SQL script that creates the Kerberos account, using the default password. If you would prefer instead to use an existing account name and password to store the Kerberos database, specify it in the kdc.conf file as the database_name parameter for the database (see the KerbNet System Administrator's Guide for more information on database_name). During KerbNet installation, mk_kerbnet.sql is installed in /usr/cygnus/kerbnet/lib/oracle.

  3. Create the Kerberos database, following the procedure described in the KerbNet System Administrator's Guide.

Once you have your Kerberos database set up using Oracle, you can perform all the administrative tasks as described in the KerbNet System Administrator's Guide.

Using Oracle Logging with the KerbNet system

Oracle database logging lets the KerbNet system write all of its logging information into tables within an Oracle database, instead of to the usual files or the system log utility. Because this logging information contains information on times and types of ticket requests, it can be useful for analyzing system loads and planning for the creation of new slave KDCs and realms. You can perform this kind of analysis using programs such as Oracle Browser or PowerBuilder.

Setting Up Oracle Logging

To use Oracle database logging with the KerbNet system, you need to create an account within Oracle to store the tables. You can create this account either on a local database or remotely using Oracle SQL*Net protocols. The [logging] section of the krb5 profile holds the SQL*Net specification for the Oracle user.

You should set up Oracle database logging before creating the Kerberos database (see section Linking the KerbNet and Oracle Systems).

To set up logging to an Oracle database:

  1. Create an Oracle logging account.

    From within the directory /usr/cygnus/kerbnet/lib/oracle, type the following comands:

    
    
    	shell% svrmgrl
    	SVRMGR> connect system/<systempassword>;
    	SVRMGR> create user <loguser> identified by <logpassword>;
    	SVRMGR> connect <loguser>/<logpasswd>;
    	SVRMGR> @logbld;
    
    

    where <loguser> is the name of the logging account and <logpassword> is the account's password.

    logbld.sql is a SQL script which creates the tables that the Oracle logging mechanism uses to store all its logged data (see section Oracle Log Tables. During KerbNet installation, logbld.sql is installed in /usr/cygnus/kerbnet/lib/oracle.

  2. Tell the KerbNet system to use the Oracle account to store logs:

    In the krb5.conf file, enter the following line to the [logging] section.

    
    	default = DATABASE=<dbspec>
    
    

    <dbspec> can be any Oracle SQL*Net specification. A common specification is the Oracle username and password, `<loguser>/<logpasswd>'. See your Oracle documentation for more details on SQL*Net specifications.

Oracle Log Tables

The Oracle logging program writes all the logging information into two tables.

The first table, LOG, holds much of the information for each log entry made. The table below lists the information displayed in each LOG column, with the datatype in which the information is recorded.

LOGTIME
The time the entry was logged. Type = DATE.

PRIORITY
A priority code indicating the severity of the entry. Type = NUMBER.

LOGHOST
The name of the host making the entry. Type = STRING.

LOGGER
The name of the program making the entry. Type = STRING.

CATEGORY
The facility within the program which is logging the entry. Usually this describes the request that a client program is making to the Kerberos server. Type = STRING.

RESULT
The result of the operation. Usually this is a short description of the result, with additional information stored in the LOG_TUPLE table (see below). Type = STRING.

FROMHOST
The name or address of the client making the request. Since most log entries are due to client requests to the Kerberos server, this field helps to find all requests generated from a client machine. Type = STRING.

LOG_ID
A unique id used to match entries in the LOG_TUPLE table (see below). Type = NUMBER.

The other table, LOG_TUPLE, is used to store additional information for each log entry. Since this information is highly dependent on the type of entry, this table allows each entry to specify its own information names. For example, a log entry for a ticket request will also provide an authorization time for the request, so the LOG_TUPLE table will include an entry mapping an `authtime' type to the actual authorization time.

The table below lists the information displayed in each LOG_TUPLE column, with the datatype in which the information is recorded.

LOG_ID
The log entry id from the LOG table. Type = NUMBER.

ARGNAME
The type name for the information. Type = STRING.

ARGVAL
The information itself. Type = STRING.

For your convenience, a PRIORITY_MAP table is also defined, which simply maps a priority number (from LOG's PRIORITY column) to a short string describing the entry's severity.

The table below lists the information displayed in each PRIORITY_MAP column, with the datatype in which the information is recorded.

PRIORITY
A priority code. Type = NUMBER.
PRI_STRING
A short description of the priority. Type = STRING.