Oracle Database Security Measures

Source: Internet
Author: User

Database SecurityIt has always been a hot topic of interest. As we all know,Oracle DatabaseThe data information in the Oracle database is very important and should not be disclosed. The following section summarizes some security measures for the Oracle database, hoping to help you.

I. Database Security Principles

1. Only components required by oracle are installed;

2. Lock and terminate the Default User Account;

3. Change the default user password;

4. Activate data dictionary to protect oracle9i by default );

5. Grant the minimum permissions according to the actual situation;

6. force an effective access control oracle9i to enable this function by default );

7. Restrict access to the operating system;

8. restrict network access;

9. Install all security patches;

II. Specific security enhancement measures

1. Lock the Default User

During oracle Installation, many default users will be installed by default, which may cause potential security problems. You can lock it and restrict the connection to the database.

Oracle example users: HR, OE, PM, SH, QS_ADM, QS, QS_WS, QS_ES, QS_ OS, QS_CBADM, QS_CB, QS_CS

It is only an example for oracle and is useless;

DBSNMP: the Intelligent Agent responsible for running the Oracle System, which is rarely used in practice and rarely used;

OUTLN: used to store Outlines. It can be locked when not in use and opened again when used;

MDSYS, ORDSYS, CTXSYS, ORDPLUGINS: used to support oracle Intermedia, which is locked by default;

WMSYS: used to store the metadata information of Oracle Workspace Manager, which is locked by default;

ANONYMOUS: Used to allow HTTP access to Oracle xml db;

XDB: used to store Oracle xml db data and metadata;

In addition, some built-in users are not listed. We recommend that you lock the built-in users except sys, system, rman, and perfstat to reduce security risks.

SQL: select username, account_status from dba_users;

Alter user username account lock; 2. Install the latest security patch

The following are the Security announcements and patches:

Http://otn.oracle.com/deploy/security/alerts.htm

3. Password Management Mechanism

In Oracle, we can modify the user profile to set the password security policy and customize the password complexity. The following parameters in the profile are related to password security:

FAILED_LOGIN_ATTEMPTS: Maximum number of wrong logins

PASSWORD_GRACE_TIME: Lock time after password failure

PASSWORD_LIFE_TIME: Password Validity Period

PASSWORD_LOCK_TIME: the logon time exceeds the validity period.

PASSWORD_REUSE_MAX: Number of password history records retained

PASSWORD_REUSE_TIME: Password History record retention time

PASSWORD_VERIFY_FUNCTION: Password Complexity audit function.

By default, this security policy is not enabled.

Enable Security Policy:

Run the following command as a sys User: SQL> @? /Rdbms/admin/utlpwdmg. SQL

Example:

Create profile app_user2 LIMIT

FAILED_LOGIN_ATTEMPTS 5

PASSWORD_LIFE_TIME 60

PASSWORD_REUSE_TIME 60

PASSWORD_REUSE_MAX UNLIMITED

PASSWORD_VERIFY_FUNCTION verify_function

Pass word_lock_time 1/24

PASSWORD_GRACE_TIME 10;

4. Resource Management Mechanism

Enable resource management:

SQL> alter system set resource_limit = true;

Example:

Create profile app_user LIMIT

SESSIONS_PER_USER UNLIMITED

CPU_PER_SESSION UNLIMITED

CPU _ per_call 3000

CONNECT_TIME 45

LOGICAL_READS_PER_SESSION DEFAULT

LOGICAL_READS_PER_CALL 1000

PRIVATE_SGA 15 K

COMPOSITE_LIMIT 5000000;

You can use create user or alter user to specify a profile, for example:

Create user test

Identified by aZ7bC2

Default tablespace data_ts

QUOTA 100 m on test_ts

QUOTA 500 k on data_ts

Temporary tablespace temp_ts

PROFILE profile_name;

Alter user test

Identified by A12BDD

Default tablespace data_ts

Temporary tablespace temp_ts

QUOTA 100 m on data_ts

QUOTA 0 ON test_ts

PROFILE profile_name;

5. permission management

Based on the actual situation, subdivide permissions, create roles, and give system permissions with caution. Use the minimum authorization principle to grant users as few permissions as possible.

The PUBLIC user group, as its name implies, represents every user in the database. Therefore, granting permissions to the PUBLIC user group is actually granting corresponding permissions to every user in the database. This is a very useful shortcut for granting or revoking permissions. But it may also bring huge security risks, especially when trying to ensure that the database is run in a way with minimum permissions.

Revoke unnecessary permissions from the Public group and strictly restrict the permissions of the following packages:

UTL_FILE: this package allows oralce users to read files on the server. If it is set incorrectly, any files may be obtained.

UTL_HTTP: this package allows oracle users to access external resources including malicious web code and files through HTTP.

UTL_TCP: this package allows oracle to establish a connection over TCP to obtain executable files from the network.

UTL_SMTP: this package allows oracle to communicate through SMTP to forward key files.

Revoke the execution permission of the preceding package:

SQL:

Revoke EXECUTE on UTL_FILE from public;

Revoke EXECUTE on UTL_TCP from public;

Revoke EXECUTE on UTL_SMTP from public;

Revoke EXECUTE on UTL_HTTP from public; 6. Modify the authentication method

Oracle uses operating system authentication by default. As long as it can enter the system, it can directly access oracle using sys. This poses a major security risk and can be changed to the database authentication method.

In $ ORACLE_HOME/network/admin, open sqlnet. ora, comment out SQLNET. AUTHENTICATION_SERVICES = (ETS), and add # To the front. 7. Restrict IP connections

