-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
SNMPv3 trap support to snmp_trap input plugin #7294
Conversation
… in order to receive SNMPv3 traps
I have a pull request to the upstream dependency, which fixes bugs regarding authentication and privacy key generation: gosnmp/gosnmp#224 After it is accepted, the tests regarding AuthNoPriv and AuthPriv scenarios should pass. |
… traps. Additionally added support to snmp_trap for AES192, AES192C, AES256 and AES256C with tests.
My upstream pull requests was accepted and I updated the dependency. Now it has sufficient unit tests implemented that pass. I also added support for AES192, AES259, AES192c and AES256c as privacy protocols. For some reason check "test-go-1.12" seems to be stuck on github, whereas circleci shows it has passed. |
… bumping gonsmp version and updating tests.
Hi kauppine, thanks for your contribution! I built your branch and tried it with a v3 trap generated by net-snmp's sendtrap command. I haven't been able to get it to work, in fact I'm getting a panic in gosnmp when telegraf receives the trap. Could you take a look? Here's the snmp_trap input section from my telegraf.conf.
Here's the snmptrap command I've been using. It sends to localhost so it needs to be run on the same machine as telegraf.
Here's the telegraf output including the panic.
I think the trap is sent correctly because I can configure wireshark with the auth and priv info and it decrypts the packet as expected. |
Hi @reimda |
Thanks for looking into the panic. With the newer upstream version I was able to get the snmptrap command from my last comment to work. I did also have to add version = "3" to my telegraf.conf. Were you planning to work with gosnmp upstream to get SHA2 support added back before we move forward with this PR? I would guess SHA2 auth is a must have for many v3 trap users since MD5 and SHA1 have known weaknesses. |
Sorry for late reply @reimda . I have monitored the SHA2 development in the gosnmp-package. However, there still seems to be some unresolved issues regarding SNMPv3 traps. |
Thanks @kauppine! |
Extend snmp_trap input plugin to support SNMPv3 traps. MD5 and SHA1 authentication protocols are supported, and DES, AES, AES192, AES256, AES192c and AES256c privacy protocols are supported.
Extend snmp_trap input plugin to support SNMPv3 traps. MD5 and SHA1 authentication protocols are supported, and DES, AES, AES192, AES256, AES192c and AES256c privacy protocols are supported.
Extend snmp_trap input plugin to support SNMPv3 traps. MD5 and SHA1 authentication protocols are supported, and DES, AES, AES192, AES256, AES192c and AES256c privacy protocols are supported.
Extend snmp_trap input plugin to support SNMPv3 traps. MD5 and SHA1 authentication protocols are supported, and DES, AES, AES192, AES256, AES192c and AES256c privacy protocols are supported.
Extended snmp_trap input plugin to support SNMPv3 user security model in order to receive SNMPv3 traps. For authentication MD5 and SHA1 are supported, and for privacy DES, AES, AES192, AES259, AES192c and AES256c. Unit tests are implemented for all authentication and privacy protocols. The new code is adapted from snmp input plugin.
The gonsmp package claims that AES192, AES259, AES192c and AES256c would be also supported but I did not verify these.This should solve issue #6918
Working unit tests have been implemented.
It currently has a test for the no authentication and no privacy case. I was not able to implement tests for authentication and privacy due to issues with sending traps with gosnmp. Those tests are currently commented out. However, I did verify authentication and privacy settings to work in real-life scenarios with MD5/SHA and DES/AES.Required for all PRs: