diff options
author | aapostoliuk <108394744+aapostoliuk@users.noreply.github.com> | 2025-02-25 18:25:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-25 16:25:25 +0000 |
commit | 5f75ad82d869b5e9f67dc1b7052813c71041ac3e (patch) | |
tree | dc86674504c88360e87dccc5195085c33be8b27f /src/conf_mode | |
parent | 9468dbfadece59cd4dd481594c9c098d974dad1a (diff) | |
download | vyos-1x-5f75ad82d869b5e9f67dc1b7052813c71041ac3e.tar.gz vyos-1x-5f75ad82d869b5e9f67dc1b7052813c71041ac3e.zip |
snmp: T7180: Fixed verification of engineid in snmpv3 (#4366)
* snmp: T7180: Fixed verification of engineid in snmpv3
EngineID must be configured if snmpv3 user is configured.
Fixed engineid help string.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/service_snmp.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conf_mode/service_snmp.py b/src/conf_mode/service_snmp.py index d85f20820..c64c59af7 100755 --- a/src/conf_mode/service_snmp.py +++ b/src/conf_mode/service_snmp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018-2024 VyOS maintainers and contributors +# Copyright (C) 2018-2025 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -147,6 +147,9 @@ def verify(snmp): return None if 'user' in snmp['v3']: + if 'engineid' not in snmp['v3']: + raise ConfigError(f'EngineID must be configured for SNMPv3!') + for user, user_config in snmp['v3']['user'].items(): if 'group' not in user_config: raise ConfigError(f'Group membership required for user "{user}"!') |