Set up the audit-data store

You can store the audit information in a database or system file, or you can send the information to a custom Java class for processing.

StepsSpecifying where to store audit information

  1. Using any standard ASCII text editor, open the security.properties file. The location of the file depends on your application server:

  2. Set the following properties, which are defined in Table 15-1:

StepsSetting up the audit database

If you set auditSPI to either “dbconncache” or “database,” you must set up an audit database.

  1. Choose a database to host the auditing information. To maintain complete audit records, Sybase recommends that you use the ACDB. If you are using an Adaptive Server Enterprise database, and you need information on managing the database log, see Chapter 27, “Developing a Backup and Recovery Plan,” in the Adaptive Server Enterprise System Administration Guide, which is available on the Sybase Product Manuals Web page.

  2. If you are using the ACDB, the SecDboCache is configured automatically when Security is installed, so you may skip this step.

    To use a database other than the ACDB, create a connection cache to the database, and link the com.sybase.ep.security.audit/SecureAuditWriter component’s jdbc/Audit resource reference to the new connection cache.

    If you are using EAServer, see these chapters:

    If your application server is WebLogic, refer to your BEA documentation.

  3. Choose a schema for your audit records. The following is the default schema, which can be created in an Adaptive Server Enterprise database:

    create table Audit(recordID varchar(64), 
                       timeStamp DATETIME, 
                        auditData TEXT)
    

    NoteIf you are using an Oracle database, you must use a name other than “Audit” for your audit table, which is a keyword in Oracle.

    The information contained in the auditData field is specific to the object type and the AccessType—see “Object-level auditing”.

    Table 6-12 defines the complete list of information you can audit. An asterisk identifies the default items.

    Table 6-12: Auditable information

    VALUES

    Information to audit

    Field name

    Datatype

    Can be null

    1

    * Audit record ID

    recordID

    varchar(64)

    No

    2

    * Audit timestamp

    timeStamp

    • DATETIME in ASA and Adaptive Server Enterprise

    • DATE in Oracle

    No

    3

    * XML audit record

    auditData

    • CLOB (character large object)

    • TEXT in Adaptive Server Enterprise

    • Reader in java.sql

    No

    4

    Domain primary key

    domainPK

    varchar(30)

    No

    5

    Subject primary key

    subjectPK

    varchar(30)

    Yes

    6

    Subject DN

    subjectDN

    varchar(255)

    Yes

    7

    Session primary key

    sessionPK

    varchar(64)

    Yes

    8

    Resource class name (AssetType)

    resourceClass

    varchar(255)

    No

    9

    Resource ID

    resourceID

    varchar(255)

    No

    10

    Action (AccessType)

    action

    varchar(255)

    No

    11

    Decision (permit or deny)

    decision

    • BIT

    • Boolean in java.sql

    Yes

  4. To audit more than the default items, update this statement in the security.properties file:

    auditDatabaseInsertSql=INSERT INTO Audit(recordID, timeStamp, auditData) VALUES ({1}, {2}, {3})
    

    For each additional piece of information you want to audit, append the field name to the comma-separated list of fields for the Audit table, and add the corresponding VALUES number (from Table 6-12) enclosed by curly braces to the VALUES list. For example, to include the action and decision in each audit record, the auditDatabaseInsertSql statement should be:

    auditDatabaseInsertSql=INSERT INTO Audit(recordID, timeStamp, auditData, action, decision) VALUES ({1}, {2}, {3}, {10}, {11})
    
  5. Create the Audit table in your database, and configure the following:

  6. In security.properties, verify that auditSPI is set to this value:

    auditSpi=dbconncache
    

    Alternately, you can enable the standard JDBC database SPI by defining these values in security.properties; however, Sybase does not recommend using this SPI due to performance issues:

    auditDatabaseJdbcDriver=com.sybase.jdbc2.jdbc.SybDriver
    auditDatabaseJdbcUrl=jdbc:sybase:Tds:<host_name>:<port>/<db_name>
    auditDatabasePassword=<password>
    auditDatabaseUsername=<user_name>
    auditSpi=database
    

    If you enable the standard JDBC database SPI, you can skip step 2.

  7. Restart your application server to enable the new SPI, and verify that authentication is working. If configuration errors exist, debugging information may be written to both JAGUAR/bin/Jaguar.log and SECURITY/security.log.