puresnmp_plugins.security.v1 module

This module provides the SNMP security model for community based v1 exchanges

class puresnmp_plugins.security.v1.SNMPv1SecurityModel

Bases: SecurityModel[PDU, Sequence]

Implementation of the SNMPv1 community based security model

generate_request_message(message: PDU, security_engine_id: bytes, credentials: Credentials) Sequence

Take a plain unprocessed message and applies security to the message as defined by the concrete security model.

It returns the processed message including security modifications. Further processing is provided by the “message-processing-model” to prepare it for sending out to the network.

The kind of processing applied to the message depends on the credential type.

Parameters:
  • message – The original message

  • security_engine_id – The engine-id of the receiving SNMP engine

  • credentials – A credential object giving information on what kind of operations are needed on the message.

process_incoming_message(message: Sequence, credentials: Credentials) PDU

Takes a message which included potential security modifications (like encryption) and “undoes” these modifications in order to make the message usable again.

Returns an unprocessed message.

The kind of processing applied to the message depends on the credential type.

Parameters:
  • message – The original message

  • credentials – A credential object giving information on what kind of operations are needed on the message.

puresnmp_plugins.security.v1.create() SNMPv1SecurityModel

Create a new instance of the security model