Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
fix: added 2021 copyrights (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
lstoppa committed May 26, 2021
1 parent 5d40c86 commit 9d88dce
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 11 deletions.
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/__init__.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/manager/__init__.py
Original file line number Diff line number Diff line change
@@ -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.
# ########################################################################
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/manager/const.py
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/manager/hec_sender.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/manager/mib_server_client.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/manager/os_config_utils.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
32 changes: 21 additions & 11 deletions splunk_connect_for_snmp_traps/manager/trap_server.py
Original file line number Diff line number Diff line change
@@ -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"))

Expand Down
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/snmp_trap_server.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
15 changes: 15 additions & 0 deletions splunk_connect_for_snmp_traps/utilities.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
15 changes: 15 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -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.
# ########################################################################
15 changes: 15 additions & 0 deletions tests/test_os_config_utils.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down

0 comments on commit 9d88dce

Please sign in to comment.