Kerberos is a trusted third-party authentication system. It relies on shared secrets and presumes that the third party is secure. You can configure Oracle Database to use Kerberos authentication.
Topics:
Connecting to an Oracle Database Server Authenticated by Kerberos
Configuring Interoperability with a Windows 2008 Domain Controller KDC
Troubleshooting the Oracle Kerberos Authentication Configuration
See Also:
Oracle Database Enterprise User Security Administrator's Guide for information on migrating Kerberos users to Kerberos-authenticated enterprise usersTo enable Kerberos authentication for Oracle Database, you must first install it, and then follow a set of configuration steps.
Topics:
You should install Kerberos Version 5.
The source distribution for notes about building and installing Kerberos provide details. After you install Kerberos, if you are using IBM AIX on POWER systems (64-bit), you should ensure that Kerboros 5 is the preferred authentication method.
You must create a service principal for Oracle Database before the server can validate the identity of clients that authenticate themselves using Kerberos.
Next, you are ready to extract the service key table from Kerberos and copy it to the Oracle database server/Kerberos client system.
For example, to extract a service key table for dbserver.example.com
:
After you extract a service key table from Kerberos, you are ready to install the Oracle Database server and an Oracle client.
See the Oracle Database operating system-specific installation documentation for instructions on installing the Oracle database server and client software.
After you install the Oracle Database server and client, you can configure Oracle Net Services on the server and client.
See the following documentation for information on configuring Oracle Net Services on the Oracle database server and client.
Oracle Database operating system-specific installation documentation
You must set the required parameters in the Oracle database server and client sqlnet.ora
files.
Be aware that in a multitenant environment, the settings in the sqlnet.ora
file apply to all pluggable databases (PDBs).
First, you must configure Kerberos authentication service parameters on the client and on the database server.
Next, you are ready to set the OS_AUTHENT_PREFIX
initialization parameter.
Note:
You can create external database users that have Kerberos user names of more than 30 characters. See Step 8: Create an Externally Authenticated Oracle User for more information.
You can set optional sqlnet.ora
parameters, in addition to the required parameters, for better security.
Optionally, set the parameters listed in the following table on both the client and the Oracle database server.
Table 17-1 Kerberos-Specific sqlnet.ora Parameters
Parameter | Description |
---|---|
|
Specifies the complete path name to the Kerberos credentials cache (CC) file. The default value is operating system-dependent. For UNIX, it is Using the You can use the following formats to specify a value for
You can also set this parameter by using the For example: SQLNET.KERBEROS5_CC_NAME=/usr/tmp/krbcache |
|
This parameter specifies how many seconds can pass before a Kerberos credential is considered out-of-date. It is used when a credential is actually received by either a client or a database server. An Oracle database server also uses it to decide if a credential needs to be stored to protect against a replay attack. The default is 300 seconds. For example: SQLNET.KERBEROS5_CLOCKSKEW=1200 |
|
This parameter specifies the complete path name to the Using the For example: SQLNET.KERBEROS5_CONF=/krb/krb.conf SQLNET.KERBEROS5_CONF=AUTO_DISCOVER |
|
This parameter indicates that the Kerberos configuration file is created by the system, and does not need to be specified by the client. The configuration file uses DNS lookup to obtain the realm for the default KDC, and maps realms to KDC hosts. For example: SQLNET.KERBEROS5_CONF_LOCATION=http://222.178.203.72:19005/whst/63/=cnbrznqZbkdzbnl//krb |
|
This parameter specifies the complete path name to the Kerberos principal/secret key mapping file. It is used by the Oracle database server to extract its key and decrypt the incoming authentication information from the client. The default is operating system-dependent. For UNIX, it is For example: SQLNET.KERBEROS5_KEYTAB=/etc/v5srvtab |
|
This parameter specifies the complete path name to the Kerberos realm translation file. The translation file provides a mapping from a host name or domain name to a realm. The default is operating system-dependent. For UNIX, it is For example: SQLNET.KERBEROS5_REALMS=/krb5/krb.realms |
You must create the Kerberos user on the Kerberos authentication server where the administration tools are installed.
The realm must already exist.
Note:
The utility names in this section are executable programs. However, the Kerberos user name krbuser
and realm EXAMPLE.COM
are examples only. They can vary among systems.
Run /krb5/admin/kadmin.local
as root to create a new Kerberos user, such as krbuser
.
For example, to create a Kerberos user is UNIX-specific:
# /krb5/admin/kadmin.local kadmin.local: addprinc krbuser Enter password for principal: "krbuser@example.com": (password does not display) Re-enter password for principal: "krbuser@example.com": (password does not display) kadmin.local: exit
Next, you are ready to create an externally authenticated Oracle user.
Note:
The database administrator should ensure that two database users are not identified externally by the same Kerberos principal name.
Before you can connect to the database, you must ask the Key Distribution Center (KDC) for an initial ticket.
To request an initial ticket, run the following command on the client:
% okinit username
If you want to enable credentials that can be used across database links, then include the -f
option and provide the Kerberos password when prompted.
% okinit -f Password for krbuser@EXAMPLE.COM:(password does not display)
The Oracle Kerberos authentication adapter utilities are designed for an Oracle client with Oracle Kerberos authentication support installed.
Topics:
The okinit
utility obtains and caches Kerberos tickets.
This utility is typically used to obtain the ticket-granting ticket, using a password entered by the user to decrypt the credential from the key distribution center (KDC). The ticket-granting ticket is then stored in the user's credential cache.
Table 17-2 lists the options available with okinit
.
Table 17-2 Options for the okinit Utility
Option | Description |
---|---|
|
Ask for a forwardable ticket-granting ticket. This option is necessary to follow database links. |
|
Specify the lifetime of the ticket-granting ticket and all subsequent tickets. By default, the ticket-granting ticket is good for eight (8) hours, but shorter or longer-lived credentials may be desired. Note that the KDC can ignore this option or put site-configured limits on what can be specified. The lifetime value is a string that consists of a number qualified by okinit -l 2wld6h20m30s The example requests a ticket-granting ticket that has a lifetime of 2 weeks, 1 day, 6 hours, 20 minutes, and 30 seconds. |
|
Specify an alternative credential cache. For UNIX, the default is |
|
Specifies a number representing the Kerberos encryption type to use. This option can be used to request a particular Kerberos encryption type key for the session. If you specify more than one encryption type, then the KDC chooses the common and strongest encryption type from the list. The following value is allowed:
The following example requests for the okinit -e 18 krbuser@REALM Note that you can repeat the option to request multiple encryption types. |
|
List command line options. |
You can run the oklist
utility to display the list of tickets held.
Table 17-3 lists the available oklist
options.
Table 17-3 Options for the oklist Utility
Option | Description |
---|---|
|
Show flags with credentials. Relevant flags are:
|
|
Specify an alternative credential cache. In UNIX, the default is |
|
List the entries in the service table (default |
The show flag option (-f
) displays additional information, as shown in the following example:
% oklist -f 27-Jul-1999 21:57:51 28-Jul-1999 05:58:14 krbtgt/EXAMPLE.COM@EXAMPLE.COM Flags: FI
You can remove credentials from the cache file.
Use the okdstry
utility to remove credentials from the credentials cache file:
$ okdstry -c
where the -c
command option lets you specify an alternative credential cache. For UNIX, the default is /tmp/krb5cc_
uid
. You can also specify the alternate credential cache by using the SQLNET.KERBEROS5_CC_NAME
parameter in the sqlnet.ora
file.
After Kerberos is configured, you can connect to an Oracle database server without using a user name or password.
Use the following syntax to connect to the database without using a user name or password:
$ sqlplus /@net_service_name
In this specification, net_service_name
is an Oracle Net Services service name. For example:
$ sqlplus /@oracle_dbname
See Also:
Oracle Database Heterogeneous Connectivity User's Guide for information about external authentication
Oracle Database, which complies with MIT Kerberos, can interoperate with tickets that are issued by a Kerberos Key Distribution Center (KDC) on a Windows 2008 domain controller to enable Kerberos authentication with an Oracle database.
Topics:
You must perform the following steps to configure an Oracle Kerbero Client to interoperate with a Microsoft Windows 2008 Domain Controller KDC. Perform these steps on the Oracle Kerberos client.
Topics:
You must configure a set of client Kerberos configuration files that refer to the Windows 2008 domain controller as the Kerberos KDC.
Create the krb.conf
, krb5.conf
, and krb5.realms
files.
For example, assuming that the Windows 2008 domain controller is running on a node named sales3854.us.example.com
:
krb.conf
file
For example:
SALES3854.US.EXAMPLE.COM SALES3854.US.EXAMPLE.COM sales3854.us.example.com admin server
krb5.conf
file
For example:
[libdefaults] default_realm=SALES.US.EXAMPLE.COM [realms] SALES.US.EXAMPLE.COM= { kdc=sales3854.us.example.com:88 } [domain_realm] .us.example.com=SALES.US.EXAMPLE.COM
krb5.realms
file
For example:
us.example.com SALES.US.EXAMPLE.COM
The sqlnet.ora
file has Kerbose 5–specific parameters.
Configuring an Oracle client to interoperate with a Windows 2008 domain controller KDC uses the same sqlnet.ora
file parameters that are listed in Step 6A: Configure Kerberos on the Client and on the Database Server.
Set the following parameters in the sqlnet.ora
file on the client:
SQLNET.KERBEROS5_CONF=pathname_to_Kerberos_configuration_file SQLNET.KERBEROS5_CONF_MIT=TRUE SQLNET.AUTHENTICATION_KERBEROS5_SERVICE=Kerberos_service_name SQLNET.AUTHENTICATION_SERVICES=(BEQ,KERBEROS5)
Note:
Ensure that the SQLNET.KERBEROS5_CONF_MIT
parameter is set to TRUE
because the Windows 2008 operating system is designed to interoperate only with security services that are based on MIT Kerberos version 5.
Next, you are ready to configure a Microsoft Windows 2008 Domain Controller KDC to interoperate with an Oracle Client. You must perform these steps on the Windows 2008 domain controller.
Topics:
See Also:
Microsoft documentation for information about how to create users in Active Directory.
You must create a user account for the Microsoft Windows 2008 Domain Controller KDC.
On the Windows 2008 domain controller, create a new user account for the Oracle client in Microsoft Active Directory.
After you create the user account, you are ready to create the Oracle Database principal user account.
After you create the user account, you are ready to create the Oracle Database principal user account.
See Also:
Detailed information about Windows 2008 interoperability with Kerberos 5 that is available at the following URL:
http://technet.microsoft.com/hi-in/windowsserver/2000/bb735396(en-us).aspx
You must configure the Oracle database for the domain controller on the host computer where the Oracle database is installed.
Topics:
You must first set configuration parameters for the database.
Specify values for the following parameters in the sqlnet.ora
file for the database server:
SQLNET.KERBEROS5_CONF=pathname_to_Kerberos_configuration_file SQLNET.KERBEROS5_KEYTAB=pathname_to_Kerberos_principal/key_table SQLNET.KERBEROS5_CONF_MIT=TRUE SQLNET.AUTHENTICATION_KERBEROS5_SERVICE=Kerberos_service_name SQLNET.AUTHENTICATION_SERVICES=(BEQ,KERBEROS5)
Note:
Ensure that the SQLNET.KERBEROS5_CONF_MIT
parameter is set to TRUE
because the Windows 2008 operating system is designed to interoperate only with security services that are based on MIT Kerberos version 5.
Be aware that in a multitenant environment, the settings in the sqlnet.ora
file apply to all PDBs.
After you set the configuration parameters, you are ready to create an externally authenticated Oracle user.
Follow the procedure under Step 8: Create an Externally Authenticated Oracle User to create an externally authenticated Oracle user.
Ensure that you create the username in all uppercase characters (for example, ORAKRB@SALES.US.EXAMPLE.COM
).
See Also:
Step 6: Configure Kerberos Authentication for information about using Oracle Net Manager to set the sqlnet.ora
file parameters.
Before a client can connect to the database, the client must request an initial ticket.
To request an initial ticket, follow the task information for Step 9: Get an Initial Ticket for the Kerberos/Oracle User.
Note:
The user does not need to explicitly request for an initial ticket, using the okinit
command, when using the Windows native cache.
If the Oracle client is running on Microsoft Windows 2008 or later, the Kerberos ticket is automatically retrieved when the user logs in to Windows.
See Also:
Microsoft documentation for details about the Kerbtray.exe
utility, which can be used to display Kerberos ticket information for a system
You can configure fallback behavior (password-based authentication) in case the Kerberos authentication fails.
See Also:
Oracle Database Net Services Reference for more information about theSQLNET.FALLBACK_AUTHENTICATION
parameterOracle provides guidance for common Kerberos configuration problems.
Common problems are as follows:
If you cannot get your ticket-granting ticket using okinit
:
Ensure that the default realm is correct by examining the krb.conf
file.
Ensure that the KDC is running on the host specified for the realm.
Ensure that the KDC has an entry for the user principal and that the passwords match.
Ensure that the krb.conf
and krb.realms
files are readable by Oracle.
Ensure that the TNS_ADMIN
environment variable is pointing to the directory containing the sqlnet.ora
configuration file.
If you have an initial ticket but still cannot connect:
After trying to connect, check for a service ticket.
Check that the sqlnet.ora
file on the database server side has a service name that corresponds to a service known by Kerberos.
Check that the clocks on all systems involved are set to times that are within a few minutes of each other or change the SQLNET.KERBEROS5_CLOCKSKEW
parameter in the sqlnet.ora
file.
If you have a service ticket and you still cannot connect:
Check the clocks on the client and database server.
Check that the v5srvtab
file exists in the correct location and is readable by Oracle. Remember to set the sqlnet.ora
parameters.
Check that the v5srvtab
file has been generated for the service named in the sqlnet.ora
file on the database server side.
If everything seems to work fine, but then you issue another query and it fails:
Check that the initial ticket is forwardable. You must have obtained the initial ticket by running the okinit
utility.
Check the expiration date on the credentials. If the credentials have expired, then close the connection and run okinit
to get a new initial ticket.