OpenSIPS / opensips-cli

OpenSIPS CLI tool - an interactive command line tool that can be used to control and monitor OpenSIPS servers.
GNU General Public License v3.0
85 stars 48 forks source link

cachedb_redis: AUTH support #58

Closed v1cdang closed 4 years ago

v1cdang commented 4 years ago

Any chance you can put auth for the redis module?

liviuchircu commented 4 years ago

hey, @v1cdang -- do I smell an OpenSIPS feature request for the cachedb_redis module? :) If not, then please elaborate, as I have no clue on how Redis ties in with OpenSIPS CLI.

v1cdang commented 4 years ago

Yes this should be a feature request if it's not yet capable of doing redis auth,

On Fri, May 29, 2020 at 11:44 PM Liviu Chircu notifications@github.com wrote:

hey, @v1cdang https://github.com/v1cdang -- do I smell an OpenSIPS feature request https://github.com/OpenSIPS/opensips/issues for the cachedb_redis module? :) If not, then please elaborate, as I have no clue on how Redis ties in with OpenSIPS CLI.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips-cli/issues/58#issuecomment-636043539, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELDP6YNJET2CFOMVLLHIODRT7J4HANCNFSM4NOCYQ6A .

liviuchircu commented 4 years ago

You didn't answer my question - so this is a cachedb_redis feature, so we allow users to plug in a username/password into it before being able to use their Redis instance?

v1cdang commented 4 years ago

yes, you need to allow for username/password for redis instance as well.

On Sat, May 30, 2020 at 3:06 AM Liviu Chircu notifications@github.com wrote:

You didn't answer my question - so this is a cachedb_redis feature, so we allow users to plug in a username/password into it before being able to use their Redis instance?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips-cli/issues/58#issuecomment-636137844, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELDP63I4NIHNONV4CZK5HLRUABUFANCNFSM4NOCYQ6A .

liviuchircu commented 4 years ago

Within the cachedb_redis module, if we take a look at the redis_connect() function, you can see that it already includes Redis "AUTH <password>" support. However, I've noticed that Redis 6 introduced a new flavour of the command: "AUTH <username> <password>", which seems to relate to the new ACL concepts.

Can you relate to the above? Is the current password-based auth support not enough for you, since you are using Redis ACLs? Thanks!

v1cdang commented 4 years ago

Thanks for pointing that out. Where do I set that on opensips.cfg?

On Sat, May 30, 2020, 11:43 PM Liviu Chircu, notifications@github.com wrote:

Within the cachedb_redis module, if we take a look at the redis_connect() function, you can see that it already includes https://github.com/OpenSIPS/opensips/blob/master/modules/cachedb_redis/cachedb_redis_dbase.c#L138 Redis "AUTH " support. However, I've noticed that Redis 6 introduced a new flavour of the command: "AUTH ", which seems to relate to the new ACL concepts.

Can you relate to the above? Is the current password-based auth support not enough for you, since you are using Redis ACLs? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips-cli/issues/58#issuecomment-636348483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELDP6YZB6LVBFOC3UJPJ53RUESRNANCNFSM4NOCYQ6A .

liviuchircu commented 4 years ago

Just include the password in the cachedb_url module parameter. I think that the username will be ignored, but please test and confirm. For example:

modparam("cachedb_redis", "cachedb_url", "redis:cluster1://user:pass@localhost:6379")