From a59f2fe1ddd042c7973ccc50c324812d68d3126a Mon Sep 17 00:00:00 2001 From: thl-cmk <thl-cmk@outlook.com> Date: Wed, 2 Aug 2023 20:22:05 +0000 Subject: [PATCH] Delete snmp_version.py --- gui/wato/check_parameters/snmp_version.py | 228 ---------------------- 1 file changed, 228 deletions(-) delete mode 100644 gui/wato/check_parameters/snmp_version.py diff --git a/gui/wato/check_parameters/snmp_version.py b/gui/wato/check_parameters/snmp_version.py deleted file mode 100644 index 3e79a5c..0000000 --- a/gui/wato/check_parameters/snmp_version.py +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# License: GNU General Public License v2 - -# Author: thl-cmk[at]outlook[dot]com -# URL : https://thl-cmk.hopto.org -# Date : 2023-07-09 -# File : snmp_version.py -# -# WATO file for snmp_version check plugin -# -# 2023-07-09: initial release - -from cmk.gui.i18n import _ -from cmk.gui.valuespec import ( - Dictionary, - MonitoringState, - Tuple, - ListChoice, - Integer, - ListOfStrings -) - -from cmk.gui.plugins.wato.utils import ( - CheckParameterRulespecWithoutItem, - rulespec_registry, - RulespecGroupCheckParametersNetworking, -) - - -def _parameter_valuespec_snmp_version(): - return Dictionary( - elements=[ - ('snmp_version', - Tuple( - orientation='horizontal', - title=_('SNMP Version'), - elements=[ - ListChoice( - title=_('excepted SNMP Versions'), - choices=[ - ('1', 'Version 1'), - ('2c', 'Version 2c'), - ('3', 'Version 3') - ], - allow_empty=False, - help=_('Select excepted SNMP versions. Default is "Version 3".'), - default_value=['3'], - ), - MonitoringState( - title=_('Monitoring state if version not in excepted versions'), - default_value=1, - ) - ])), - ('v3_level', - Tuple( - orientation='horizontal', - title=_('SNMP v3 level'), - elements=[ - ListChoice( - title=_('excepted level'), - choices=[ - ('authpriv', 'authentication and privacy'), - ('authnopriv', 'authentication and no privacy'), - ('noauthnopriv', 'no authentication and no privacy'), - ], - allow_empty=False, - help=_('Select excepted SNMP v3 protocol level. Default is "authentication and privacy".'), - default_value=['authpriv'], - ), - MonitoringState( - title=_('Monitoring state if level is not in excepted list'), - default_value=1, - ) - ])), - ('v3_authentication', - Tuple( - orientation='horizontal', - title=_('SNMP v3 authenticatio'), - elements=[ - ListChoice( - title=_('excepted authentication'), - choices=[ - ('md5', 'MD5'), - ('sha', 'SHA'), - ('sha-224', 'SHA-224'), - ('sha-256', 'SHA-256'), - ('sha-384', 'SHA-384'), - ('sha-512', 'SHA-512'), - ], - allow_empty=False, - help=_('Select excepted SNMP v3 authentication. Default is "SHA*".'), - default_value=['sha', 'sha-224', 'sha-256', 'sha-384', 'sha-512'], - ), - MonitoringState( - title=_('Monitoring state if authentication is not in excepted list'), - default_value=1, - ) - ])), - ('v3_encryption', - Tuple( - orientation='horizontal', - title=_('SNMP v3 encryption'), - elements=[ - ListChoice( - title=_('excepted encryption'), - choices=[ - ('des', 'DES'), - ('aes', 'AES-128'), - ], - allow_empty=False, - help=_('Select excepted encryption. Default is "AES-128".'), - default_value=['aes'], - ), - MonitoringState( - title=_('Monitoring state if SNMP v3 encryption is not in excepted list'), - default_value=1, - ) - ])), - ('snmp_backend', - Tuple( - orientation='horizontal', - title=_('SNMP backend'), - elements=[ - ListChoice( - title=_('excepted SNMP backend'), - choices=[ - ('inline', 'Inline'), - ('classic', 'Classic'), - ('storedwalk', 'Stored walk') - ], - allow_empty=False, - help=_('Select excepted SNMP backend. Default is "Inline/Classic".'), - default_value=['inline', 'classic'], - ), - MonitoringState( - title=_('Monitoring state if backend not in excepted backends'), - default_value=1, - ) - ])), - ('min_key_length', - Tuple( - orientation='horizontal', - title=_('Check key length'), - elements=[ - Integer( - title=_('minimal key length'), - minvalue=1, - - help=_('Minimal expected Community string/key length. Default is "10".'), - default_value=10, - ), - MonitoringState( - title=_('Monitoring state if key length below minimal key length'), - help=_( - 'Set the monitoring state when the length of the Community string (SNMP v1/2c) ' - 'or the authentication/encryption key (SNMP v3) is below min. length. Default is WARN' - ), - default_value=1, - ) - ])), - ('auth_enc_key_identical', - MonitoringState( - title=_('Monitoring state when authentication and encryption key are identical'), - help=_( - 'Set the monitoring state when authentication key and encryption key are identical. ' - 'This setting is for SNMP v3 only. Default is WARN.' - ), - default_value=1, - )), - ('default_keys', - Tuple( - orientation='horizontal', - title=_('Check default key values'), - elements=[ - ListOfStrings( - title=_('List of default keys'), - allow_empty=False, - help=_( - 'List of default Community strings/keys to check against. Default is "public, private".' - ), - default_value=['public', 'private'], - ), - MonitoringState( - title=_('Monitoring state if key length below minimal key length'), - help=_( - 'Set the monitoring state when the length of the Community string (SNMP v1/2c) ' - 'or the authentication/encryption key (SNMP v3) is below min. length. Default is WARN' - ), - default_value=1, - ) - ])), - ('key_complexity', - Tuple( - orientation='horizontal', - title=_('Key complexity'), - elements=[ - ListChoice( - title=_('excepted characters in the key'), - choices=[ - ('(?=.*\\d)', 'Number'), - ('(?=.*[a-z])', 'Lowercase'), - ('(?=.*[A-Z])', 'Uppercase'), - ('(?=.*\\W)', 'Special') - ], - allow_empty=False, - help=_( - 'Select expected character types in the Community string or authentication/encryption key.' - ' Default is "Number, Lower case, Upper case, Special".'), - default_value=['(?=.*\\d)', '(?=.*[a-z])', '(?=.*[A-Z])', '(?=.*\\W)'], - ), - MonitoringState( - title=_('Monitoring state if key complexity not met'), - default_value=1, - ) - ])), - ]) - - -rulespec_registry.register( - CheckParameterRulespecWithoutItem( - check_group_name='snmp_version', - group=RulespecGroupCheckParametersNetworking, - match_type='dict', - parameter_valuespec=_parameter_valuespec_snmp_version, - title=lambda: _('SNMP Version'), - )) -- GitLab