Skip to content
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

snmptrap V3 username issue #930

Open
alfletch opened this issue Dec 19, 2023 · 4 comments
Open

snmptrap V3 username issue #930

alfletch opened this issue Dec 19, 2023 · 4 comments
Labels
known issue wontfix This will not be worked on

Comments

@alfletch
Copy link

I have an issue where I may be using the same username for multiple secrets, but only the last listed in the values file is used for authentication.

For example, I have setup secrets
secret1 - username=myuser, authkey=myauthkey1, privkey=myprivkey1
secret2 - username=myuser, authkey=myauthkey1, privkey=myprivkey2

Then in the values.yaml file,
traps:
usernameSecrets:
- secret1
- secret2

In this case when sending traps, only secret2 is authenticated, if I reverse the order of the secrets, then the only traps with secret1 are authenticated.

@ajasnosz
Copy link
Collaborator

Hello,
thank you for spotting that, I checked this configuration and it is a bug, that occurs when you have the same usernames. We will try to investigate it further.

@ajasnosz ajasnosz added the bug Something isn't working label Dec 21, 2023
@frankli-n
Copy link

frankli-n commented Mar 1, 2024

This bug is an issue for staff at my company too. Any more info on which code is causing the bug? My understanding is the main() function in traps.py seems to be handling it okay.

@ajasnosz
Copy link
Collaborator

ajasnosz commented Mar 1, 2024

Yes, from what we tested for now it looked like the issue might be in how pysnmp library is handling the secrets, we will look further into that.

@ajasnosz ajasnosz added wontfix This will not be worked on known issue and removed bug Something isn't working labels Mar 26, 2024
@ajasnosz
Copy link
Collaborator

Hello All, after looking into pysnmp library this behaviour is the expected one. Pysnmp allows only one-to-one mapping between userName and securityName, which is the key for getting secret configuration. This solution is based on snmp standard mentioned in rfc: https://www.rfc-editor.org/rfc/rfc3414#page-12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known issue wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants