setting-audit

setting-audit

Modifies audit log settings

SYNTAX

couchbase-cli setting-audit [--cluster <url>] [--username <user>]
          [--password <password>] [--audit-enabled <num>] [--audit-log-path <path>]
          [--audit-log-rotate-interval <seconds>]

DESCRIPTION

Auditing is used to observe the action of users in the cluster. It is usually turned on for security purposes to ensure that those without permission to access information do not access it. By default auditing is disabled in Couchbase. The setting-audit command can be used to enable auditing, set the auditing log path, and change the auditing log rotation interval.

OPTIONS

-c
--cluster

Specfies the hostname of a node in the cluster. See the HOST FORMATS section for more information on specifying a hostname.

-u
--user <username>

Specifies the username of the user executing the command. If you do not have a user account with permision to execute the command then it will fail with an unauthorized error.

-p
--password <password>

Specifies the password of the user executing the command. If you do not have a user account with permision to execute the command then it will fail with an unauthorized error. If this argument is specified, but no password is given then the command will prompt the user for a password through non-echoed stdin. You may also specify your password by using the environment variable CB_REST_PASSWORD.

--audit-enabled <num>

Specifies whether or not auditing is enabled. To enabled auditing set this option to "1". To disable auditing set this option to "0".

--audit-log-path <path>

Specifies The auditing log path. This should be a path should be a path to a folder where the auditing log is kept. The folder must exist on all servers in the cluster.

--audit-log-rotate-interval <seconds>

Specifies the audit log rotate interval. This is the interval in which the current audit log will be replaced with a new empty audit log file. The log file is rotated to ensure that the audit log does not consume too much disk space. The minimum audit log rotate interval is 15 minutes (900 seconds).

HOST FORMATS

When specifying a host for the couchbase-cli command the following formats are expected:

  • couchbase://<addr>

  • <addr>:<port>

  • http://<addr>:<port>

It is recommended to use the couchbase://<addr> format for standard installations. The other two formats allow an option to take a port number which is needed for non-default installations where the admin port has been set up on a port other that 8091.

EXAMPLES

To enable auditing on a cluster and set the audit log to the default logs folder on a linux installation with a log rotate interval of 7 days run the command below.

$ couchbase-cli setting-audit -c 192.168.1.5:8091 --username Administrator \
 --password password --enabled 1 --audit-log-rotate-interval 604800 \
 --audit-log-path /opt/couchbase/var/lib/couchbase/logs

To disable auditing run the following command.

$ couchbase-cli setting-audit -c 192.168.1.5:8091 --username Administrator \
 --password password --enabled 1

ENVIRONMENT AND CONFIGURATION VARIABLES

CB_REST_PASSWORD Specifies the password of the user executing the command. This environment variable allows you to specify a default argument for the -p/--password argument on the command line. It also allows the user to ensure that their password are not cached in their command line history.

CB_REST_PASSWORD Specifies the password of the user executing the command. This environment variable allows you to specify a default argument for the -p/--password argument on the command line.