[redis] Add redis Group And Grant Read/Write Access to Members#5289
[redis] Add redis Group And Grant Read/Write Access to Members#5289tahmed-dev merged 3 commits intosonic-net:masterfrom
Conversation
sonic-cfggen is now using Unix Domain Socket for Redis DB. The socket is created using root account. Subsequently, services that are started as admin fails to start. This PR creates redis group and add admin user to redis group. It also grants read/write access on redis.sock for redis group members. signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
jleveque
left a comment
There was a problem hiding this comment.
LGTM. Please wait for other reviewers.
pavel-shirshov
left a comment
There was a problem hiding this comment.
LGTM but wait for others
5a14b5f
judyjoseph
left a comment
There was a problem hiding this comment.
Looks ok with multi-asic platform. One observation though I don't see this new redis group inside the docker. But I feel it is ok as long as the owner is root.
admin@str--acs-1:~$ docker exec -it database bash
root@str--acs-1:/# ls -la /var/run/redis/redis.sock
srwxrw---- 1 root 1000 0 Sep 3 05:29 /var/run/redis/redis.sock
docker has user |
sonic-cfggen is now using Unix Domain Socket for Redis DB. The socket is created using root account. Subsequently, services that are started as admin fails to start. This PR creates redis group and add admin user to redis group. It also grants read/write access on redis.sock for redis group members. signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
…-net#5289) sonic-cfggen is now using Unix Domain Socket for Redis DB. The socket is created using root account. Subsequently, services that are started as admin fails to start. This PR creates redis group and add admin user to redis group. It also grants read/write access on redis.sock for redis group members. signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
…s unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net/sonic-buildimage#7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
What I did: Changes to Use Redis Unix Socket if the user is root else default to TCP Why I did: With the changes in PR:sonic-net/sonic-buildimage#5289 access to redis unix socket is given to the redis group members or to the root. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net/sonic-buildimage#7002 where we default to use TCP for Redis if user is not root in sonic-cfggen. This should fix: sonic-net/sonic-buildimage#8501
…s unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net/sonic-buildimage#7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
9ce4d19d5a199cffe2933d80e343a80ded398b4a (HEAD -> 201911, origin/201911) With the changes in PR:#5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: #7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
78f167e4728f939712b3f3ea550949e2ea675fec With the changes in PR:sonic-net#5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: sonic-net#7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
*[Submodule update] sonic-py-swssdk 78f167e4728f939712b3f3ea550949e2ea675fec With the changes in PR:#5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: #7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
sonic-cfggen is now using Unix Domain Socket for Redis DB. The socket
is created using root account. Subsequently, services that are started
as admin fail to start. This PR creates redis group and add admin
user to redis group. It also grants read/write access on redis.sock
for redis group members.
closes #5277
resolves #5277
signed-off-by: Tamer Ahmed tamer.ahmed@microsoft.com
- Why I did it
Access to redis.sock fails when using admin account
- How I did it
Added
redisgroupChanged
redis.sockgroup to the new groupredisGave read/write access to
redisgroup onredis.sock- How to verify it
without this change
with this change
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)