Skip to Content
Author's profile photo Man-Ted Chan

How to Enable Auditing?

Hi all,

My name is Man-Ted Chan and I’m from the SAP HANA support  team. Today’s blog will be about SAP HANA auditing. Auditing is a feature in the SAP HANA database that allows admins to monitor and record actions performed to the SAP HANA system.

AUTHORIZATIONS

In order to activate and configure auditing the SAP user will need the following system privileges:

  • AUDIT ADMIN

HOW TO ENABLE

1)      In the SAP HANA Studio expand the system on which you would like to enable auditing.

2)      Expand the ‘Security’ folder.

/wp-content/uploads/2014/04/1_440146.png

3)      Double click on the ‘Security option.’

4)      Click on the Auditing Status drop down menu; by default it will be ‘Disabled.’

/wp-content/uploads/2014/04/2_440162.png

5)      Select ‘Enabled.’

/wp-content/uploads/2014/04/3_440163.png

6)      Select your auditing type. There are 3 options:

a.       Syslog (Default) –  Uses the logging system  of the Linux OS

b.      CSV text file – Writes the audits as a CSV file in a user specified directory (in the example below it is /tmp/example). If the directory is left blank it will be written to the same directory the system trace files are written to/wp-content/uploads/2014/04/4_440164.png

c.       Database Table – Audits are written to an internal table: AUDIT_LOG. In order to read from this table the user will need either the AUDIT ADMIN or AUDIT OPERATOR system privileges

/wp-content/uploads/2014/04/5_440165.png

7)      Click on the deploy button or press F8.

/wp-content/uploads/2014/04/6_440166.png

CREATING AN AUDIT POLICY

An audit policy defines the actions to be audited; in order to create an audit policy the user must have AUDIT ADMIN system rights.

/wp-content/uploads/2014/04/7_440167.png

1)      Click the green plus sign under the ‘Audit Polices’ panel.

/wp-content/uploads/2014/04/8_440168.png

2)      Enter in your policy name

/wp-content/uploads/2014/04/9_440169.png

3)      Click in the Audited actions field and then press the ‘…’

/wp-content/uploads/2014/04/10_440170.png

4)      The following popup will appear and users will select what actions they would like audited (in this example I will be auditing ‘CREATE ROLE’)./wp-content/uploads/2014/04/12_440171.png

5)      Select when an audit record should be created in the ‘Audited actions status’ column.

a.       SUCCESSFUL – When an action is successfully executed it is logged

b.      UNSUCCESSFUL – When an action is unsuccessfully executed it is logged

c.       ALL – Both of the above situations are logged

/wp-content/uploads/2014/04/13_440172.png

6)      Select the audit level:

a.      EMERGENCY

b.      CRITICAL

c.      ALERT

d.      WARNING

e.      INFO (default)

/wp-content/uploads/2014/04/14_440173.png

7)      If needed, you can filter the users you would like to audit. Under the users column you can press the ‘…’ button,

/wp-content/uploads/2014/04/15_440174.png

and the following popup will appear:
/wp-content/uploads/2014/04/16_440175.png

8)      You can also specify the target object(s) to be audited. This option is valid if the actions to be audited involve SELECT, INSERT, UPDATE, DELETE.

9)      Once done press the deploy button or press F8 (please note that in the image below the Directory name is filled in, but it is not editable because the ‘Audit Trail Target’ is Database Table).

/wp-content/uploads/2014/04/17_440176.png

EXAMPLE OUTPUT
Database table example:

/wp-content/uploads/2014/04/18_440177.png
CSV example:

/wp-content/uploads/2014/04/19_440178.png

/wp-content/uploads/2014/04/20_440179.png

SYSLOG example:

/wp-content/uploads/2014/04/21_440180.png

/wp-content/uploads/2014/04/22_440181.png

DELETING THE AUDIT POLICY

To delete a create audit select it and press the red x.

/wp-content/uploads/2014/04/23_440182.png

The following popup will appear:

/wp-content/uploads/2014/04/24_440183.png

Once you hit OK press F8 or the execute button again.

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Kingsley Ufumwen
      Kingsley Ufumwen

      This is a very good blog. Is this now a part of the system by default since Revision 69 and higher?

      Cheers

      Kingsley

      Author's profile photo Man-Ted Chan
      Man-Ted Chan
      Blog Post Author

      Hi Kingsley,

      What do you mean by default? Do you mean auditing is turned on by default? If so I don't believe so.

      MTC

      Author's profile photo Krishnappa Angadi
      Krishnappa Angadi

      Hi

      Can we enable auditing for particular user in Hana? l mean, I need enable only for SYSTEM user.

      Thank you

      Author's profile photo Shaheer Mundayadankandy
      Shaheer Mundayadankandy

      Krishnappa Angadi you can setup audit policy against a user. Fundamentally, auditing configuration should be activated on database as well (which is provided in this blog under section - HOW TO ENABLE).

      Thanks!