on_get_user_password Event
Retrieves a password associated with a user.
Syntax
class SNMPTrapMgrGetUserPasswordEventParams(object): @property def password_type() -> int: ... @property def user() -> str: ... @property def engine_id() -> bytes: ... @property def password() -> str: ... @password.setter def password(value) -> None: ... @property def algorithm() -> int: ... @algorithm.setter def algorithm(value) -> None: ... # In class SNMPTrapMgr: @property def on_get_user_password() -> Callable[[SNMPTrapMgrGetUserPasswordEventParams], None]: ... @on_get_user_password.setter def on_get_user_password(event_hook: Callable[[SNMPTrapMgrGetUserPasswordEventParams], None]) -> None: ...
Remarks
The on_get_user_password event is fired after initial inspection of SNMPv3 requests.
The type of password required is provided in the PasswordType parameter: 1 for authentication, and 2 for encryption (privacy).
The password corresponding to User and EngineId must be provided in the Password parameter. If the password is valid, processing will continue to other events such as on_get_request, on_set_request, etc.
If the PasswordType parameter is 1 (authentication is used), the Algorithm parameter can be set. Possible values are:
Value | Authentication Algorithm |
0 (default) | Any |
1 | MD5 |
2 | SHA1 |
3 | SHA256 |
4 | SHA512 |
Value | Encryption Algorithm |
1 (default) | DES |
2 | AES |
3 | 3DES |
4 | AES192 |
5 | AES256 |
If the password does not match the signature in the request, a on_bad_packet event will be fired, at which point you can decide whether to report the error to the client (see the description of the on_bad_packet event for more information).
If the User is invalid or unknown, set the password to empty string (default) to ignore the request. This will result in a on_bad_packet event being fired, at which point you can decide whether to report the error to the client or not.