Audit logging
SQL audit logging is an important security feature that you can use to track all the activities that are occurring in a given CockroachDB cluster. Specifically, you can select tables whose activity must be tracked and only enable audit logging on them.
The following information gets logged during auditing:
- Full query text.
- The date and time of the query.
- The client's IP address.
- The application's name.
- The user.
- The event type, which will be
SENSITIVE_TABLE_ACCESS
. This indicates that it's an event related to SQL audit logging. - The name of the table that was queried.
Now, let's look at an example. We will enable audit logging for one of the tables in the default databases. startrek
is a database that comes by default with the open source CockroachDB:
$ show databases; database_name | owner | primary_region | regions | survival_goal ----------------+-------+----------------+---------+----...