[フレーム]
Docs Pricing
Login Book a meeting Try Redis

Audit connection events

Describes how to audit connection events.

Redis Enterprise Software

Starting with version 6.2.18, Redis Enterprise Software lets you audit database connection and authentication events. This helps you track and troubleshoot connection activity.

The following events are tracked:

When tracked events are triggered, notifications are sent via TCP to an address and port defined when auditing is enabled. Notifications appear in near real time and are intended to be consumed by an external listener, such as a TCP listener, third-party service, or related utility.

Example external listeners include:

For development and testing environments, notifications can be saved to a local file; however, this is neither supported nor intended for production environments.

For performance reasons, auditing is not enabled by default. In addition, auditing occurs in the background (asynchronously) and is non-blocking by design. That is, the action that triggered the notification continues without regard to the status of the notification or the listening tool.

Enable audit notifications

Cluster audits

To enable auditing for your cluster, use:

Database audits

Once auditing is enabled for your cluster, you can audit individual databases. To do so, use:

You must enable auditing for your cluster before auditing a database; otherwise, an error appears:

Error setting description: Unable to enable DB Connections Auditing before feature configurations are set.
Error setting error_code: db_conns_auditing_config_missing

To resolve this error, enable the protocol for your cluster before attempting to audit a database.

Policy defaults for new databases

To audit connections for new databases by default, use:

Notification examples

Audit event notifications are reported as JSON objects.

New connection

This example reports a new connection for a database:

{
 "ts":1655821384,
 "new_conn":
 {
 "id":2285001002 ,
 "srcip":"127.0.0.1",
 "srcp":"39338",
 "trgip":"127.0.0.1",
 "trgp":"12635",
 "hname":"",
 "bdb_name":"DB1",
 "bdb_uid":"5"
 }
}

Authentication request

Here is a sample authentication request for a database:

{
 "ts":1655821384,
 "action":"auth",
 "id":2285001002 ,
 "srcip":"127.0.0.1",
 "srcp":"39338",
 "trgip":"127.0.0.1",
 "trgp":"12635",
 "hname":"",
 "bdb_name":"DB1",
 "bdb_uid":"5",
 "status":2,
 "username":"user_one",
 "identity":"user:1",
 "acl-rules":"~* +@all"
}

The status field reports the following:

Database disconnect

Here's what's reported when a database connection is closed:

{
 "ts":1655821384,
 "close_conn":
 {
 "id":2285001002,
 "srcip":"127.0.0.1",
 "srcp":"39338",
 "trgip":"127.0.0.1",
 "trgp":"12635",
 "hname":"",
 "bdb_name":"DB1",
 "bdb_uid":"5"
 }
}

Notification field reference

The field value that appears immediately after the timestamp describes the action that triggered the notification. The following values may appear:

In addition, the following fields may also appear in audit event notifications:

Field name Description
acl-rules ACL rules associated with the connection, which includes a rule for the default user.
bdb_name Destination database name - The name of the database being accessed.
bdb_uid Destination database ID - The cluster ID of the database being accessed.
hname Client hostname - The hostname of the client. Currently empty; reserved for future use.
id Connection ID - Unique connection ID assigned by the proxy.
identity Identity - A unique ID the proxy assigned to the user for the current connection.
srcip Source IP address - Source TCP/IP address of the client accessing the Redis database.
srcp Source port - Port associated with the source IP address accessing the Redis database. Combine the port with the address to uniquely identify the socket.
status Status result code - An integer representing the result of an authentication request.
trgip Target IP address - The IP address of the destination being accessed by the action.
trgp Target port - The port of the destination being accessed by the action. Combine the port with the destination IP address to uniquely identify the database being accessed.
ts Timestamp - The date and time of the event, in Coordinated Universal Time (UTC). Granularity is within one second.
username Authentication username - Username associated with the connection; can include default for databases that allow default access. (Passwords are not recorded).

Status result codes

The status field reports the results of an authentication request as an integer. Here's what different values mean:

Error value Error code Description
0 AUTHENTICATION_FAILED Invalid username and/or password.
1 AUTHENTICATION_FAILED_TOO_LONG Username or password are too long.
2 AUTHENTICATION_NOT_REQUIRED Client tried to authenticate, but authentication isn't necessary.
3 AUTHENTICATION_DIRECTORY_PENDING Attempting to receive authentication info from the directory in async mode.
4 AUTHENTICATION_DIRECTORY_ERROR Authentication attempt failed because there was a directory connection error.
5 AUTHENTICATION_SYNCER_IN_PROGRESS Syncer SASL handshake. Return SASL response and wait for the next request.
6 AUTHENTICATION_SYNCER_FAILED Syncer SASL handshake. Returned SASL response and closed the connection.
7 AUTHENTICATION_SYNCER_OK Syncer authenticated. Returned SASL response.
8 AUTHENTICATION_OK Client successfully authenticated.
RATE THIS PAGE
Back to top ↑

On this page

AltStyle によって変換されたページ (->オリジナル) /