Because Oracle TNS listeners have many security vulnerabilities, some of which may even allow intruders to obtain the operating system's superuser permissions or modify the data in the database, while patching, limitations on the connected IP Address can also be prevented.

Modify the SQLNET. ORA file in the $ ORACLE_HOME \ network \ admin directory,

Add the following content:

Tcp. validnode_checking = YES

Tcp. invited_nodes = (IP address, hostname)

The IP address and hostname are the names and IP addresses of the hosts allowed to be connected. 8. Disable the Extproc function.

Because extproc has security issues that allow users to call system functions without identity authentication, this function must be disabled if not required.

Modify the TNSNAMES. ORA and LISTENER. ORA files and delete the entries containing EXTPROC so that the two files only contain valid connection information. 9. Enable the audit function

Oracle's audit mechanism is used to monitor various operations performed by users on ORACLE databases. By default, the system audit function is disabled. You can set the AUDIT_TRAIL parameter in the INIT. ORA parameter file to activate it. It has the following values: NONE to prohibit audit; DB to enable audit, write SYS. AUD $; OS to enable audit and write to the operating system.

When AUDIT_TRAIL = OS, you can set AUDIT_FILE_DEST to specify the location of the audit file, which is under $ ORACLE_HOME/rdbms/audit by default.

AUDIT_SYS_OPERATIONS, AUDIT_TRAIL, and AUDIT_FILE_DEST are all static parameters. You need to modify the parameter file to take effect after restart.

Set audit level:

Statement: Specifies to audit a specific type of SQL statements that affect database objects. For example, the table's audit TABLE has the following statements: create table, truncate table, comment on table, and DELETE [FROM] table;

Privilege: audits the SQL statements authorized by the specified system permission. For example, AUDIT CREATE ANY TRIGGER audits the statements authorized by the CREATE ANY TRIGGER system permission;

Object: audits specific operations on a specific Object, such as alter table on the emp.

Set audit conditions:

By session/by access: by session enables oracle to write only one record for the same type of SQL statements in the same session; BY ACCESS enables oracle to write one record for each ACCESS.

Whenever successful/whenever not successful: whenever successfu only audits the successfully executed SQL statements; whenever not successful only audits the failed or incorrect SQL statements.

Example of audit operation:

Audit connection:

Audit session; audit session by scott, lori;

Audit specified permissions:

Audit delete any table by access whenever not successful;

Audit delete any table;

Audit select table, insert table, delete table, execute procedure by access whenever not successful;

Specified audit object:

Audit delete on scott. emp;

Audit select, INSERT, delete on jward. dept by access whenever successful;

Audit select on default whenever not successful;

Disable audit:

Close the corresponding audit in the above example:

NOAUDIT session;

NOAUDIT session BY scott, lori;

Noaudit delete any table;

Noaudit select table, insert table, delete table, execute procedure;

Disable all Statement Auditing:

Noaudit all;

Disable all permission Auditing:

Noaudit all privileges;

Disable Object audit:

Noaudit delete on emp;

Noaudit select, INSERT, delete on jward. dept;

Disable all audits on an object:

Noaudit all on emp;

Disable all default object audits:

Noaudit all on default;

View of related audit information:

ALL_DEF_AUDIT_OPTS

USER_OBJ_AUDIT_OPTS

DBA_OBJ_AUDIT_OPTS

DBA_STMT_AUDIT_OPTS

DBA_PRIV_AUDIT_OPTS

DBA_AUDIT_TRAIL

USER_AUDIT_TRAIL

DBA_AUDIT_SESSION

USER_AUDIT_SESSION

DBA_AUDIT_STATEMENT

USER_AUDIT_STATEMENT

DBA_AUDIT_OBJECT

USER_AUDIT_OBJECT

DBA_AUDIT_EXISTS

SM $ AUDIT_CONFIG

KU $ _ AUDIT_VIEW

KU $ _ AUDIT_OBJ_BASE_VIEW

KU $ _ AUDIT_OBJ_VIEW

DBA_AUDIT_POLICIES

ALL_AUDIT_POLICIES

USER_AUDIT_POLICIES

DBA_FGA_AUDIT_TRAIL

DBA_REPAUDIT_ATTRIBUTE

ALL_REPAUDIT_ATTRIBUTE

USER_REPAUDIT_ATTRIBUTE

DBA_REPAUDIT_COLUMN

ALL_REPAUDIT_COLUMN

USER_REPAUDIT_COLUMN

Example of viewing audit information:

List statement audit operations for activities:

SELECT * FROM DBA_STMT_AUDIT_OPTS;

Permission auditing for listing activities:

SELECT * FROM DBA_PRIV_AUDIT_OPTS;

Lists the audit operations on activity objects of a specified object:

SELECT * FROM DBA_OBJ_AUDIT_OPTS where owner = 'Scott 'AND OBJECT_NAME LIKE 'emp' % ';

List default Object audit operations:

SELECT * FROM ALL_DEF_AUDIT_OPTS;

List audit records:

SELECT * FROM DBA_AUDIT_OBJECT;

List AUDIT records for AUDIT operations on the audit session:

Select username, LOGOFF_TIME, LOGOFF_LREAD, LOGOFF_PREAD, LOGOFF_LWRITE, LOGOFF_DLOCK FROM DBA_AUDIT_SESSION;

We have summarized so many security measures for Oracle databases. I believe that the security measures mentioned above will certainly help you achieve the security of Oracle databases, I hope all of you will be able to learn from the content mentioned above.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.