on_get_user_security_level Event
Sets the security level for an incoming packet.
Syntax
class SNMPTCPAgentGetUserSecurityLevelEventParams(object): @property def user() -> str: ... @property def engine_id() -> bytes: ... @property def security_level() -> int: ... @security_level.setter def security_level(value) -> None: ... # In class SNMPTCPAgent: @property def on_get_user_security_level() -> Callable[[SNMPTCPAgentGetUserSecurityLevelEventParams], None]: ... @on_get_user_security_level.setter def on_get_user_security_level(event_hook: Callable[[SNMPTCPAgentGetUserSecurityLevelEventParams], None]) -> None: ...
Remarks
The on_get_user_security_level event is fired after the first inspection of each SNMPv3 request. The SecurityLevel parameter determines the level of security for the message.
On entry, the SecurityLevel parameter contains the default security level for User if the user is located in the internal cache, or if the User is not found in the cache, the SecurityLevel will be -1.
The value of SecurityLevel upon exiting the event, determines how the message will be processed:
-1 | The message will be ignored and a on_bad_packet event will be fired. |
0 | No security. The message will be processed without any authentication and/or encryption. |
1 | Authentication only. The message will be checked for a valid signature and the on_get_user_password event will be fired to verify the authentication password. |
2 | Authentication and Privacy. The message will be checked for a valid signature and the on_get_user_password event will be fired twice: first to verify the authentication password, and then to verify the privacy password. |