From 9d88dcebd7342bd5eea2a11178afc04ca581ff95 Mon Sep 17 00:00:00 2001 From: lstoppa <77723162+lstoppa@users.noreply.github.com> Date: Wed, 26 May 2021 19:59:47 +0200 Subject: [PATCH] fix: added 2021 copyrights (#74) --- splunk_connect_for_snmp_traps/__init__.py | 15 +++++++++ .../manager/__init__.py | 15 +++++++++ .../manager/const.py | 15 +++++++++ .../manager/hec_sender.py | 15 +++++++++ .../manager/mib_server_client.py | 15 +++++++++ .../manager/os_config_utils.py | 15 +++++++++ .../manager/trap_server.py | 32 ++++++++++++------- .../snmp_trap_server.py | 15 +++++++++ splunk_connect_for_snmp_traps/utilities.py | 15 +++++++++ tests/__init__.py | 15 +++++++++ tests/test_os_config_utils.py | 15 +++++++++ 11 files changed, 171 insertions(+), 11 deletions(-) diff --git a/splunk_connect_for_snmp_traps/__init__.py b/splunk_connect_for_snmp_traps/__init__.py index 3ca78203..a1038529 100644 --- a/splunk_connect_for_snmp_traps/__init__.py +++ b/splunk_connect_for_snmp_traps/__init__.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## import logging.config logging.basicConfig( diff --git a/splunk_connect_for_snmp_traps/manager/__init__.py b/splunk_connect_for_snmp_traps/manager/__init__.py index e69de29b..0ad8e598 100644 --- a/splunk_connect_for_snmp_traps/manager/__init__.py +++ b/splunk_connect_for_snmp_traps/manager/__init__.py @@ -0,0 +1,15 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## diff --git a/splunk_connect_for_snmp_traps/manager/const.py b/splunk_connect_for_snmp_traps/manager/const.py index 3c8851af..60030316 100644 --- a/splunk_connect_for_snmp_traps/manager/const.py +++ b/splunk_connect_for_snmp_traps/manager/const.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## from pysnmp.entity import config AuthProtocolMap = { diff --git a/splunk_connect_for_snmp_traps/manager/hec_sender.py b/splunk_connect_for_snmp_traps/manager/hec_sender.py index 76660b54..4fe2da5e 100644 --- a/splunk_connect_for_snmp_traps/manager/hec_sender.py +++ b/splunk_connect_for_snmp_traps/manager/hec_sender.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## import concurrent.futures import logging import os diff --git a/splunk_connect_for_snmp_traps/manager/mib_server_client.py b/splunk_connect_for_snmp_traps/manager/mib_server_client.py index 3d01455c..c3e53e7c 100644 --- a/splunk_connect_for_snmp_traps/manager/mib_server_client.py +++ b/splunk_connect_for_snmp_traps/manager/mib_server_client.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## import json import logging import os diff --git a/splunk_connect_for_snmp_traps/manager/os_config_utils.py b/splunk_connect_for_snmp_traps/manager/os_config_utils.py index 3c280ba6..d600cbe4 100644 --- a/splunk_connect_for_snmp_traps/manager/os_config_utils.py +++ b/splunk_connect_for_snmp_traps/manager/os_config_utils.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## from multiprocessing import cpu_count diff --git a/splunk_connect_for_snmp_traps/manager/trap_server.py b/splunk_connect_for_snmp_traps/manager/trap_server.py index 4e00597e..7dcef56b 100644 --- a/splunk_connect_for_snmp_traps/manager/trap_server.py +++ b/splunk_connect_for_snmp_traps/manager/trap_server.py @@ -1,23 +1,33 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## import logging +import os +import socket +# *TODO*: enable debug all only if end-user has set debug logging mode. +# debugging log for SNMPv3 trap +from pysnmp import debug from pysnmp.carrier.asyncore.dgram import udp, udp6 from pysnmp.entity import engine, config from pysnmp.entity.rfc3413 import ntfrcv - -from pysnmp.proto.secmod.rfc3826.priv import aes -from pysnmp.proto.secmod.rfc3414.auth import hmacsha from pysnmp.proto import rfc1902 +from splunk_connect_for_snmp_traps.manager.const import AuthProtocolMap, PrivProtocolMap from splunk_connect_for_snmp_traps.manager.hec_sender import HecSender from splunk_connect_for_snmp_traps.manager.mib_server_client import get_translation -from splunk_connect_for_snmp_traps.manager.const import AuthProtocolMap, PrivProtocolMap -import socket -import os - - -# *TODO*: enable debug all only if end-user has set debug logging mode. -# debugging log for SNMPv3 trap -from pysnmp import debug debug.setLogger(debug.Debug("all")) diff --git a/splunk_connect_for_snmp_traps/snmp_trap_server.py b/splunk_connect_for_snmp_traps/snmp_trap_server.py index 12ca27f0..feebc4f6 100644 --- a/splunk_connect_for_snmp_traps/snmp_trap_server.py +++ b/splunk_connect_for_snmp_traps/snmp_trap_server.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## import argparse import logging.config diff --git a/splunk_connect_for_snmp_traps/utilities.py b/splunk_connect_for_snmp_traps/utilities.py index 33ab01ab..d4e2b26b 100644 --- a/splunk_connect_for_snmp_traps/utilities.py +++ b/splunk_connect_for_snmp_traps/utilities.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## import logging import signal diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..0ad8e598 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,15 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## diff --git a/tests/test_os_config_utils.py b/tests/test_os_config_utils.py index b8b32e2c..053308bb 100644 --- a/tests/test_os_config_utils.py +++ b/tests/test_os_config_utils.py @@ -1,3 +1,18 @@ +# ######################################################################## +# Copyright 2021 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ######################################################################## from unittest import TestCase from splunk_connect_for_snmp_traps.manager.os_config_utils import (