Every 3 months Oracle release a Critical Patch Update (CPU) which usually applies to a majority of Oracle products. I haven't seen an instance where there was a Critical Patch Update that didn't apply to the Oracle Database. It is good practice to regularly review these advisories when they are released. The simplest form of assessing the Risk Matrix is to see what version and component of a product is affected, whether that product exists in their environment and then apply the CPU.
To give you an idea of vulnerabilities and their seriousness there was recently the release of a zero-day attack for the Oracle database known as the TCP Listener Poison attack. To view the most recent advisories see the below link and select "View the most recent Critical Patch Update Advisory":
The April 2012 advisory (latest at time of this writing):
For each product there is a Risk Matrix. This matrix is the basis for assessing risk to a component associated with a product. I'm only concentrating on the Database product however the same principles in assessing the CVSS (Common Vulnerability Scoring System) applies for other products also.
I have provided a short summary on some of the key aspects in understanding risk matrix and meaning of the CVSS headings. Hopefully for high risks that gives people imperitive to patch and help present a case to management to undertake a patching exercise.
Prior to the Risk Matrix Oracle provide a good summary of the vulnerabilities for a product. From the April 2012 Database advisory:
Oracle Database Server Executive Summary
"This Critical Patch Update contains 6 new security fixes for the Oracle Database Server. 3 of these vulnerabilities may be remotely exploitable without authentication, i.e., may be exploited over a network without the need for a username and password. 1 of these fixes is applicable to client-only installations, i.e., installations that do not have the Oracle Database Server installed.
Below is an excerpt of the April 2012 Database Product Risk Matrix:
Oracle Database Server Risk Matrix
CVE# | Component | Protocol | Package and/or Privilege Required | Remote Exploit without Auth.? | CVSS VERSION 2.0 RISK (see Risk Matrix Definitions) | Supported Versions Affected | Notes | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Base Score | Access Vector | Access Complexity | Authen- tication | Confiden- tiality | Integrity | Avail- ability | |||||||
CVE-2012-0552 | Oracle Spatial | Oracle NET | Create session, create index, alter index, create table | No | 9.0 | Network | Low | Single | Complete | Complete | Complete | 10.2.0.3, 10.2.0.4, 10.2.0.5, 11.1.0.7, 11.2.0.2, 11.2.0.3 | See Note 1 |
CVE-2012-0519 | Core RDBMS | Oracle NET | Create library, create procedure | No | 7.1 | Network | High | Single | Complete | Complete | Complete | 11.2.0.2 | See Note 2 |
CVE-2012-0510 | Core RDBMS | Oracle Net | None | Yes | 6.4 | Network | Low | None | None | Partial | Partial | 10.2.0.3, 10.2.0.4, 10.2.0.5, 11.1.0.7 |
source: http://www.oracle.com/technetwork/topics/security/cpuapr2012-366314.html
Here is a quick guide to assessing the risk matrix before understanding the CVSS completely for your environment:
Understanding Risk Matrix columns
The columns Base Score, Access Vector, Access complexity, Authentication, Confidentiality, Integrity and Availability are taken from the CVSS verion 2.0 open framework. Oracle have added the "Remote Exploit Without Authentication", and also modified the “Partial” definition to include “Partial+”.
Oracle have also included a few of their own columns in addition to CVSS. These are Component, Protocol, Package and/or Privilege and Remote Exploit without Authentication. These are described here: Risk Matrix Glossary -- terms and definitions for Critical Patch Update risk matrices
This document describes Oracle's use of the CVSS system: Use of Common Vulnerability Scoring System (CVSS) by Oracle
Base Score
“The CVSS base score defines the severity of the vulnerability and ranges between 0.0 and 10.0, where 10.0 represents the highest severity. Each risk matrix is ordered using this value, with the most severe vulnerability at the top of each risk matrix.”
Access Vector
The poorest score is "Network".
Access Complexity
The poorest score is "Low".The attack depends on social engineering methods that would be easily detected by knowledgeable people. For example, the victim must perform several suspicious or atypical actions.
The vulnerable configuration is seen very rarely in practice.
If a race condition exists, the window is very narrow.
The attacking party is limited to a group of systems or users at some level of authorization, possibly untrusted.
Some information must be gathered before a successful attack can be launched.
The affected configuration is non-default, and is not commonly configured (e.g., a vulnerability present when a server performs user account authentication via a specific scheme, but not present for another authentication scheme).
The attack requires a small amount of social engineering that might occasionally fool cautious users (e.g., phishing attacks that modify a web browser’s status bar to show a false link, having to be on someone’s “buddy” list before sending an IM exploit).
The affected product typically requires access to a wide range of systems and users, possibly anonymous and untrusted (e.g., Internet-facing web or mail server).
The affected configuration is default or ubiquitous.
The attack can be performed manually and requires little skill or additional information gathering.
The “race condition” is a lazy one (i.e., it is technically a race but easily winnable).
Authentication
The poorest score is "None".
Confidentiality
The poorest score is "Complete".
Integrity
The poorest score is "Complete".
Availability
The poorest score is "Complete".
Additional Notes about CVSS terms
Here is also a link to the Common Vulnerability Scoring System Version 2 Calculator. I've included it so you can see how a score is calculated. This does not include the Oracle created columns (for eg, there is no Partial+) but still worth having a look at.
Thursday, June 7, 2012
HTML reports using SQL*Plus
A Simple report:
set markup html on set verify off trimspool on trimout on feedback off heading on echo off pages 100 termout off spool currentTime1.html select to_char(sysdate,'DD.MON.YYYY HH24:MI:SS') "Current Time" from dual / spool off
Output:
Current Time |
---|
06.JUN.2012 18:56:29 |
Taking a plain report and adding color to it and stylesheet:
spool currentTime2.html set markup html on spool on entmap off - head 'The Current Time - ' - body 'text=black bgcolor=fffffff align=left' - table 'align=center width=99% border=3 bordercolor=black bgcolor=grey' select '' || to_char(sysdate,'DD.MON.YYYY HH24:MI:SS') ||'
' "Current Time" from dual / spool off
Output:
Current Time |
---|
06.JUN.2012 20:56:03 |
Color highlighting columns in the output:
set verify off trimspool on trimout on feedback off heading on echo off pages 100 termout off set markup html on spool on entmap off - head 'USERENV - ' - body 'text=black bgcolor=fffffff align=left' - table 'align=center width=99% border=3 bordercolor=black bgcolor=grey' define COLOR_BEGIN_GREEN = ''; define COLOR_END_GREEN = ''; spool userenv.html select sys_context('USERENV','SESSION_USER') "Session User", ''|| sys_context('USERENV','INSTANCE_NAME')|| '' "Instance Name", '&COLOR_BEGIN_GREEN' || sys_context('USERENV','SERVER_HOST') || '&COLOR_END_GREEN' "DB Hostname" from dual / spool off
Output:
Session User | Instance Name | DB Hostname |
---|---|---|
SYS | lexus | jupiter |
Displaying columns in different colors based on a condition. This can help highlighting an issue in a report:
set verify off trimspool on trimout on feedback off heading on echo off pages 100 termout off set markup html on spool on entmap off - head 'The Current Time - ' - body 'text=black bgcolor=fffffff align=left' - table 'align=center width=99% border=3 bordercolor=black bgcolor=grey' define BEGIN_WARNING = ''; define END_WARNING = ''; define BEGIN_OK = ''; define END_OK = ''; column server_host new_value server_host column instance_name new_value instance_name select sys_context('USERENV','SERVER_HOST') server_host, sys_context('USERENV','INSTANCE_NAME') instance_name from dual / spool logMode.html prompt&server_host..&instance_name - ARCHIVELOG MODE
select decode(log_mode,'NOARCHIVELOG','&BEGIN_WARNING'|| log_mode||'&END_WARNING', '&BEGIN_OK' || log_mode||'&END_OK') "Archive Log Mode
" from v$database / spool off
Output:
jupiter.lexus - ARCHIVELOG MODE
Archive Log Mode |
---|
NOARCHIVELOG |
Putting it all together, show init.ora prameters and comment, highlight problem areas in red otherwise in green:
set verify off trimspool on trimout on feedback off heading on echo off pages 100 termout off define BEGIN_WARNING = ''; define END_WARNING = ''; define BEGIN_OK = ''; define END_OK = ''; column server_host new_value server_host column instance_name new_value instance_name select sys_context('USERENV','SERVER_HOST') server_host, sys_context('USERENV','INSTANCE_NAME') instance_name from dual / set markup html on spool on entmap off - head 'INIT.ORA Parameters - &server_host..&instance_name - ' - body 'text=black bgcolor=fffffff align=left' - table 'align=center width=99% border=3 bordercolor=black bgcolor=grey' spool initParameters.html prompt&server_host..&instance_name - INIT.ORA Parameters
select name "Parameter Name", value "Parameter Value", comments "Comments" from ( select name name, decode(value,null,'',value) value, case -- -- control_file_record_keep_time -- when name = 'control_file_record_keep_time' then case when value <=14 then '&BEGIN_WARNING Value of '||value|| ' potentially low for retention of RMAN backup information &END_WARNING' end -- -- destinations *dest*, dump and log destinations -- when name like '%dest%' then case when lower(value) like '%product%' then '&BEGIN_WARNING Destination possibly under the Oracle product directory '||value|| ' &END_WARNING' when lower(value) like '%temp%' or lower(value) like '%tmp%' then '&BEGIN_WARNING Destination possibly under a temporary directory!'||value|| ' &END_WARNING' end -- -- processes -- when name = 'processes' then case when value < 100 then '&BEGIN_WARNING '||name||' value '||value|| ' may be too low, see v$resource_limit max utilisation &END_WARNING' end -- -- skip_unusable_indexes -- when name = 'skip_unusable_indexes' then decode(value,'FALSE',value, '&BEGIN_WARNING '||value||' &END_WARNING') -- -- SPFILE -- when name = 'spfile' then decode(value,'?', '&BEGIN_WARNING No SPFILE set &END_WARNING', '&BEGIN_OK SPFILE in USE &END_OK') -- -- undo management -- when name = 'undo_management' then case when lower(value) != 'auto' then '&BEGIN_WARNING UNDO_MANAGEMENT is not AUTO '|| value || ' &END_WARNING' end end comments from v$parameter, v$instance ) where comments is not null order by name, value / spool off
jupiter.lexus - INIT.ORA Parameters
Parameter Name | Parameter Value | Comments |
---|---|---|
control_file_record_keep_time | 7 | Value of 7 potentially low for retention of RMAN backup info rmation |
skip_unusable_indexes | TRUE | TRUE |
spfile | /app/oracle/product/11.2.0/db_1/dbs/spfileABC.ora | SPFILE in USE |
References:
Originally inspired from:
Creating HTML Reports with SQLPLus