Skip to content

Commit 35856dd

Browse files
xuniqandreyaksenov
andauthored
2.11: custom audit messages can now overwrite session type and remote (#4031)
Co-authored-by: Andrey Aksenov <[email protected]>
1 parent 7e85bda commit 35856dd

File tree

2 files changed

+19
-26
lines changed

2 files changed

+19
-26
lines changed

doc/enterprise/audit_log.rst

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ decide whether you need to take actions:
4545
* System events -- events related to modification or configuration of resources.
4646
For example, such logs record the replacement of a space.
4747

48-
* :ref:`User-defined events <audit-log-custom>`-- any events added manually using
48+
* :ref:`Custom events <audit-log-custom>` -- any events added manually using
4949
the audit module API.
5050

5151
The full list of available audit log events is provided in the table below:
@@ -62,7 +62,7 @@ The full list of available audit log events is provided in the table below:
6262
* - Audit log enabled for events
6363
- ``audit_enable``
6464
-
65-
* - :ref:`User-defined events <audit-log-custom>`
65+
* - :ref:`Custom events <audit-log-custom>`
6666
- ``custom``
6767
-
6868
* - User authorized successfully
@@ -191,7 +191,7 @@ Tarantool provides the following event groups:
191191
.. warning::
192192

193193
Be careful when recording ``all`` and ``data_operations`` event groups.
194-
The more events you record, the slower the requests will be processed over time.
194+
The more events you record, the slower the requests are processed over time.
195195
It is recommended that you select only those groups
196196
whose events your company really needs to monitor and analyze.
197197

@@ -223,7 +223,7 @@ They are described in the following table.
223223
- console
224224
* - ``module``
225225
- Audit log module. Set to ``tarantool`` for system events;
226-
can be overwritten for user-defined events
226+
can be overwritten for custom events
227227
- tarantool
228228
* - ``user``
229229
- User who triggered the event
@@ -544,10 +544,11 @@ Example:
544544
545545
.. _audit-log-custom:
546546

547-
Create user-defined events
548-
--------------------------
547+
Custom events
548+
-------------
549549

550-
Tarantool provides an API for writing user-defined audit log events.
550+
Tarantool provides an API for writing custom audit log events.
551+
To enable custom audit log events, specify the ``custom`` value in the :ref:`box.cfg.audit_filter <audit-log-filters>` option.
551552

552553
To add a new event, use the ``audit.log()`` function that takes one of the following values:
553554

@@ -562,7 +563,7 @@ To add a new event, use the ``audit.log()`` function that takes one of the follo
562563
Using the field ``audit.new()``, you can create a new log module that allows you
563564
to avoid passing all custom audit log fields each time ``audit.log()`` is called.
564565
It takes a table of audit log field values (same as ``audit.log()``). The ``type``
565-
of the log module for writing user-defined events must either be ``message`` or
566+
of the log module for writing custom events must either be ``message`` or
566567
have the ``custom_`` prefix.
567568

568569
Example
@@ -581,24 +582,16 @@ Example
581582
tag = 'admin', description = 'Hello, Bob!'})
582583
583584
584-
Some user-defined audit log fields (``time``, ``remote``, ``session_type``)
585-
are set in the same way as for a system event.
586-
If a field is not overwritten, it is set to the same value as for a system event.
585+
It is possible to overwrite most of the custom audit log :ref:`fields <audit-log-structure>` using ``audit.new()`` or ``audit.log()``.
586+
The only audit log field that cannot be overwritten is ``time``.
587+
If a field is not overwritten, it is set to the same value as for a system event.
588+
If omitted, ``session_type`` is set to the current session type, ``remote`` is set to the remote peer address.
587589

588-
Some audit log fields you can overwrite with ``audit.new()`` and ``audit.log()``:
590+
.. note::
589591

590-
* type
591-
* user
592-
* module
593-
* tag
594-
* description
595-
596-
.. note::
597-
598-
To avoid confusion with system events, the value of the type field must either be ``message`` (default)
599-
or begin with ``custom_``. Otherwise you will get the error message.
600-
User-defined events are filtered out by default.
601-
To enable user-defined audit log events, you must add ``custom`` to ``box.cfg.audit_filter``.
592+
To avoid confusion with system events, the value of the type field must either be ``message`` (default)
593+
or begin with the ``custom_`` prefix. Otherwise, you receive the error message.
594+
Custom events are filtered out by default.
602595

603596
Example
604597
~~~~~~~

doc/reference/tooling/tt_cli/search.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Options
2525

2626
.. option:: --debug
2727

28-
**Applicable to:** ``taranttol-ee``
28+
**Applicable to:** ``tarantool-ee``
2929

3030
Search for debug builds of Tarantool Enterprise Edition's SDK.
3131

@@ -36,7 +36,7 @@ Options
3636

3737
.. option:: --version VERSION
3838

39-
**Applicable to:** ``taranttol-ee``
39+
**Applicable to:** ``tarantool-ee``
4040

4141
Tarantool Enterprise version.
4242

0 commit comments

Comments
 (0)