<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pderinaldis</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pderinaldis"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Pderinaldis"/>
		<updated>2026-04-25T19:58:02Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36247</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36247"/>
				<updated>2008-08-15T21:23:59Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Client side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
     )&lt;br /&gt;
   SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
   SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
  SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
  SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
  SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
* Statement Auditing.&lt;br /&gt;
* Privilege Auditing.&lt;br /&gt;
* Schema Object Auditing.&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== Check Audit ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type of Audit !! View Name &lt;br /&gt;
|-&lt;br /&gt;
| Default Auditing || ALL_DEF_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Statment Auditing || DBA_STMT_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Object Auditing || DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Privilege Auditing || DBA_PRIV_AUDIT_OPT&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36246</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36246"/>
				<updated>2008-08-15T21:23:24Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Server side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
     )&lt;br /&gt;
   SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
   SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
* Statement Auditing.&lt;br /&gt;
* Privilege Auditing.&lt;br /&gt;
* Schema Object Auditing.&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== Check Audit ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type of Audit !! View Name &lt;br /&gt;
|-&lt;br /&gt;
| Default Auditing || ALL_DEF_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Statment Auditing || DBA_STMT_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Object Auditing || DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Privilege Auditing || DBA_PRIV_AUDIT_OPT&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36245</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36245"/>
				<updated>2008-08-15T21:22:31Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Automated processing database accounts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
* Statement Auditing.&lt;br /&gt;
* Privilege Auditing.&lt;br /&gt;
* Schema Object Auditing.&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== Check Audit ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type of Audit !! View Name &lt;br /&gt;
|-&lt;br /&gt;
| Default Auditing || ALL_DEF_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Statment Auditing || DBA_STMT_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Object Auditing || DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Privilege Auditing || DBA_PRIV_AUDIT_OPT&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36244</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=36244"/>
				<updated>2008-08-15T21:20:46Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Privileges and Roles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
* Statement Auditing.&lt;br /&gt;
* Privilege Auditing.&lt;br /&gt;
* Schema Object Auditing.&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== Check Audit ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type of Audit !! View Name &lt;br /&gt;
|-&lt;br /&gt;
| Default Auditing || ALL_DEF_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Statment Auditing || DBA_STMT_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Object Auditing || DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Privilege Auditing || DBA_PRIV_AUDIT_OPT&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35854</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35854"/>
				<updated>2008-08-12T10:51:09Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* CHECK AUDIT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
* Statement Auditing.&lt;br /&gt;
* Privilege Auditing.&lt;br /&gt;
* Schema Object Auditing.&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== Check Audit ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type of Audit !! View Name &lt;br /&gt;
|-&lt;br /&gt;
| Default Auditing || ALL_DEF_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Statment Auditing || DBA_STMT_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Object Auditing || DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Privilege Auditing || DBA_PRIV_AUDIT_OPT&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35853</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35853"/>
				<updated>2008-08-12T10:49:16Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* CHECK AUDIT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
* Statement Auditing.&lt;br /&gt;
* Privilege Auditing.&lt;br /&gt;
* Schema Object Auditing.&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== CHECK AUDIT ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type of Audit !! View Name &lt;br /&gt;
|-&lt;br /&gt;
| Default Auditing || ALL_DEF_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Statment Auditing || DBA_STMT_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Object Auditing || DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Privilege Auditing || DBA_PRIV_AUDIT_OPT&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35852</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35852"/>
				<updated>2008-08-12T10:45:17Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Enable Audit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
* Statement Auditing.&lt;br /&gt;
* Privilege Auditing.&lt;br /&gt;
* Schema Object Auditing.&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== CHECK AUDIT ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
 Type of Audit	        View Name&lt;br /&gt;
 Default Auditing	ALL_DEF_AUDIT_OPTS&lt;br /&gt;
 Statment Auditing	DBA_STMT_AUDIT_OPTS&lt;br /&gt;
 Privilege Auditing	DBA_PRIV_AUDIT_OPT&lt;br /&gt;
 Object Auditing	DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35851</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35851"/>
				<updated>2008-08-12T10:42:15Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Audit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
To properly protect database access you should implement auditing of user database activities in order to  identify any suspicious activity or to check if an user has more privileges than expected.&lt;br /&gt;
&lt;br /&gt;
=== Start Audit Service ===&lt;br /&gt;
&lt;br /&gt;
To start the audit service you should execute “cataudit.sql” as SYS account. Then, you should choose if you want store the audit record to DataBase or Operating System file by setting the parameter “AUDIT_TRAIL” to DB or OS.&lt;br /&gt;
The database audit trail is a single table named SYS.AUD$, but there are predefined views that help you use the information in this table, while as regard operating system audit trail the audit records are written into the directory that you choose by setting the “AUDIT_FILE_DEST” parameter.&lt;br /&gt;
&lt;br /&gt;
=== Enable Audit ===&lt;br /&gt;
&lt;br /&gt;
Once you start the audit service, you can choose to audit the sys operation by setting the AUDIT_SYS_OPERATION to TRUE. So that, Oracle Database audit connections to the database with administrator privileges, database startup and shutdown.&lt;br /&gt;
Then, you can enable other options, by using AUDIT SQL statement:&lt;br /&gt;
&lt;br /&gt;
1.	Statement Auditing&lt;br /&gt;
2.	Privilege Auditing&lt;br /&gt;
3.	Schema Object Auditing&lt;br /&gt;
&lt;br /&gt;
An example to audit some activities on table “test” owned by OWASP (Schema Object Auditing):&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; AUDIT INSERT, UPDATE, DELETE ON owasp.test BY ACCESS;&lt;br /&gt;
&lt;br /&gt;
Oracle Database allow to write a single audit record for all SQL statements in the same session, using the “by session” option in the audit SQL command or to write one record for each access, using the “by access” option.&lt;br /&gt;
Then, Oracle Database allows, also, to write the successful executions of statements, using the “whenever successful” option in the audit SQL command or unsuccessful attempts to execute statements, using the “whenever not successful”.&lt;br /&gt;
&lt;br /&gt;
=== Disable Audit ===&lt;br /&gt;
&lt;br /&gt;
To turning off an audit options you should use the statement “NOAUDIT”, such as:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; NOAUDIT ALL PRIVILEGES;	&lt;br /&gt;
&lt;br /&gt;
=== CHECK AUDIT ===&lt;br /&gt;
&lt;br /&gt;
If you are using the database audit trail you should use the “SELECT” statement from the follow view to show the enabled audit:&lt;br /&gt;
&lt;br /&gt;
 Type of Audit	        View Name&lt;br /&gt;
 Default Auditing	ALL_DEF_AUDIT_OPTS&lt;br /&gt;
 Statment Auditing	DBA_STMT_AUDIT_OPTS&lt;br /&gt;
 Privilege Auditing	DBA_PRIV_AUDIT_OPT&lt;br /&gt;
 Object Auditing	DBA_OBJ_AUDIT_OPTS&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; SELECT * FROM DBA_STMT_AUDIT_OPTS;&lt;br /&gt;
