-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNMP hardening - redis socket connect #281
SNMP hardening - redis socket connect #281
Conversation
Getting use_unix_socket_path value as argument instead of default True
Could you add unit test to cover the code change? |
@@ -211,6 +211,8 @@ def split_sai_id_key(sai_id_key): | |||
def config(**kwargs): | |||
global redis_kwargs | |||
redis_kwargs = {k:v for (k,v) in kwargs.items() if k in ['unix_socket_path', 'host', 'port']} | |||
if 'unix_socket_path' in redis_kwargs and 'host' in redis_kwargs and 'port' in redis_kwargs: | |||
redis_kwargs['use_unix_socket_path'] = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if unix_socket_path or host is not present in redis_kwargs?
I see that with master branch image, redis_kwargs only has 'decode_responses' and with that the connection to redis fails.
If I add "use_unix_socket_path" to true in redis_kwargs, then the connection is successful and snmp_subagent comes up. Can you re-check if this works as expected ?
We had a discussion about it few months ago, is there infra for it? |
Could you write a unit test for function In reply to: 1759423882 |
- What I did
in order to support snmp container hardening in sonic-net/sonic-buildimage#15176
Made snmp agent to communicate with redis using socket
- How I did it
Added the use of socket connection to redis during snmp agent init
- How to verify it
Configure and run snmp
- Description for the changelog
Added the use of socket connection to redis during snmp agent init