SNMP hardening - redis socket connect#281
Closed
ycoheNvidia wants to merge 4 commits intosonic-net:masterfrom
Closed
SNMP hardening - redis socket connect#281ycoheNvidia wants to merge 4 commits intosonic-net:masterfrom
ycoheNvidia wants to merge 4 commits intosonic-net:masterfrom
Conversation
Getting use_unix_socket_path value as argument instead of default True
qiluo-msft
reviewed
Sep 14, 2023
qiluo-msft
approved these changes
Sep 24, 2023
SuvarnaMeenakshi
approved these changes
Sep 26, 2023
Contributor
|
Could you add unit test to cover the code change? |
| 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 |
Contributor
There was a problem hiding this comment.
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 ?
Author
We had a discussion about it few months ago, is there infra for it? |
Contributor
|
Could you write a unit test for function In reply to: 1759423882 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- 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