This example shows how the auditing feature records attempts to access unauthorized information using either Sybase Central or Interactive SQL.
Auditing example (Sybase Central)
Start Sybase Central and connect to the sample database using the SQL Anywhere 11 Demo data source.
This connects you as a DBA user.
Turn on auditing:
The Database Properties window appears.
Add a user named Test1 to the sample database, with the password welcome:
Using Sybase Central, connect to the sample database as Test1 and attempt to access confidential information in the Employees table:
An error message appears: Permission denied: you do not have permission to select from "Employees"
.
View the auditing information for this activity:
Auditing information appears.
2007-11-06 10:07:14 | Permission |
Restore the sample database to its original state:
Right-click Test1, and choose Delete.
Auditing example (Interactive SQL)
Start Interactive SQL and connect to the sample database using the SQL Anywhere 11 Demo data source.
This connects you as a DBA user.
Turn on auditing using the SET OPTION statement, as follows:
SET OPTION PUBLIC.auditing = 'On'; |
Add a user, Test1, to the sample database using the CREATE USER statement, as follows:
CREATE USER Test1 IDENTIFIED BY welcome; |
Open a new Interactive SQL window, connect to the sample database as BadUser, and attempt to access confidential information in the Employees table using the following SELECT statement:
SELECT Surname, Salary FROM GROUPO.Employees; |
You receive an error message: Permission denied: you do not have permission to select from "Employees"
.
Run the following command to view the auditing information for this activity:
dbtran -g -c "DSN=SQL Anywhere 11 Demo" -n demo.sql |
Restore the sample database to its original state:
DROP USER Test1; |
SET OPTION PUBLIC.auditing = 'Off'; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |