06.01.2013 Views

Download PDF - IBM Redbooks

Download PDF - IBM Redbooks

Download PDF - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8.3 Writing SQL to audit SAP tables<br />

With security auditing, you can inspect and examine the adequacy and effectiveness of<br />

security policies and procedures that can be put into place to secure sensitive data. Another<br />

enhancement to DB2 10 is the ability to monitor and record all types of access to particular<br />

DB2 tables by different users. During auditing, you can obtain information about who has<br />

accessed the data, who has read the data, and who has changed the data, such as inserting<br />

or updating records.<br />

This new policy-based auditing enables the dynamic activation of SQL statement auditing for<br />

tables that might not have the AUDIT clause set in their table definition. The default value for<br />

the AUDIT clause is set to NO.<br />

As an example, when someone wants access for reading data, they might use a password<br />

hash attack. In this type of attack, the hash value of a password is calculated outside of the<br />

SAP kernel and then compared with the hash value that is stored in the database on an SAP<br />

system. One of the reasons why this attack is possible is the ability to read certain values in<br />

DB2 tables, such as the Advanced Business Application Programming (ABAP) password<br />

hash value. Reading of a particular row can be done by using the following methods:<br />

► Access to data from outside of the SAP system. This method can be done remotely at the<br />

database layer by using the SQL SELECT statement from various interfaces, such as<br />

SPUFI, DB2 Thin Connect, DB2 Enterprise Edition (EE), DB2 Control Center.<br />

► Access to data using its own ABAP programs. For example, ABAP developers can use<br />

their own programs to access any tables directly within an SAP system.<br />

► Access to data from existing tools within an SAP system. This method can be done by<br />

using the table browser (using SAP transaction codes, such as SE16 and SE17, or by<br />

navigating from transaction SE11).<br />

The currently valid passwords of users are stored in the table USR02 in a database of an SAP<br />

system. You can audit access to the data allocated in this specific table SAPR3.USR02 for<br />

SQL operations, such as READ, INSERT or UPDATE.<br />

To deter threats, such as an insider threat, run the SQL statements shown in Example 8-8 to<br />

create an audit policy that audits any SQL activity in the SAPR3.USR% table. We set the<br />

OBJECTNAME to USR%, which causes DB2 to use a LIKE predicate when determining the<br />

tables that will be audited. Example 8-8 inserts an audit policy that audits table names that<br />

begin with USR% within schema SAPR3.<br />

Example 8-8 Creating an SQL statement auditing policy<br />

INSERT INTO SYS<strong>IBM</strong>.SYSAUDITPOLICIES<br />

(AUDITPOLICYNAME, OBJECTSCHEMA, OBJECTNAME, OBJECTTYPE, EXECUTE)<br />

VALUES('AUDIT2','SAPR3','''USR%''','T','A');<br />

Example 8-9 shows how the new audit policy, AUDIT2, is activated. Before activating this new<br />

audit policy, the system component GTF must be started in the z/OS system.<br />

Example 8-9 Starting the SQL statement auditing policy<br />

-START TRACE(AUDIT) DEST(GTF) AUDTPLCY(AUDIT2)<br />

122 Running SAP Solutions with <strong>IBM</strong> DB2 10 for z/OS on the <strong>IBM</strong> zEnterprise System

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!