Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snmp: T7180: Fixed verification of engineid in snmpv3 #4366

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion interface-definitions/service_snmp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
</constraint>
<constraintErrorMessage>ID must contain an even number (from 2 to 36) of hex digits</constraintErrorMessage>
</properties>
<defaultValue></defaultValue>
</leafNode>
<tagNode name="group">
<properties>
Expand Down
5 changes: 4 additions & 1 deletion src/conf_mode/service_snmp.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}"!')
Expand Down
Loading