Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-33240

Use Couchbase CLI to configure Audit's Filtered Events

    XMLWordPrintable

Details

    Description

      Currently the couchbase-cli tool can be used to adjust the following parameters

      • enabled
      • audit-log-rotate-interval
      • audit-log-path

      A customer wanted to configure the filtered events in audit logs using Couchbase CLI and hence we wanted a way to do that.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            Build couchbase-server-1006.5.1-1069 contains couchbase-cli commit d2b9709 with commit message:
            MB-33240 Match UI audit settings in setting-audit

            build-team Couchbase Build Team added a comment - Build couchbase-server-1006.5.1-1069 contains couchbase-cli commit d2b9709 with commit message: MB-33240 Match UI audit settings in setting-audit
            ritam.sharma Ritam Sharma added a comment -

            There are few issues:

            a) There needs to be one of the 3 parameters for new commands to work - May rest api needs it. In that case I help needs a clear update
            if not (opts.enabled or opts.log_path or opts.rotate_interval or opts.rotate_size):
            2206
            _exitIfErrors(["No settings specified to be changed"])

            b) Execute the following:

            [root@node1-cb600-centos7 bin]# ./couchbase-cli setting-audit --set --disable-events 40964 --audit-log-rotate-size 100 -c localhost -u Administrator -p password
            SUCCESS: Audit settings modified
            – Output - event 40962 is disabled
            40962 | view_engine | Query DDoc Meta Data | True
            40963 | view_engine | View Query | True
            40964 | view_engine | Update Design Doc | False

            2nd command -
            [root@node1-cb600-centos7 bin]# ./couchbase-cli setting-audit --set --disable-events 40962 --audit-log-rotate-size 100 -c localhost -u Administrator -p password
            SUCCESS: Audit settings modified
            – Output 40962 is disabled, but bug is that 40964 is now enabled.
            40962 | view_engine | Query DDoc Meta Data | False
            40963 | view_engine | View Query | True
            40964 | view_engine | Update Design Doc | True

            • Problem can be with rest api, but user needs to remember all the disabled and enabled ones and send it over in single command.

            c)
            User is to be given as ritam/local - which does not match with UI of ritam/couchbase.

            ritam.sharma Ritam Sharma added a comment - There are few issues: a) There needs to be one of the 3 parameters for new commands to work - May rest api needs it. In that case I help needs a clear update if not (opts.enabled or opts.log_path or opts.rotate_interval or opts.rotate_size): 2206 _exitIfErrors( ["No settings specified to be changed"] ) b) Execute the following: [root@node1-cb600-centos7 bin] # ./couchbase-cli setting-audit --set --disable-events 40964 --audit-log-rotate-size 100 -c localhost -u Administrator -p password SUCCESS: Audit settings modified – Output - event 40962 is disabled 40962 | view_engine | Query DDoc Meta Data | True 40963 | view_engine | View Query | True 40964 | view_engine | Update Design Doc | False 2nd command - [root@node1-cb600-centos7 bin] # ./couchbase-cli setting-audit --set --disable-events 40962 --audit-log-rotate-size 100 -c localhost -u Administrator -p password SUCCESS: Audit settings modified – Output 40962 is disabled, but bug is that 40964 is now enabled. 40962 | view_engine | Query DDoc Meta Data | False 40963 | view_engine | View Query | True 40964 | view_engine | Update Design Doc | True Problem can be with rest api, but user needs to remember all the disabled and enabled ones and send it over in single command. c) User is to be given as ritam/local - which does not match with UI of ritam/couchbase.

            Carlos Gonzalez BetancortCan you take a look at Ritam Sharma points above.

            pvarley Patrick Varley added a comment - Carlos Gonzalez Betancort Can you take a look at Ritam Sharma points above.
            owend Daniel Owen added a comment - - edited

            Hi Ritam,

            Thanks for identifying the bug regarding --disable-events and --disabled-users not working on their own. I have a created MB-38575 for this to be tracked.

            Regarding b) The issue where repeated calls to disable-events results in unexpected behaviour. Unfortunately this is a limitation of the REST API. ns_server are aware of this limitation - see MB-30256.
            Regarding c) The issue of needing to use ritam/local and opposed to Rita/couchbase - again this is a limitation of the REST API, see manage-auditing

            Note, however, that when specified using the REST API, local and internal usernames take the /local, rather than the /couchbase suffix.

            owend Daniel Owen added a comment - - edited Hi Ritam, Thanks for identifying the bug regarding --disable-events and --disabled-users not working on their own. I have a created MB-38575 for this to be tracked. Regarding b) The issue where repeated calls to disable-events results in unexpected behaviour. Unfortunately this is a limitation of the REST API. ns_server are aware of this limitation - see MB-30256 . Regarding c) The issue of needing to use ritam/local and opposed to Rita/couchbase - again this is a limitation of the REST API, see manage-auditing Note, however, that when specified using the REST API, local and internal usernames take the /local, rather than the /couchbase suffix.

            Build couchbase-server-1006.5.1-1125 contains couchbase-cli commit d2b9709 with commit message:
            MB-33240 Match UI audit settings in setting-audit

            build-team Couchbase Build Team added a comment - Build couchbase-server-1006.5.1-1125 contains couchbase-cli commit d2b9709 with commit message: MB-33240 Match UI audit settings in setting-audit

            People

              carlos.gonzalez Carlos Gonzalez Betancort (Inactive)
              nithin.bodanapu Nithin Bodanapu
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty