-
Notifications
You must be signed in to change notification settings - Fork 366
Support multiple security parameters for receiving SNMP V3 traps #457
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
Conversation
…sernames Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
…ching Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
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.
Oh, now I see why UnmarshalTrapBase
was returning the result. So what if instead of passing result as second parameter, you pass the secParams?
What do you think of my suggestions? I also think UnmarshalTrapBase
does not need to be exported, just like the one for headers also isn't.
…ms, clearer names Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
c67261b
to
5bc0a02
Compare
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.
Hi @zoedt , thank you for contributing this feature. Initial review looks great to me!
I dropped one implementation specific question for discussion and look forward to reviewing the rest of this feature soon.
} | ||
} | ||
|
||
func (spm *SnmpV3SecurityParametersTable) Add(key string, sp SnmpV3SecurityParameters) error { |
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.
Current implementation of this Add
method allows for multiple UsmSecurityParameters to be associated with the same userName. This approach seems to offer some interesting flexibility. However, I'm keen to understand the specific scenarios or requirements that led to this design choice.
In light of the specifications outlined in RFC 3414, particularly the one-to-one relationship between userName and securityName, The RFC suggests that each userName should correspond to a unique set of security parameters. Were you aware of this?
If all reviewers eventually decide this behavior is OK we could perhaps log the specific occurrence where we append SP's to an existing userName, but lets not get ahead of things yet.
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.
i did know about the specifications outlined in rfc 3414 - for my use case (for my team) we wanted to reduce the overhead of requiring those wanting to set up a listener of traps for multiple devices (and thus multiple securityNames/engine IDs) and reducing friction that way.
if we followed the unique set of security parameters per key of username/security name it would definitely not need the for loop to try each credential (as there would only be one possible one)
there could be the possibility of supporting that by changing the getIdentifier
to return the username/securityName combo to follow the RFC guidelines, but maybe we can discuss further if we want to support both or have a strong opinion (for strictly following the RFC or the current path forward)
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.
also (a tangent), i was curious about the gosnmp
struct's contextEngineId
- what should expected to be populated here? i might have missed something but i don't see it used very often beyond when snmp packets are made / should the informs be using that to discover the engine ID?
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.
after talking w/ a coworker: maybe there can be some configuration based on however the user wants to set up:
- if a security parameter is added with the authoritative engine ID then
getIdentifier
will return both username / security name - otherwise, it will defer to only adding the key as the username
for flexibility between both.
what do you think?
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.
Sorry for slow replies. I'm sick and not really up for code(review) at this very moment but let's try:
My main point was that I'm a proponent to be verbose when appending multiple security parameters for the same userName, As that behavior is not specifically outlined in the RFC as best-practice nor requirement. Please log the occurrence.
What confuses me about the current implementation of the UsmSecurityParameters struct is that we seem to mix some Engine and User configs. This was never a problem but becomes confusing now that we allow multiple sec params to be defined by this code. Also the fact that we need to define 4 loggers in the example code convinces me that this implementation needs some care. If this would block your PR it would need to become a TODO item so that we can think and discuss this in a separate issue?
@SuperQ @Hipska what do you think about last mentioned item?
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.
I have no further opinion on this.
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.
I addressed some of the logging concerns with my latest commit, let me know your thoughts on that aspect of your feedback!
As for the mixing of engine / user configs - I just want to clarify: that would be around the engine ID, engine boots, engine time and username (as well as if they've configured authentication / privacy protocols)?
…params Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
a1ad732
to
83a06ce
Compare
Question:I feel as though it’s confusing to only utilize the security parameters for storing the engine ID in the case of multiple listeners, should there be an explicit field utilized and should it be More background + defining the terms I’m using because I’m not sure if I’m using them correctly:SNMP manager
SNMP agent
Engine ID
|
@TimRots @SuperQ hi! just wanted to bump this with a question: do we feel like the PR's main logic and additions are generally okay / will be accepted with some more feedback or tweaks? my team is hoping to utilize this logic and we would like to understand if we use it as it is right now that it won't be something we'd have to maintain ourselves if this PR doesn't actually make it in thank you!! |
Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
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.
LGTM
* [CHANGE] Refactor netsnmp playback function to use an io.Reader #459 * [FEATURE] Support multiple security parameters for receiving SNMP V3 traps #457 * [ENHANCEMENT] netsnmp tests: tame overzealous file / dir permissions #458 Also update missing v1.37.0 changelog entries. Signed-off-by: SuperQ <superq@gmail.com>
* [CHANGE] Refactor netsnmp playback function to use an io.Reader #459 * [FEATURE] Support multiple security parameters for receiving SNMP V3 traps #457 * [ENHANCEMENT] netsnmp tests: tame overzealous file / dir permissions #458 Also update missing v1.37.0 changelog entries. Signed-off-by: SuperQ <superq@gmail.com>
…nmp#457) * First iteration of adding user security params map, assuming unique usernames * Log when new SP is added to map, add logger to map --------- Signed-off-by: zoe ✨ <9274242+zoedt@users.noreply.github.com>
Greetings 😄 PR addressing issue #302
This PR adds multiple security parameter support for receiving SNMP V3 traps.
Notes:
Example steps
trapserver_v3