gufo.snmp.user¶
User structure definition.
Aes128Key
¶
BaseKey
¶
Bases: object
Basic key class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
bytes
|
Key value. |
required |
key_type
|
KeyType
|
Key type. |
Password
|
get_localized_key(master_key, engine_id)
classmethod
¶
Convert master key to localized key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
master_key
|
bytes
|
Master key, must have size according to algorithm. |
required |
engine_id
|
bytes
|
SNMP engine id. |
required |
Returns:
Type | Description |
---|---|
bytes
|
Localized key. Resulting length same as master_key. |
get_master_key(passwd)
classmethod
¶
Convert password to master key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
passwd
|
bytes
|
Password |
required |
Returns:
Type | Description |
---|---|
bytes
|
Master key. Resulting length depends on the algorithm. |
snmpd_key()
¶
Returns key and prefix for createUser.
DesKey
¶
KeyType
¶
Bases: IntEnum
Key type.
Attributes:
Name | Type | Description |
---|---|---|
Password |
Raw password (least security). |
|
Master |
Master key (hashed password). |
|
Localized |
Localized key, mixed with engine id. |
Md5Key
¶
Sha1Key
¶
User
¶
Bases: object
SNMPv3 user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
user name. |
required |
auth_key
|
Optional[BaseAuthKey]
|
Optional authentication key. |
None
|
priv_key
|
Optional[BasePrivKey]
|
Optional privacy key. |
None
|
snmpd_create_user: str
property
¶
createUser part of snmpd.conf.
Returns:
Type | Description |
---|---|
str
|
createUser configuration directive. |
snmpd_rouser: str
property
¶
rouser
part of snmpd.conf.
Returns:
Type | Description |
---|---|
str
|
rouser configuration directive. |
default()
classmethod
¶
get_auth_alg()
¶
Auth algorithm index with key type mask.
Algorithms
- 0 - No auth
- 1 - MD5
- 2 - SHA1
KeyType.mask applied
get_auth_key()
¶
Authentication key.
get_priv_alg()
¶
Privacy algorithm index.
Algorithms
- 0 - No privacy
- 1 - DES
- 2 - AES-128
KeyType.mask applied
get_priv_key()
¶
Privacy key.
require_auth()
¶
Chech if user requires authentication.
Returns:
Type | Description |
---|---|
bool
|
True, if user requires authetication |