Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-7121

Add user auth support for zabbix-agent2 redis plugin

    • Sprint candidates
    • 2

      Redis since 6 version, supports user ACL (ACL user password), go-redis also supports Options.Username parameter in connection options since v7.3.

      But redis plugin documentation said

      "Embedded URI credentials (userinfo) are forbidden and will be ignored. So, you can't pass the credentials by this:

      redis.ping[tcp://user:password@127.0.0.1] — WRONG"

      I wonder, why. Using ACL like "user zabbix on +@connection +info +config +slowlog >password" and connection URI tcp://zabbix:password@localhost:6379 is more configurable and secure way, than using global admin password for all redis instances.

          [ZBXNEXT-7121] Add user auth support for zabbix-agent2 redis plugin

          Joachim added a comment -

          I am willing to try working on this feature. How can I get started ? Do the project accepts merge requests ?

          Joachim added a comment - I am willing to try working on this feature. How can I get started ? Do the project accepts merge requests ?

          greg long added a comment -

          I also need this feature

          using default user is not feasible in many cases as zabbix agent plugin seems to require +config which exposes many this we dpon;t wish to expose to default

          greg long added a comment - I also need this feature using default user is not feasible in many cases as zabbix agent plugin seems to require +config which exposes many this we dpon;t wish to expose to default

          Matthew Steeves added a comment - - edited

          Just to add some more info, the Zabbix Agent2 plug-in for Redis uses the Radix Go client to interface with Redis.
          I found that in the Redis plug-in (conn.go on line 148), Zabbix uses the Radix call DialAuthPass(), which only takes a password. Per Radix's docs, in version 3.5.0 they added DialAuthUser(), which takes both username and password. Guessing this wasn't available at time Zabbix was developing the plugin...

          I haven't tried this (yet), but wanted to put what I learned from digging I was doing today. Personally, I'm going to first see if we can use the Unix socket approach instead.

          Matthew Steeves added a comment - - edited Just to add some more info, the Zabbix Agent2 plug-in for Redis uses the Radix Go client to interface with Redis. I found that in the Redis plug-in ( conn.go on line 148 ), Zabbix uses the Radix call DialAuthPass() , which only takes a password. Per Radix's docs, in version 3.5.0 they added DialAuthUser(), which takes both username and password. Guessing this wasn't available at time Zabbix was developing the plugin... I haven't tried this (yet), but wanted to put what I learned from digging I was doing today. Personally, I'm going to first see if we can use the Unix socket approach instead.

          Any update on this issue? I think that in many situations, it wouldn't be acceptable to not have authentication on Redis because the monitoring agent doesn't support it.

          Pietro Marini (RCA Systems) added a comment - Any update on this issue? I think that in many situations, it wouldn't be acceptable to not have authentication on Redis because the monitoring agent doesn't support it.

          Hey Marini, I ended up extending the agent and got redis monitoring working with a username and password. Wasn't terribly hard. I just compiled the customizations on one agent and am running all my redis checks from there. It ends up being about 9 lines of code changes, and then 4 lines of template changes to use the new functionality. If you want more detail, let me know.

          Matthew Steeves added a comment - Hey Marini , I ended up extending the agent and got redis monitoring working with a username and password. Wasn't terribly hard. I just compiled the customizations on one agent and am running all my redis checks from there. It ends up being about 9 lines of code changes, and then 4 lines of template changes to use the new functionality. If you want more detail, let me know.

          Thanks for sharing Matthew.Steeves2, that's interesting.

          If I got you correctly, you had to:

          1. modify Zabbix Agent 2 code and compile it
          2. change the template

          While 2. would be just filing a merge  request [here|https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/redis?at=release/6.4,] the modification 1. would need merging into a much larger code base.

          In any case, yes, please give more details

          Pietro Marini (RCA Systems) added a comment - Thanks for sharing Matthew.Steeves2 , that's interesting. If I got you correctly, you had to: modify Zabbix Agent 2 code and compile it change the template While 2. would be just filing a merge  request [here| https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/redis?at=release/6.4 ,] the modification 1. would need merging into a much larger code base. In any case, yes, please give more details

          Eriks Sneiders added a comment - - edited

          Implemented in 

          Eriks Sneiders added a comment - - edited Implemented in  7.0.10rc1, Zabbix agent 2: 34b9b8b906d Plugin support (sdk): 2d8ff4f1c56 7.2.4rc1, Zabbix agent 2: e09c4415a18 Plugin support (sdk): f1cf35a78be 7.4.0alpha1 (master) Zabbix agent 2: 01cd832880e Plugin support (sdk): 06fc17a9298

          Documented in:

          • What's new in Zabbix (7.0.10, 7.2.4)
          • Appendixes > Process configuration > Zabbix agent 2 plugins > Redis plugin (7.0, 7.2, 7.4)

          Marianna Zvaigzne added a comment - Documented in: What's new in Zabbix ( 7.0.10 , 7.2.4 ) Appendixes > Process configuration > Zabbix agent 2 plugins > Redis plugin ( 7.0 , 7.2 , 7.4 )

            esneiders Eriks Sneiders
            j.malinovski Juri Malinovski
            Team INT
            Votes:
            11 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 8h
                8h