&lt;br /&gt;
 USER_NAME                    AUDIT_OPTION                 SUCCESS              FAILURE&lt;br /&gt;
 --------------------         -------------------          ----------           ---------&lt;br /&gt;
 OWASP		              SESSION 		           BY SESSION 	        BY SESSION&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35518</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35518"/>
				<updated>2008-08-07T08:47:53Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
&lt;br /&gt;
Consider configuring the Oracle Advanced Security component to use Secure Socket Layer (SSL) encrypting network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Below, you can see an example of a basic configuration:&lt;br /&gt;
&lt;br /&gt;
==== Server side ====&lt;br /&gt;
&lt;br /&gt;
To enable SSL database connection you should create an Oracle wallet (with the autologin feature) and generate a certificate request by using Wallet Manager component. Then you should send it to the Certificate Authority; when you receive CA trusted and the user certificate, you should import these certificate into your wallet.&lt;br /&gt;
Then you should configure the Oracle Advanced Security component by using the Net Manager utility (recommended) or modify the sqlnet.ora and listener.ora file. &lt;br /&gt;
At the end, the sqlnet.ora and listener.ora files should contain the following entries:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
   	(METHOD = FILE)&lt;br /&gt;
   	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
    )&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
==== Client side ====&lt;br /&gt;
&lt;br /&gt;
After the wallet is configured, you should configure the client to use SSL connection to connect to databases by configuring sqlnet.ora file. &lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
  WALLET_LOCATION = &lt;br /&gt;
    (SOURCE =&lt;br /&gt;
  	(METHOD = FILE)&lt;br /&gt;
  	(METHOD_DATA =&lt;br /&gt;
   		(DIRECTORY = &amp;lt;wallet_location&amp;gt; )&lt;br /&gt;
         )&lt;br /&gt;
   )&lt;br /&gt;
&lt;br /&gt;
     SSL_SERVER_DN_MATCH = OFF&lt;br /&gt;
             SSL_CLIENT_AUTHENTICATION = FALSE&lt;br /&gt;
     SQLNET.AUTHENTICATION_SERVICES= (TCPS)&lt;br /&gt;
