cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.89k stars 3.78k forks source link

Have the ability to filter out internal queries when using `sql.log.user_audit` cluster setting #105590

Open smcvey opened 1 year ago

smcvey commented 1 year ago

Is your feature request related to a problem? Please describe. When using sql.log.user_audit, the audit log records ALL queries generated by the user, even ones that are internally created by viewing the DBConsole etc. There should be an option to only record explicit SQL queries ran externally from clients.

Describe the solution you'd like A new cluster setting, which works with sql.log.user_audit to disable the logging of anything where the query is generated internally (e.g. ApplicationName is one of $ internal-console, $ internal-check-is-admin, etc.

Jira issue: CRDB-29113

smcvey commented 1 year ago

The suppression of internal events doesn't necessarily have to be for the sql.log.user_audit option only, that was just an example. It can gave a wider scope if necessary to include all forms of auditing.

THardy98 commented 1 year ago

Related: https://github.com/cockroachdb/cockroach/pull/107282

Still need to filter out other internal queries (i.e. the console)