summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-12-27 19:22:46 +0100
committerChristian Poessinger <christian@poessinger.com>2021-12-27 19:23:24 +0100
commit522c9d916e390f797290c8b4c9af36cf9639cbbc (patch)
tree574158e8604a858c7362a9a365afc86df02c172e
parentb3412d5d3ea15f5880536242d3067dd1393b75de (diff)
downloadvyos-1x-522c9d916e390f797290c8b4c9af36cf9639cbbc.tar.gz
vyos-1x-522c9d916e390f797290c8b4c9af36cf9639cbbc.zip
snmp: T4093: add missing verify() step for required group per snmp v3 user
(cherry picked from commit a70a4001fe0b3a91a7d86191ff32dcc7205d2eae)
-rwxr-xr-xsrc/conf_mode/snmp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py
index f796e9978..dc7e29ca5 100755
--- a/src/conf_mode/snmp.py
+++ b/src/conf_mode/snmp.py
@@ -625,6 +625,10 @@ def verify(snmp):
# Group must exist prior to mapping it into a group
# seclevel will be extracted from group
#
+ if 'group' not in user or user['group'] == '':
+ username = user['name']
+ raise ConfigError(f'Group membership required for user "{username}"!')
+
if user['group']:
error = True
if 'v3_groups' in snmp.keys():