&lt;br /&gt;
Now, you should define a network connection to the SSL listener by configuring the tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  SSL =&lt;br /&gt;
  (DESCRIPTION =&lt;br /&gt;
  (ADDRESS_LIST =&lt;br /&gt;
  (ADDRESS = (PROTOCOL = TCPS)(HOST = &amp;lt;host_name&amp;gt;)(PORT = &amp;lt;port&amp;gt;))&lt;br /&gt;
   )&lt;br /&gt;
   (CONNECT_DATA =&lt;br /&gt;
   (SID = &amp;lt;SID_name&amp;gt;)&lt;br /&gt;
  )&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35488</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35488"/>
				<updated>2008-08-06T18:13:50Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server stores debugging trace file of a user process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server writes debugging trace file of background process || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to a protect directory considering that is the directory where the server dumps core files.|| &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35478</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35478"/>
				<updated>2008-08-06T18:00:51Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Network address restriction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access, especially when the PLSQL EXTPROC is in use. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35477</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35477"/>
				<updated>2008-08-06T17:58:04Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Privileges and Roles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
&lt;br /&gt;
  Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35476</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=35476"/>
				<updated>2008-08-06T17:56:25Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Inbound connection timeout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
	Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
&lt;br /&gt;
To enable logging on the listener, you should use Net Manager utility or modify the listener.ora file on server machine.&lt;br /&gt;
At the end, the listener.ora file should contain the follow entries: &lt;br /&gt;
&lt;br /&gt;
   LOGGING_&amp;lt;listener name&amp;gt; = ON&lt;br /&gt;
   LOG_DIRECTORY_&amp;lt;listener name&amp;gt; = &amp;lt;log directory location&amp;gt;&lt;br /&gt;
   LOG_FILE_&amp;lt;listener name&amp;gt; = &amp;lt;log file name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=34726</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=34726"/>
				<updated>2008-07-25T21:14:12Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
	Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=33148</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=33148"/>
				<updated>2008-07-02T14:36:46Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Roles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Privileges and Roles ===&lt;br /&gt;
&lt;br /&gt;
Due to the great number and variety of applications that make use of the database, it’s difficult to define in advance witch kind of privilege have to be grant to a user. In order to make this choice, you should  practice the “principle of least privilege”, that is not providing database users, especially PUBLIC, more privileges than necessary.&lt;br /&gt;
&lt;br /&gt;
The user privileges are split in System Privileges and Object Privileges, you can grant privileges to users explicitly:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;user_name&amp;gt; [WITH ADMIN OPTION];&lt;br /&gt;
&lt;br /&gt;
Where “WITH ADMIN OPTION” means that the new user can grant the same system privilege to another user. &lt;br /&gt;
&lt;br /&gt;
 Also, you can grant privileges to a role (recommended), a group of privileges:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;system_privilege&amp;gt; TO &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
and then you should grant the role to users:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; GRANT &amp;lt;role_name&amp;gt; TO &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Periodically, you should review the privileges (system and object) of the all database user. As an example, you can use the follow SQL script by executing as a user with the right privileges in order to review the system privilege (only) of specific user:&lt;br /&gt;
&lt;br /&gt;
 set pagesize 0&lt;br /&gt;
 set head off&lt;br /&gt;
 set feed off&lt;br /&gt;
 set linesize 240&lt;br /&gt;
 set trimspool on&lt;br /&gt;
 col ord noprint&lt;br /&gt;
 set echo off&lt;br /&gt;
 accept username prompt' Insert a value for username:'&lt;br /&gt;
 SELECT LPAD(' ', 2*level) || granted_role &amp;quot;USER PRIVS&amp;quot;&lt;br /&gt;
 FROM (&lt;br /&gt;
    SELECT NULL grantee,  username granted_role&lt;br /&gt;
    FROM dba_users&lt;br /&gt;
    WHERE username LIKE UPPER('&amp;amp;&amp;amp;username')&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, granted_role&lt;br /&gt;
    FROM dba_role_privs&lt;br /&gt;
    UNION&lt;br /&gt;
    SELECT grantee, privilege&lt;br /&gt;
    FROM dba_sys_privs)&lt;br /&gt;
 START WITH grantee IS NULL&lt;br /&gt;
 CONNECT BY grantee = prior granted_role;&lt;br /&gt;
&lt;br /&gt;
An example of output:&lt;br /&gt;
	Insert a value for username: owasp&lt;br /&gt;
  OWASP&lt;br /&gt;
    CONNECT&lt;br /&gt;
      CREATE SESSION&lt;br /&gt;
    RESOURCE&lt;br /&gt;
      CREATE CLUSTER&lt;br /&gt;
      CREATE INDEXTYPE&lt;br /&gt;
      CREATE OPERATOR&lt;br /&gt;
      CREATE PROCEDURE&lt;br /&gt;
      CREATE SEQUENCE&lt;br /&gt;
      CREATE TABLE&lt;br /&gt;
      CREATE TRIGGER&lt;br /&gt;
      CREATE TYPE&lt;br /&gt;
    UNLIMITED TABLESPACE&lt;br /&gt;
&lt;br /&gt;
Afterward revoke the privileges that is not necessary from user:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
or from role:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;system_privilege&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
 SQL&amp;gt; REVOKE &amp;lt;object_privilege&amp;gt; ON &amp;lt;object_name&amp;gt; FROM &amp;lt;role_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=31999</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=31999"/>
				<updated>2008-06-19T08:52:40Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Enforce password policy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;function_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=31663</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=31663"/>
				<updated>2008-06-16T10:31:05Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Files and directories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle should be restricted to the Oracle software owner and the DBA user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory although you sholud configure the permission of all files stored in the “bin” directory in order to be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
The major weakness using batch jobs is to manage user names and passwords in fact, typically, it connects to databases by using directly the command sqlplus:&lt;br /&gt;
&lt;br /&gt;
       sqlplus -s &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;@&amp;lt;TNS alias&amp;gt; &amp;lt;&amp;lt; EOF&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this way you can just see the username and password in clear text by using the command to check the process status, such as ''“ps” ''command in unix environment. &lt;br /&gt;
To avoid it you can use a standard CONNECT statement within batch jobs, like this:&lt;br /&gt;
&lt;br /&gt;
       sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;br /&gt;
       CONNECT &amp;lt;user_name&amp;gt;/&amp;lt;password&amp;gt;&lt;br /&gt;
       &amp;lt;SQL statement&amp;gt;&lt;br /&gt;
       EOF&lt;br /&gt;
&lt;br /&gt;
In this last case it is suggested to save the crypted password in a well protected configuration file  and then decrypting them just before execute the CONNECT statement.&lt;br /&gt;
&lt;br /&gt;
Another (recommended) possibility is to delegate the password management to a guaranteeded third part as Secure External Password Store provided by Oracle Advanced Security component that save the credentials in a secure way.&lt;br /&gt;
&lt;br /&gt;
When the clients are configured to use the secure external password store, batch jobs can connect to a database replacing the login credentials with an alias (database connection string) stored into container (named wallet).&lt;br /&gt;
&lt;br /&gt;
To enable clients to use the external password store the first thing to do is to create an Oracle wallet with the autologin feature (access to wallet contents not require a password ) by using the follow command from OS command prompt:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -create&lt;br /&gt;
&lt;br /&gt;
Then, you should create database connection credentials in the wallet:&lt;br /&gt;
&lt;br /&gt;
        mkstore -wrl &amp;lt;wallet_location&amp;gt; -createCredential &amp;lt;db_connect_string&amp;gt; &amp;lt;user_name&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the wallet is ready, you should force the client to use the information stored in the “secure password store” to authenticate to databases by configuring sqlnet.ora file. &lt;br /&gt;
&lt;br /&gt;
Example of entries to add in sqlnet.ora file:&lt;br /&gt;
&lt;br /&gt;
        WALLET_LOCATION =&lt;br /&gt;
        (SOURCE =&lt;br /&gt;
        (METHOD = FILE)&lt;br /&gt;
        (METHOD_DATA =&lt;br /&gt;
        (DIRECTORY = &amp;lt;wallet_location&amp;gt;)&lt;br /&gt;
        )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
        SQLNET.WALLET_OVERRIDE = TRUE&lt;br /&gt;
&lt;br /&gt;
The same configuration are possible to do by using Oracle Wallet Manager.&lt;br /&gt;
&lt;br /&gt;
Doing in this way the risk is reduced because passwords are no exposed in the clear considering the applications can connect to a database with the following CONNECT statement syntax:&lt;br /&gt;
&lt;br /&gt;
        connect /@&amp;lt;db_connect_string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where “db_connect_string” is the database connection credential, created before.&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
The EXTPROC functionality used by PL/SQL component to make calls to the operating system and to load necessary library to execute external procedure, but if the Oracle Database server is not properly patched it even could allows unauthorized administrative access to the server machine through the Oracle Listener.&lt;br /&gt;
If the EXTPROC functionality is not required, you should disable it by editing the tnsname.ora and listener.ora files and removing the entries regarding this functionality. &lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in tnsname.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     EXTPROC_CONNECTION_DATA =&lt;br /&gt;
     (DESCRIPTION =&lt;br /&gt;
     (ADDRESS_LIST =&lt;br /&gt;
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
      )&lt;br /&gt;
      (CONNECT_DATA =&lt;br /&gt;
        (SID = PLSExtProc)&lt;br /&gt;
        (PRESENTATION = RO)&lt;br /&gt;
      )&lt;br /&gt;
     )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
Example of entries to remove in listener.ora file:&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
      (ADDRESS_LIST =&lt;br /&gt;
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;
       )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
  […]&lt;br /&gt;
     (SID_DESC =&lt;br /&gt;
       (SID_NAME = PLSExtProc)&lt;br /&gt;
       (ORACLE_HOME = […])&lt;br /&gt;
      )&lt;br /&gt;
  […]&lt;br /&gt;
&lt;br /&gt;
After that you should restart the Oracle Net listener process.&lt;br /&gt;
&lt;br /&gt;
Then you should check if the configuration take effect by using the operation status in LSNRCTL command. &lt;br /&gt;
You should review the configuration if the last command display the follow lines:&lt;br /&gt;
&lt;br /&gt;
   Listening Endpoints Summary...&lt;br /&gt;
         (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;
         […]&lt;br /&gt;
   Services Summary...&lt;br /&gt;
   Service &amp;quot;PLSExtProc&amp;quot; has 1 instance(s).&lt;br /&gt;
  	 Instance &amp;quot;PLSExtProc&amp;quot;, status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;
         […]&lt;br /&gt;
&lt;br /&gt;
Otherwise, the configuration is correct!&lt;br /&gt;
&lt;br /&gt;
If, instead, the EXTPROC functionality is required in your environment, you should configure a Oracle Net Listener for PL/SQL EXTPROC with an IPC (recommended) or TCP protocol address. &lt;br /&gt;
It is a good idea enforce the network address restrictions when you use the TCP protocol address.&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30390</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30390"/>
				<updated>2008-06-05T07:40:37Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Files and directories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30389</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30389"/>
				<updated>2008-06-05T07:38:55Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Sample schemas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30388</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30388"/>
				<updated>2008-06-05T07:38:25Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Operating system security */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30387</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30387"/>
				<updated>2008-06-05T07:37:49Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Patching */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30376</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30376"/>
				<updated>2008-06-04T18:56:20Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Sample schemas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need.&lt;br /&gt;
&lt;br /&gt;
Example SQL to remove a schema:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30373</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30373"/>
				<updated>2008-06-04T18:52:22Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should configure the Oracle Advanced Security component to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30372</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30372"/>
				<updated>2008-06-04T18:51:43Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should use the Oracle Advanced Security Option to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30371</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30371"/>
				<updated>2008-06-04T18:51:02Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should use the Oracle Advanced Security Oprion to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases to avoid network eavesdropping.&lt;br /&gt;
Enabling the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30369</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30369"/>
				<updated>2008-06-04T18:48:34Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
You should use the Oracle Advanced Security Oprion to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30368</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30368"/>
				<updated>2008-06-04T18:42:01Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Sample schemas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
You should review installed schema, especially the sample schemas provided by Oracle base installation, and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30367</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30367"/>
				<updated>2008-06-04T18:34:54Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Options and products */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a advanced installation to custom the installation process so that you be able to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30366</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30366"/>
				<updated>2008-06-04T18:05:19Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Options and products */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a &amp;quot;custom installation&amp;quot; to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
As often as the component required to provide a standard security operation are list in the follow table: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30365</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30365"/>
				<updated>2008-06-04T18:00:50Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Options and products */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
You should use a &amp;quot;custom installation&amp;quot; to install only the component required by application will connect to database.&lt;br /&gt;
&lt;br /&gt;
As often as the component required to provide a standard operation are list in the follow table: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30364</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30364"/>
				<updated>2008-06-04T17:43:16Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Patching */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
You should keep up to date the Oracle Database therefore, periodically, you should check the Oracle Technology Network web site (http://otn.oracle.com/deploy/security/alerts.htm) to keep up on security alerts issued from Oracle Corporation in regard to all installed components.&lt;br /&gt;
&lt;br /&gt;
Sometime, there are public vulnerility about Oracle software without a patch so it is a good idea subscribe to the security mailing lists so that you will be able to catch those new security issues and to find a way to mitigate the risk of the new vulnerability.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30030</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30030"/>
				<updated>2008-05-29T18:59:55Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || This parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || This parameter should be set to TRUE to ...&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || This parameter should be set to OS to...&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || This parameter should be set to...&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || This parameter should be set to ... || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || This parameter should be set to FALSE to... || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30028</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30028"/>
				<updated>2008-05-29T16:35:39Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || This parameter should be set to NONE, but if this functionality is required set the parameter EXCLUSIVE to make it more secure considering that that the password file can be used by only one database. || NONE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || This parameter should be set to TRUE to enforce other parameter about resource limitsuch as idle time limits. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || This parameter should be set to FALSE to deny the operating system groups to control Oracle roles. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Thi parameter should be set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || This parameter should be set to NULL to specify any directories that Oracle should use for PL/SQL file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30027</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30027"/>
				<updated>2008-05-29T16:07:24Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter should be set to FALSE to deny the authentication of remote clients by operating system. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30026</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30026"/>
				<updated>2008-05-29T15:32:55Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Admin restrictions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30025</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30025"/>
				<updated>2008-05-29T15:30:28Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Inbound connection timeout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30024</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30024"/>
				<updated>2008-05-29T15:28:59Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Inbound connection timeout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time the listener waits for a network client to complete the connection request should be manage to prevent a denial of service attack.&lt;br /&gt;
The name of parameter to set to configure inbound connection timeout and the name of the file of configuration, depends on Oracle version.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30023</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30023"/>
				<updated>2008-05-29T15:25:32Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Password */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized start, stop, and configure. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30022</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30022"/>
				<updated>2008-05-29T15:23:54Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by following the next step:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized starting, stopping, and configuring. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30021</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30021"/>
				<updated>2008-05-29T15:21:52Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Password */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by using the follow command:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set at the end of listener configuration process to avoid from unauthorized starting, stopping, and configuring. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set current_listener &amp;lt;listener_name&amp;gt;&lt;br /&gt;
   LNSRCTL&amp;gt; set password&lt;br /&gt;
   Password: (type &amp;quot;enter&amp;quot; if it is the first time)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (type &amp;quot;enter&amp;quot;)&lt;br /&gt;
   New password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   Reenter new password: &amp;lt;new_password&amp;gt;&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (important to save the configuration)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30020</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30020"/>
				<updated>2008-05-29T15:12:13Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
Enable the protection about network communication by using the follow command:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30019</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30019"/>
				<updated>2008-05-29T15:11:13Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Protect network communications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
It is a good idea use the Oracle Advanced Security to use Secure Socket Layer (SSL) as to encrypt network traffic between clients and databases.&lt;br /&gt;
To enable the protection about network communication use the follow command:&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30018</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30018"/>
				<updated>2008-05-29T15:02:57Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Encrypt network logins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests.&lt;br /&gt;
Note that on Oracle version 9.02 and later these parameter are not available, in fact it is encrypt automatically the password information when transmitting over a network, although the setting or changing of passwords is NOT encrypted when across the network.&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30017</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=30017"/>
				<updated>2008-05-29T14:57:59Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Change default password */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The major weakness concerning the password is that some user default account, after the installation, still has a default password associated with it, so you should be review the passwords of all default accounts (SYS, SYSTEM, DBSNMP, OUTLN and so on) and change it if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests. &lt;br /&gt;
On Oracle version 9.02 and later these parameter are not available, this is automatically handled when transmitting over a network. &lt;br /&gt;
Note that the setting or changing of passwords across the network is NOT encrypted without other encryption configuration such as Oracle Advanced Security (OAS).&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29933</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29933"/>
				<updated>2008-05-28T08:24:48Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml (extended and not). &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The most trivial method by which Oracle Database can be compromised is a default database server user account which still has a default password associated with it even after installation, so the passwords of all default accounts (SYS, SYSTEM, CTXSYS, MDSYS, DBSNMP, and OUTLN) should be changed. &lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests. &lt;br /&gt;
On Oracle version 9.02 and later these parameter are not available, this is automatically handled when transmitting over a network. &lt;br /&gt;
Note that the setting or changing of passwords across the network is NOT encrypted without other encryption configuration such as Oracle Advanced Security (OAS).&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29932</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29932"/>
				<updated>2008-05-28T08:15:31Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml, or xml,extended. &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This value change the instance immediately, but the configuration is lost after a restart. &lt;br /&gt;
* SPFILE: This value NOT change the instance immediately, but a restart is necessaty to take effect. &lt;br /&gt;
* BOTH:   This value change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The most trivial method by which Oracle Database can be compromised is a default database server user account which still has a default password associated with it even after installation, so the passwords of all default accounts (SYS, SYSTEM, CTXSYS, MDSYS, DBSNMP, and OUTLN) should be changed. &lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests. &lt;br /&gt;
On Oracle version 9.02 and later these parameter are not available, this is automatically handled when transmitting over a network. &lt;br /&gt;
Note that the setting or changing of passwords across the network is NOT encrypted without other encryption configuration such as Oracle Advanced Security (OAS).&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29931</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29931"/>
				<updated>2008-05-28T08:08:37Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Initialization parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml, or xml,extended. &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This change the instance immediately, but will not remain after a restart. &lt;br /&gt;
* SPFILE: This does not change the instance immediately, but it will will take effect after a restart. &lt;br /&gt;
* BOTH:   This change the instance immediately as well as the spfile.&lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The most trivial method by which Oracle Database can be compromised is a default database server user account which still has a default password associated with it even after installation, so the passwords of all default accounts (SYS, SYSTEM, CTXSYS, MDSYS, DBSNMP, and OUTLN) should be changed. &lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests. &lt;br /&gt;
On Oracle version 9.02 and later these parameter are not available, this is automatically handled when transmitting over a network. &lt;br /&gt;
Note that the setting or changing of passwords across the network is NOT encrypted without other encryption configuration such as Oracle Advanced Security (OAS).&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29930</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29930"/>
				<updated>2008-05-28T08:06:03Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Encrypt network logins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml, or xml,extended. &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This affects the database now; but will not remain after a restart. &lt;br /&gt;
* SPFILE: This does not change the instance immediately, but it will will take effect after a restart. &lt;br /&gt;
* BOTH: changes the current instance as well as the spfile. &lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The most trivial method by which Oracle Database can be compromised is a default database server user account which still has a default password associated with it even after installation, so the passwords of all default accounts (SYS, SYSTEM, CTXSYS, MDSYS, DBSNMP, and OUTLN) should be changed. &lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should be review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests. &lt;br /&gt;
On Oracle version 9.02 and later these parameter are not available, this is automatically handled when transmitting over a network. &lt;br /&gt;
Note that the setting or changing of passwords across the network is NOT encrypted without other encryption configuration such as Oracle Advanced Security (OAS).&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29929</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29929"/>
				<updated>2008-05-28T07:49:37Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* XML database (XDB) protocol server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml, or xml,extended. &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This affects the database now; but will not remain after a restart. &lt;br /&gt;
* SPFILE: This does not change the instance immediately, but it will will take effect after a restart. &lt;br /&gt;
* BOTH: changes the current instance as well as the spfile. &lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The most trivial method by which Oracle Database can be compromised is a default database server user account which still has a default password associated with it even after installation, so the passwords of all default accounts (SYS, SYSTEM, CTXSYS, MDSYS, DBSNMP, and OUTLN) should be changed. &lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should e review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests. On Oracle version 9.02 and later these parameter are not available, this is automatically handled when transmitting over a network. &lt;br /&gt;
Note that the setting or changing of passwords across the network is NOT encrypted without other encryption configuration such as Oracle Advanced Security (OAS).&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove or comment the follow line: &lt;br /&gt;
&lt;br /&gt;
  dispatchers=&amp;quot;(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging should be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 in xdbconfig.xml file.&lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29928</id>
		<title>OWASP Backend Security Project Oracle Hardening</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Backend_Security_Project_Oracle_Hardening&amp;diff=29928"/>
				<updated>2008-05-28T07:43:54Z</updated>
		
		<summary type="html">&lt;p&gt;Pderinaldis: /* Inbound connection timeout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
== Installation security ==&lt;br /&gt;
&lt;br /&gt;
This section is useful to understand how the installation will introduce vulnerabilities  if it is not made “security oriented”.&lt;br /&gt;
&lt;br /&gt;
=== Options and products ===&lt;br /&gt;
&lt;br /&gt;
The Oracle Database installation pack contains a lot of options and products beside to the database server, so a custom installation should be done to avoid installing options and products not needed. &lt;br /&gt;
The Oracle components other than the list below should be removed if not specifically required by any database applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Oracle database components&lt;br /&gt;
|-&lt;br /&gt;
| Assistant Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Common Files&lt;br /&gt;
|-&lt;br /&gt;
| Generic Connectivity Using Open Database Connectivity (ODBC)&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Listener&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Manager&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Net Services&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Core Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Oracle Call Interface&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Database&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Development Kit&lt;br /&gt;
|-&lt;br /&gt;
| Oracle9i/8i/10g Windows Documentation (Windows only)&lt;br /&gt;
|-&lt;br /&gt;
| Parser Generator Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Programming Language / Structured Query Language (PL/SQL)&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Embedded Gateway&lt;br /&gt;
|-&lt;br /&gt;
| PL/SQL Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Platform Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Relational Database Management System (RDBMS) Required Support Files&lt;br /&gt;
|-&lt;br /&gt;
| Required Support Files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sample schemas === &lt;br /&gt;
&lt;br /&gt;
Oracle Corporation provides sample schemas in order to provide a common platform for examples. Review, after the installation, installed schema and remove any schema you do not need, using the follow SQL statement:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; DROP USER &amp;lt;user_name&amp;gt; CASCADE;&lt;br /&gt;
&lt;br /&gt;
=== Patching ===&lt;br /&gt;
Apply, always, all security patches for Oracle Database itself, and for all the options and components that are installed. &lt;br /&gt;
Periodically check the security site on Oracle Technology Network for details on security alerts released by Oracle Corporation:&lt;br /&gt;
&lt;br /&gt;
                                     http://otn.oracle.com/deploy/security/alerts.htm&lt;br /&gt;
&lt;br /&gt;
Further, if you subscribe the security mailing lists you will be able to catch any new security issues that are not reported to Oracle but are announced to the public (maybe without a patch). In such cases, it will be relevant to find a way to mitigate the risk of the new vulnerability in the absence of an Oracle-supplied patch.&lt;br /&gt;
&lt;br /&gt;
=== Initialization parameters ===&lt;br /&gt;
&lt;br /&gt;
This section cover the Oracle Initialization parameters that are relevant for the security aspects. All the following initialization parameters have to be specified for all Oracle instances.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter name !! Description !! Security value &lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_AUTHENTICATION || This parameter, when set to TRUE, allows the authentication of remote clients by the host operating system. The default value for this parameter is FALSE. This parameter will remain set to FALSE because of the risk of an impersonation attack, otherwise known as spoofing. || FALSE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_LOGIN_PASSWORDFILE || Specifies whether Oracle uses a password file and, if in use, how many databases can use the password file. Setting the parameter to EXCLUSIVE signifies that the password file can be used by only one database. The password file requires remote DBAs to use their own individual DBA accounts to authenticate to the database for administrative database operations. || EXCLUSIVE&lt;br /&gt;
|-&lt;br /&gt;
| RESOURCE_LIMIT || Specifies whether or not enforcement of resource limits is enabled. If not enabled, the required idle time limits would not be enforced. The default is FALSE.&lt;br /&gt;
 || TRUE&lt;br /&gt;
|-&lt;br /&gt;
| REMOTE_OS_ROLES || Allow operating system roles to be used from remote clients. || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| OS_ROLES || Determines whether Oracle or the operating system identifies and manages the roles of each username. &lt;br /&gt;
Set to FALSE to configure Oracle to identifies and manages the roles.&lt;br /&gt;
Default value false.&lt;br /&gt;
 || FALSE  &lt;br /&gt;
|-&lt;br /&gt;
| UTL_FILE_DIR || Specifies one or more directories that Oracle should use for PL/SQL &lt;br /&gt;
file I/O.&lt;br /&gt;
 || NULL &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_SYS_OPERATIONS || Enables or disables the auditing of operations issued by user SYS,  and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail if the AUDIT_TRAIL initialization parameter is set to OS. The default is FALSE.&lt;br /&gt;
 || TRUE  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_TRAIL || Enables or disables database auditing. Default value none.&lt;br /&gt;
 || OS  &lt;br /&gt;
|-&lt;br /&gt;
| AUDIT_FILE_DEST (UNIX only) || Specifies the operating system directory into which the audit trail is written when the AUDIT_TRAIL initialization parameter is set to os, xml, or xml,extended. &lt;br /&gt;
The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML. It is also the location to which mandatory auditing information  is written and, if so specified by the AUDIT_SYS_OPERATIONS initialization parameter,  audit records for user SYS.&lt;br /&gt;
 || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USER_DUMP_DEST || Specifies the pathname for a directory where the server will write debugging trace files on behalf of a user process. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BACKGROUND_DUMP_DEST || Specifies the pathname (directory or disk) where debugging trace  files for the background processes (LGWR, DBWn, and so on) are written during Oracle  operations. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CORE_DUMP_DEST || Specifies the directory where Oracle dumps core files. || &amp;lt;Protected Directory&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 07_DICTIONARY_ACCESSIBILITY || Controls restrictions on SYSTEM privileges. If this parameter is set to FALSE, SYSTEM privileges that allow access to objects in other schemas do not allow access to objects in the dictionary or SYS schema. || FALSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example SQL for setting the REMOTE_OS_AUTHENTICATION parameter:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER SYSTEM SET REMOTE_OS_AUTHENTICATION = FALSE SCOPE=BOTH&lt;br /&gt;
&lt;br /&gt;
Scope:&lt;br /&gt;
* MEMORY: This affects the database now; but will not remain after a restart. &lt;br /&gt;
* SPFILE: This does not change the instance immediately, but it will will take effect after a restart. &lt;br /&gt;
* BOTH: changes the current instance as well as the spfile. &lt;br /&gt;
&lt;br /&gt;
=== Operating system security ===&lt;br /&gt;
&lt;br /&gt;
==== Owner account ====&lt;br /&gt;
&lt;br /&gt;
The Oracle OS installation account, owner of all Oracle application and datafiles, should be used only for the update and maintenance of the Oracle software and will not be used during the standard DBA activities. The individual DBAs will have to use their assigned OS personal accounts, so the auditing process will be able to actions performed with the correct OS account. &lt;br /&gt;
The Oracle software installation account will not be a member of the administrative group.&lt;br /&gt;
&lt;br /&gt;
==== Files and directories ====&lt;br /&gt;
&lt;br /&gt;
All files and directories generated during the installation process of Oracle will be restricted to the Oracle software owner or the DBA OS user group, especially the file list below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description &lt;br /&gt;
|-&lt;br /&gt;
| init.ora and/or init&amp;lt;SID&amp;gt;.ora&lt;br /&gt;
Spfile.ora&lt;br /&gt;
 || The file houses Oracle initialization parameter files. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| orapw&amp;lt;SID&amp;gt; || The file contain SYS password and the password of accounts granted the SYSDBA or SYSOPER role. Replace SID with the name of your SID.&lt;br /&gt;
|-&lt;br /&gt;
| listener.ora || The file houses listener configuration parameters and password.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_rw.ora || The file contains the password for the DBSNMP database account in cleartext.&lt;br /&gt;
|-&lt;br /&gt;
| snmp_ro.ora || The file houses configuration information for the Oracle Intelligent Agent.&lt;br /&gt;
|-&lt;br /&gt;
| sqlnet.ora || The file contains network configuration information for the host database and listener.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other accounts should be denied access except to executables under the “bin” directory as specifically required. All files stored in the “bin” directory will be owned by the Oracle software installation account.&lt;br /&gt;
These files and directories will be secured by using access control methods native to the operating system.&lt;br /&gt;
&lt;br /&gt;
== Account management ==&lt;br /&gt;
&lt;br /&gt;
=== Lock and expire unused accounts ===&lt;br /&gt;
&lt;br /&gt;
A number of default database server user accounts are create during the installation process so, if you do not use the Database Configuration Assistant, you should lock and expire all default database user accounts.&lt;br /&gt;
Unlock only those accounts that need to be accessed on a regular basis and assign a strong password to each of these unlocked accounts. &lt;br /&gt;
&lt;br /&gt;
Example SQL for reviewing the Oracle Default Accounts with status “OPEN”: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; SELECT &amp;lt;user_name&amp;gt; FROM dba_users WHERE account_status &amp;lt;&amp;gt; ’OPEN’ ORDER BY &amp;lt;user_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Example SQL for Locking Accounts: &lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; ALTER USER &amp;lt;user_name&amp;gt; ACCOUNT LOCK;&lt;br /&gt;
&lt;br /&gt;
=== Change default password ===&lt;br /&gt;
&lt;br /&gt;
The most trivial method by which Oracle Database can be compromised is a default database server user account which still has a default password associated with it even after installation, so the passwords of all default accounts (SYS, SYSTEM, CTXSYS, MDSYS, DBSNMP, and OUTLN) should be changed. &lt;br /&gt;
&lt;br /&gt;
=== Enforce password policy ===&lt;br /&gt;
&lt;br /&gt;
The password policy should be enforced by password verification function setting password parameter (list below) and providing password complexity feature like minimum length, password not same as the username, the password contains repeating characters, the password differs from the previous password by at least a maximal number of letters.&lt;br /&gt;
&lt;br /&gt;
Example SQL  for setting a password verification function to a profile:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE PROFILE &amp;lt;profile_name&amp;gt; LIMIT PASSWORD_VERIFICATION_FUCTION &amp;lt;newvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example SQL  for assigning profile profile to a user:&lt;br /&gt;
&lt;br /&gt;
   SQL&amp;gt; CREATE USER &amp;lt;user_name&amp;gt; IDENTIFIED BY &amp;lt;password&amp;gt; PROFILE &amp;lt;profile_name&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
=== Roles ===&lt;br /&gt;
&lt;br /&gt;
=== Automated processing database accounts ===&lt;br /&gt;
&lt;br /&gt;
== Network security ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypt network logins ===&lt;br /&gt;
&lt;br /&gt;
The password information in a connection request should be encrypted to protect against network eavesdropping. The value of the follow parameter should e review:&lt;br /&gt;
&lt;br /&gt;
   ORA_ENCRYPT_LOGIN (on the client machine)&lt;br /&gt;
   DBLINK_ENCRYPT_LOGIN (on the server machine)&lt;br /&gt;
&lt;br /&gt;
Once these parameters have been set to TRUE, passwords will be encrypted in connection requests. On Oracle version 9.02 and later these parameter are not available, this is automatically handled when transmitting over a network. &lt;br /&gt;
Note that the setting or changing of passwords across the network is NOT encrypted without other encryption configuration such as Oracle Advanced Security (OAS).&lt;br /&gt;
&lt;br /&gt;
=== Protect network communications ===&lt;br /&gt;
As mentioned in the previous paragraph, administrative connections that may contain confidential information such as “account password changes” should be protected by encryption. If local encryption is not implemented (VPN), the Oracle Advanced Security (OAS) should be used and configured to use Secure Socket Layer (SSL) to encrypt network traffic between clients, databases, and application servers.&lt;br /&gt;
&lt;br /&gt;
=== XML database (XDB) protocol server ===&lt;br /&gt;
&lt;br /&gt;
The XML Database (XDB) offers access to the Oracle XML DB resources using the standard Internet protocols FTP, listening on TCP port 2100, and HTTP, listening on TCP port 8080. &lt;br /&gt;
The Oracle XML DB Protocol Server is a specific type of Oracle shared server dispatcher and is specified in the Oracle database initialization parameter file for startup, so if XDB is not used it should be turned off editing the init&amp;lt;SID&amp;gt;.ora or spfile&amp;lt;SID&amp;gt;.ora (replace SID with the name of your SID) file and remove the follow line: &lt;br /&gt;
&lt;br /&gt;
 *.dispatchers='(PROTOCOL=TCP) (SERVICE=&amp;lt;SID&amp;gt;XDB)'&lt;br /&gt;
&lt;br /&gt;
If access via the Internet protocols is required, logging will be enabled by setting the “ftp-log-level” and “http-log-level” parameters to a value of 1 instead of 0 in xdbconfig.xml file.&lt;br /&gt;
It is also a good idea to configure the ports to a non-default port. &lt;br /&gt;
&lt;br /&gt;
== Oracle TNS Listner security ==&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
&lt;br /&gt;
A listener password should be set after listener configuration to avoid unauthorized users starting, stopping, and configuring the listener service. The password will be stored in encrypted format within the listener.ora file by using the LSNRCTL utility.&lt;br /&gt;
&lt;br /&gt;
From the OS command prompt, type LSNRCTL and press Enter:&lt;br /&gt;
&lt;br /&gt;
   LSNRCTL&amp;gt; set password&lt;br /&gt;
   Password: (blank since there is initially no password assigned)&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; change_password&lt;br /&gt;
   Old password: (blank)&lt;br /&gt;
   New password: xxxxxx&lt;br /&gt;
   Reenter new password: xxxxxx&lt;br /&gt;
   […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; save_config (required to save the password ! !)&lt;br /&gt;
   […]&lt;br /&gt;
   Saved LISTENER configuration parameters.&lt;br /&gt;
   Listener Parameter File […]&lt;br /&gt;
   Old Parameter File […]&lt;br /&gt;
   The command completed successfully&lt;br /&gt;
   LSNRCTL&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
The Listener password must be set on all listeners running on the system.&lt;br /&gt;
&lt;br /&gt;
=== Admin restrictions ===&lt;br /&gt;
&lt;br /&gt;
The remote administration of the Oracle listener should be prevent by setting to TRUE the  ADMIN_RESTRICTIONS parameter in the listener.ora file:&lt;br /&gt;
&lt;br /&gt;
   ADMIN_RESTRICTIONS_&amp;lt;listener_name&amp;gt; = TRUE&lt;br /&gt;
&lt;br /&gt;
Replace listener_name with the name of your listener.&lt;br /&gt;
&lt;br /&gt;
This will require that any configuration changes be made to the listener through direct edits to the listener.ora file.&lt;br /&gt;
&lt;br /&gt;
=== Network address restriction ===&lt;br /&gt;
&lt;br /&gt;
The network address restrictions should be enforced by the Oracle listener to further protect your database from unauthorized remote access. Network address restriction is required when the PLSQL EXTPROC is in use to protect against unauthenticated access to the database. &lt;br /&gt;
To enable network address restriction, edit the SQLNET.ORA to add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.VALIDNODE_CHECKING = YES&lt;br /&gt;
&lt;br /&gt;
Then, to defines TCP/IP addresses that are allowed to connect to database add the follow line:&lt;br /&gt;
&lt;br /&gt;
   TCP.INVITED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, to defines TCP/IP addresses that are refused connections to the database set the follow parameter&lt;br /&gt;
&lt;br /&gt;
   TCP.EXCLUDED_NODES = &amp;lt;list of IP addresses&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External procedures ===&lt;br /&gt;
&lt;br /&gt;
=== Inbound connection timeout ===&lt;br /&gt;
&lt;br /&gt;
The controls of the amount of time, in second, the listener waits for a network client to complete the connection request should be configure to prevent a denial of service attack.&lt;br /&gt;
The name of parameter, to set to configure inbound connection timeout and the name of the file to add it, depends on Oracle version. &lt;br /&gt;
This parameter protects the listener from consuming and holding resources for client connection requests that do not complete. A malicious user could use this to flood the listener with requests that result in a denial of service to authorized users.&lt;br /&gt;
To prevent this, secify, also, the expire_time parameter probes for dead connections and terminates them when found. This setting does cause a slight increase in network traffic.&lt;br /&gt;
&lt;br /&gt;
== Packages, procedures and functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audit ==&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[1] The Oracle Hacker's Handbook: Hacking and Defending Oracle by David Litchfield &lt;br /&gt;
&lt;br /&gt;
[2] The Database Hacker's Handbook: Defending Database Servers by David Litchfield&lt;br /&gt;
&lt;br /&gt;
[3] Database Security Technical Implementation Guide by DISA for the DOD&lt;br /&gt;
&lt;br /&gt;
[4] Oracle Database Security Guide by Oracle Corporation&lt;br /&gt;
&lt;br /&gt;
[5] Oracle Database Security Checklist by Oracle Corporation&lt;/div&gt;</summary>
		<author><name>Pderinaldis</name></author>	</entry>

	</feed>