id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39,500 | main.py | privacyidea_privacyidea/privacyidea/cli/pimanage/main.py | # SPDX-FileCopyrightText: (C) 2023 Paul Lettich <paul.lettich@netknights.it>
#
# SPDX-FileCopyrightText: (C) 2014 Cornelius Kölbel <cornelius.koelbel@netknights.it>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# 2024-04-22 Paul Lettich <paul.lettich@netknights.it>
# Refactor using click
# 2020-11-18 Henn... | 5,499 | Python | .py | 130 | 39.215385 | 97 | 0.650645 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,501 | audit.py | privacyidea_privacyidea/privacyidea/cli/pimanage/audit.py | # SPDX-FileCopyrightText: (C) 2023 Paul Lettich <paul.lettich@netknights.it>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Info: https://privacyidea.org
#
# This code is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Free Sof... | 8,337 | Python | .py | 173 | 37.485549 | 100 | 0.607687 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,502 | loadtokens.py | privacyidea_privacyidea/privacyidea/cli/privacyideatokenjanitor/loadtokens.py | #!/usr/bin/env python
#
# 2023-11-03 Jona-Samuel Höhmann <jona-samuel.hoehmann@netknights.it>
# Migrate to click
# 2020-11-11 Timo Sturm <timo.sturm@netknights.it>
# Select how to validate PSKC imports
# 2018-02-21 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Allow to import PSK... | 3,974 | Python | .py | 82 | 43.146341 | 86 | 0.704411 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,503 | findtokens.py | privacyidea_privacyidea/privacyidea/cli/privacyideatokenjanitor/findtokens.py | #!/usr/bin/env python
#
# 2023-11-03 Jona-Samuel Höhmann <jona-samuel.hoehmann@netknights.it>
# Migrate to click
# 2020-11-11 Timo Sturm <timo.sturm@netknights.it>
# Select how to validate PSKC imports
# 2018-02-21 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Allow to import PSK... | 27,178 | Python | .py | 545 | 37.702752 | 115 | 0.594316 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,504 | __init__.py | privacyidea_privacyidea/privacyidea/cli/privacyideatokenjanitor/__init__.py | # SPDX-FileCopyrightText: (C) 2024 Paul Lettich <paul.lettich@netknights.it>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Info: https://privacyidea.org
#
# This code is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Free Sof... | 831 | Python | .py | 20 | 40.5 | 78 | 0.77284 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,505 | updatetokens.py | privacyidea_privacyidea/privacyidea/cli/privacyideatokenjanitor/updatetokens.py | # 2023-11-03 Jona-Samuel Höhmann <jona-samuel.hoehmann@netknights.it>
# Migrate to click
# 2020-11-11 Timo Sturm <timo.sturm@netknights.it>
# Select how to validate PSKC imports
# 2018-02-21 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Allow to import PSKC file
# 2017-11-21 Corn... | 3,246 | Python | .py | 69 | 43.681159 | 81 | 0.738155 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,506 | main.py | privacyidea_privacyidea/privacyidea/cli/privacyideatokenjanitor/main.py | # SPDX-FileCopyrightText: (C) 2023 Jona-Samuel Höhmann <jona-samuel.hoehmann@netknights.it>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Info: https://privacyidea.org
#
# This code is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published... | 2,124 | Python | .py | 50 | 39.62 | 102 | 0.587209 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,507 | conf.py | privacyidea_privacyidea/doc/conf.py | # privacyIDEA documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 13 07:31:01 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values ... | 9,518 | Python | .py | 215 | 42.423256 | 126 | 0.733651 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,508 | privacyideaapp.py | privacyidea_privacyidea/deploy/nginx/privacyideaapp.py | import sys
sys.stdout = sys.stderr
from privacyidea.app import create_app
# Now we can select the config file:
application = create_app(config_name="production", config_file="/etc/privacyidea/pi.cfg")
| 201 | Python | .py | 5 | 39.2 | 89 | 0.795918 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,509 | directive.attachmachine.html | privacyidea_privacyidea/privacyidea/static/components/directives/views/directive.attachmachine.html | <!--
This is the directive for attaching machines to tokens.
-->
<div class="form-group">
<label for="serial" translate>Machine</label>
<input name="serial" type="text" ng-model="newMachine"
autocomplete="new-password"
placeholder="{{ 'start typing a machine.'|translate }}"
type... | 804 | Python | .tac | 19 | 35.684211 | 93 | 0.658163 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,510 | directive.attachtoken.html | privacyidea_privacyidea/privacyidea/static/components/directives/views/directive.attachtoken.html | <!--
This is the directive for attach tokens to machines.
-->
<div class="form-group">
<label for="serial" translate>Serial</label>
<input name="serial" type="text" ng-model="newTokenObject.serial"
autocomplete="new-password"
placeholder="{{ 'start typing a serial number of a token.'|
... | 837 | Python | .tac | 20 | 35 | 92 | 0.652387 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,511 | privacyideaapp.wsgi | privacyidea_privacyidea/deploy/apache/privacyideaapp.wsgi | import sys
sys.stdout = sys.stderr
from privacyidea.app import create_app
# Now we can select the config file:
application = create_app(config_name="production", config_file="/etc/privacyidea/pi.cfg")
| 201 | Python | .wsgi | 5 | 39.2 | 89 | 0.795918 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,512 | setup.py | certtools_intelmq/setup.py | #!/usr/bin/python3
#
# SPDX-FileCopyrightText: 2014-2021 Tomás Lima, Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
from pathlib import Path
from setuptools import find_packages, setup
REQUIRES = [
'dnspython>=2.0.0',
'psutil>=1.2.1',
'python-dateutil>=2... | 3,509 | Python | .py | 98 | 30.122449 | 125 | 0.638848 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,513 | copyright | certtools_intelmq/debian/copyright | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: intelmq
Upstream-Contact: Aaron Kaplan <kaplan@cert.at>
Source: https://github.com/certtools/intelmq.git
Files: *
Copyright: 2014-2016 see /usr/share/doc/intelmq/COPYRIGHT
License: AGPL-3
Files: debian/*
Copyright: 2016 Intevati... | 35,659 | Python | .py | 672 | 50.120536 | 80 | 0.790476 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,514 | fix-dnspython-name.patch | certtools_intelmq/debian/patches/fix-dnspython-name.patch | Description: Undo rename of the dependency dnspython3
The packages was renamed upstream; however, this change does not immediately
affect this package's target distributions.
Author: Gernot Schulz <gernot@intevation.de>
Last-Update: 2016-10-04
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- ... | 560 | Python | .py | 17 | 30.705882 | 77 | 0.715342 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,515 | pycodestyle_comment.py | certtools_intelmq/.github/workflows/python/pycodestyle_comment.py | """
pycodestyle_comment.py
Post output of pycodestyle as a review to a github PR
SPDX-FileCopyrightText: 2020 Birger Schacht
SPDX-License-Identifier: AGPL-3.0-or-later
"""
import os
import subprocess
import github
INTROTEXT_IDENTIFIER = '<!-- Introtext. -->'
INTROTEXT = INTROTEXT_IDENTIFIER + '''\nHi, thanks for you... | 2,414 | Python | .py | 47 | 45.382979 | 144 | 0.677433 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,516 | github.py | certtools_intelmq/.github/workflows/python/github.py | """
github.py
Provide a couple of useful methods for github actions to interact with pull requests
SPDX-FileCopyrightText: 2020 Birger Schacht
SPDX-License-Identifier: AGPL-3.0-or-later
"""
import os
import requests
class Github:
""" Github class:
contains a request session object that holds the authorizatio... | 1,896 | Python | .py | 40 | 40.75 | 142 | 0.658722 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,517 | templates.py | certtools_intelmq/contrib/systemd/templates.py | # SPDX-FileCopyrightText: 2017 navtej
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
from string import Template
__all__ = ['TIMER_TEMPLATE', 'SERVICE_TEMPLATE', 'POST_DOCS']
SERVICE_TEMPLATE = Template('''[Unit]
Description=IntelMQ bot $bot Service Unit
After=network.target
RefuseManualStar... | 1,835 | Python | .py | 65 | 26.984615 | 110 | 0.789624 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,518 | conf.py | certtools_intelmq/contrib/systemd/conf.py | # SPDX-FileCopyrightText: 2017 navtej
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os.path
import shutil
from intelmq import ROOT_DIR
__all__ = ['ACCURACY_SECS', 'DISABLE_IN_CONF', 'ON_ACTIVE_SEC', 'SET_RUNMODE_IN_CONF',
'INTELMQ_GROUP', 'RANDOMIZE_DELAYS', 'SYSTEMD_OUTPUT... | 779 | Python | .py | 21 | 34.857143 | 98 | 0.717507 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,519 | systemd.py | certtools_intelmq/contrib/systemd/systemd.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2017 navtej
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
# flake8: noqa
import collections
import grp
import json
import os
import os.path
import pwd
import shutil
import sys
from conf import *
from intelmq import PIPELINE_CONF_FILE, RUNTIME_... | 5,776 | Python | .py | 139 | 28.625899 | 114 | 0.522986 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,520 | cronjob_intelmq_queues.py | certtools_intelmq/contrib/check_mk/cronjob_intelmq_queues.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import intelmq.bin.intelmqctl as ctl
import intelmq.lib.utils as utils
import sys
cont = ctl.IntelMQController(interactive=False)
retval, queues = cont.list_queues()
if retval != 0:
sys.exit(1)
... | 989 | Python | .py | 25 | 34.92 | 88 | 0.691745 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,521 | cronjob_intelmq_statistics.py | certtools_intelmq/contrib/check_mk/cronjob_intelmq_statistics.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 28 09:52:19 2019
@author: sebastian
"""
from intelmq.lib.utils import get_global_settings
import redis
config = get_global_settings()
db = redis.Redi... | 982 | Python | .py | 29 | 27.655172 | 84 | 0.618393 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,522 | test_download_mapping.py | certtools_intelmq/contrib/malware_name_mapping/test_download_mapping.py | # SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import unittest
import json
import requests_mock
from download_mapping import create_parser, main, generate_regex_from_human, IDENTIFIER_FROM_HUMAN, URL
from intelmq.lib.test import skip_internet
cl... | 4,505 | Python | .py | 95 | 36.378947 | 105 | 0.585571 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,523 | download_mapping.py | certtools_intelmq/contrib/malware_name_mapping/download_mapping.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2018 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
TODO: Fix ordering of dicts
"""
import argparse
import csv
import hashlib
import io
import json
import re
import requests
import sys
from typing import Optional
URL = 'h... | 7,793 | Python | .py | 169 | 34.171598 | 112 | 0.560295 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,524 | setup.py | certtools_intelmq/contrib/example-extension-package/setup.py | """Example IntelMQ extension package
SPDX-FileCopyrightText: 2023 CERT.at GmbH <https://cert.at/>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
from pathlib import Path
from setuptools import find_packages, setup
# Instead of the bot-autodiscovery below, you can also just manually declare entrypoints
# (regardless... | 1,558 | Python | .py | 36 | 40.277778 | 125 | 0.7107 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,525 | common.py | certtools_intelmq/contrib/example-extension-package/mybots/lib/common.py | """
SPDX-FileCopyrightText: 2023 CERT.at GmbH <https://cert.at/>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
def return_value(value):
return value
| 157 | Python | .py | 6 | 24 | 60 | 0.743243 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,526 | collector.py | certtools_intelmq/contrib/example-extension-package/mybots/bots/collectors/custom/collector.py | """
SPDX-FileCopyrightText: 2023 CERT.at GmbH <https://cert.at/>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
# Use your package as usual
from mybots.lib import common
from intelmq.lib.bot import CollectorBot
class ExampleAdditionalCollectorBot(CollectorBot):
"""
This is an example bot provided by an exte... | 579 | Python | .py | 17 | 29.588235 | 60 | 0.718919 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,527 | apply_domain_suffix.py | certtools_intelmq/contrib/eventdb/apply_domain_suffix.py | # SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 29 17:23:52 2018
@author: sebastian
"""
import psycopg2
import sys
from psycopg2.extras import DictCursor
from publicsuffixlist import PublicSuffixList
from .common import crea... | 2,245 | Python | .py | 55 | 30.963636 | 172 | 0.588154 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,528 | apply_mapping_eventdb.py | certtools_intelmq/contrib/eventdb/apply_mapping_eventdb.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 11 15:47:07 2018
@author: sebastian
"""
import csv
import io
import re
import sys
from .common import create_parser
try:
import requests
except Im... | 4,012 | Python | .py | 92 | 33.423913 | 119 | 0.59339 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,529 | common.py | certtools_intelmq/contrib/eventdb/common.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 26 10:09:56 2019
@author: sebastian
"""
import argparse
def create_parser(name, description):
parser = argparse.ArgumentParser(name, description)
... | 1,985 | Python | .py | 38 | 40.631579 | 91 | 0.586509 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,530 | __init__.py | certtools_intelmq/intelmq/__init__.py | # SPDX-FileCopyrightText: 2014 Tom√°s Lima
#
# SPDX-License-Identifier: AGPL-3.0-or-later
from .version import __version__, __version_info__ # noqa: F401
import os
import pathlib
import sys
path = "opt"
if os.getenv("INTELMQ_ROOT_DIR", False):
path = "opt"
elif os.getenv('INTELMQ_PATHS_NO_OPT', False):
path... | 1,463 | Python | .py | 32 | 41.40625 | 83 | 0.674157 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,531 | version.py | certtools_intelmq/intelmq/version.py | # SPDX-FileCopyrightText: 2016-2024 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
__version_info__ = (3, 3, 2, 'alpha1')
__version__ = '.'.join(map(str, __version_info__))
| 191 | Python | .py | 5 | 37 | 52 | 0.681081 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,532 | intelmq_psql_initdb.py | certtools_intelmq/intelmq/bin/intelmq_psql_initdb.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner, 2023 CERT.at GmbH
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Generates a SQL command file with commands to create the events table.
Reads the harmonization configuration and generates an SQL command from it.
The SQL file is saved in `/tm... | 8,996 | Python | .py | 210 | 33.566667 | 131 | 0.573306 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,533 | intelmq_generate_misp_objects_templates.py | certtools_intelmq/intelmq/bin/intelmq_generate_misp_objects_templates.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2019 Raphaël Vinot
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Generates a MISP object template
see https://github.com/MISP/misp-objects/
"""
import json
from pathlib import Path
from uuid import uuid4
import argparse
class MISPObjectT... | 5,580 | Python | .py | 113 | 38.752212 | 108 | 0.608073 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,534 | intelmqdump.py | certtools_intelmq/intelmq/bin/intelmqdump.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import argparse
import base64
import copy
import fcntl
import glob
import json
import os.path
import pprint
import re
import readline
import subprocess
import sys
import tempfile
import traceback
fro... | 19,507 | Python | .py | 427 | 30.75644 | 136 | 0.513836 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,535 | rewrite_config_files.py | certtools_intelmq/intelmq/bin/rewrite_config_files.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import argparse
import glob
import json
import os
import traceback
def rewrite(fobj):
text = json.load(fobj)
clean = json.dumps(text, indent=4, sort_keys=True, separ... | 1,279 | Python | .py | 37 | 26.945946 | 85 | 0.599513 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,536 | intelmqctl.py | certtools_intelmq/intelmq/bin/intelmqctl.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import argparse
import copy
import datetime
import importlib
import json
import logging
import os
import re
import subprocess
import sys
import textwrap
import traceback
import time
import pkg_resour... | 61,857 | Python | .py | 1,142 | 38.614711 | 183 | 0.554313 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,537 | intelmqsetup.py | certtools_intelmq/intelmq/bin/intelmqsetup.py | """
© 2019-2021 nic.at GmbH <intelmq-team@cert.at>
SPDX-License-Identifier: AGPL-3.0-or-later
Sets up an intelmq environment after installation or upgrade by
* creating needed directories
* set intelmq as owner for those
* providing example configuration files if not already existing
If intelmq-api is installed,... | 16,396 | Python | .py | 298 | 46.83557 | 176 | 0.68736 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,538 | message.py | certtools_intelmq/intelmq/lib/message.py | # SPDX-FileCopyrightText: 2014 Mauro Silva
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Messages are the information packages in pipelines.
Use MessageFactory to get a Message object (types Report and Event).
"""
import hashlib
import json
import re
import warnings
from collections impor... | 23,987 | Python | .py | 507 | 35.072978 | 130 | 0.582831 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,539 | bot.py | certtools_intelmq/intelmq/lib/bot.py | # SPDX-FileCopyrightText: 2014 Tomás Lima
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
The bot library has the base classes for all bots.
* Bot: generic base class for all kind of bots
* CollectorBot: base class for collectors
* ParserBot: base class for parsers
"""
import argparse... | 64,676 | Python | .py | 1,294 | 36.115147 | 232 | 0.568234 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,540 | pipeline.py | certtools_intelmq/intelmq/lib/pipeline.py | # SPDX-FileCopyrightText: 2014 Tomás Lima
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Algorithm
---------
[Receive] B RPOP LPUSH source_queue -> internal_queue
[Send] LPUSH message -> destination_queue
[Acknowledge] RPOP message <- internal_... | 27,385 | Python | .py | 595 | 34.401681 | 158 | 0.595584 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,541 | test.py | certtools_intelmq/intelmq/lib/test.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Utilities for testing intelmq bots.
The BotTestCase can be used as base class for unittests on bots. It includes
some basic generic tests (logged errors, correct pipeline setup).
"""
import io
im... | 25,920 | Python | .py | 505 | 37.70297 | 198 | 0.579305 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,542 | bot_debugger.py | certtools_intelmq/intelmq/lib/bot_debugger.py | # SPDX-FileCopyrightText: 2017 Edvard Rejthar
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Utilities for debugging intelmq bots.
BotDebugger is called via intelmqctl. It starts a live running bot instance,
leverages logging to DEBUG level and permits even a non-skilled programmer
who may... | 10,107 | Python | .py | 197 | 40.416244 | 148 | 0.629757 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,543 | utils.py | certtools_intelmq/intelmq/lib/utils.py | # SPDX-FileCopyrightText: 2014 Tom√°s Lima
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Common utility functions for intelmq.
decode
encode
base64_decode
base64_encode
load_configuration
log
reverse_readline
parse_logline
"""
import base64
import collections
import grp
import gzip
import... | 31,152 | Python | .py | 781 | 31.962868 | 140 | 0.633141 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,544 | cache.py | certtools_intelmq/intelmq/lib/cache.py | # SPDX-FileCopyrightText: 2014 Tom√°s Lima
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Cache is a set with information already seen by the system.
This provides a way, for example, to remove duplicated events
and reports in system or cache some results from experts like
Cymru Whois. It's... | 1,907 | Python | .py | 54 | 27.62963 | 71 | 0.603702 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,545 | harmonization.py | certtools_intelmq/intelmq/lib/harmonization.py | # SPDX-FileCopyrightText: 2015 Dognaedis
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
The following types are implemented with sanitize() and is_valid() functions:
- Base64
- Boolean
- ClassificationTaxonomy
- ClassificationType
- DateTime
- FQDN
- Float
- Accuracy
- GenericType... | 37,440 | Python | .py | 989 | 28.213347 | 123 | 0.600298 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,546 | processmanager.py | certtools_intelmq/intelmq/lib/processmanager.py | # SPDX-FileCopyrightText: 2021 Birger Schacht
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import abc
import distutils.version
import getpass
import http.client
import inspect
import logging
import os
import psutil
import signal
import socket
import subprocess
import sys
import time
import xmlrpc.client
from typing i... | 24,037 | Python | .py | 543 | 32.174954 | 155 | 0.576903 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,547 | upgrades.py | certtools_intelmq/intelmq/lib/upgrades.py | """
© 2020 Sebastian Wagner <wagner@cert.at>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
from collections import OrderedDict
from pkg_resources import resource_filename
from pathlib import Path
from intelmq import CONFIG_DIR
from intelmq.lib.utils import load_configuration, write_configuration
__all__ = ['v100_d... | 43,607 | Python | .py | 880 | 39.114773 | 259 | 0.609385 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,548 | exceptions.py | certtools_intelmq/intelmq/lib/exceptions.py | # SPDX-FileCopyrightText: 2015 Dognaedis
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
'''
IntelMQ Exception Class
'''
from typing import Any, Optional, Union
__all__ = ['InvalidArgument', 'ConfigurationError', 'IntelMQException',
'IntelMQHarmonizationException', 'InvalidKey', ... | 5,729 | Python | .py | 127 | 34.968504 | 134 | 0.598201 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,549 | splitreports.py | certtools_intelmq/intelmq/lib/splitreports.py | # SPDX-FileCopyrightText: 2016 Bernhard Herzog
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Support for splitting large raw reports into smaller ones.
The main intention of this module is to help work around limitations in
Redis which limits strings to 512MB. Collector bots can use the
f... | 6,289 | Python | .py | 133 | 40.473684 | 93 | 0.697697 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,550 | datatypes.py | certtools_intelmq/intelmq/lib/datatypes.py | # SPDX-FileCopyrightText: 2021 Birger Schacht, 2023 Bundesamt für Sicherheit in der Informationstechnik (BSI)
#
# SPDX-License-Identifier: AGPL-3.0-or-later
from enum import Enum
from inspect import signature
from sys import version_info
from typing import Optional, Callable, Union, List
from datetime import datetime... | 5,414 | Python | .py | 126 | 35.214286 | 179 | 0.640099 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,551 | sql.py | certtools_intelmq/intelmq/lib/mixins/sql.py | """ SQLMixin for IntelMQ
SPDX-FileCopyrightText: 2021 Birger Schacht, 2022 Intevation GmbH
SPDX-License-Identifier: AGPL-3.0-or-later
Based on the former SQLBot base class
"""
from intelmq.lib import exceptions
from time import sleep
class SQLMixin:
"""
Inherit this bot so that it handles DB connection for... | 5,790 | Python | .py | 129 | 31 | 110 | 0.547935 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,552 | cache.py | certtools_intelmq/intelmq/lib/mixins/cache.py | """ CacheMixin for IntelMQ
SPDX-FileCopyrightText: 2021 Sebastian Waldbauer
SPDX-License-Identifier: AGPL-3.0-or-later
CacheMixin is used for caching/storing data in redis.
"""
from typing import Any, Optional
import redis
import intelmq.lib.utils as utils
class CacheMixin:
__redis: redis.Redis = None
redi... | 1,903 | Python | .py | 49 | 30.979592 | 104 | 0.61835 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,553 | __init__.py | certtools_intelmq/intelmq/lib/mixins/__init__.py | # SPDX-FileCopyrightText: 2021 Birger Schacht
#
# SPDX-License-Identifier: AGPL-3.0-or-later
from intelmq.lib.mixins.http import HttpMixin
from intelmq.lib.mixins.cache import CacheMixin
from intelmq.lib.mixins.sql import SQLMixin
from intelmq.lib.mixins.stomp import StompMixin
__all__ = ['HttpMixin', 'CacheMixin', '... | 345 | Python | .py | 8 | 41.875 | 63 | 0.80597 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,554 | stomp.py | certtools_intelmq/intelmq/lib/mixins/stomp.py | """ StompMixin for IntelMQ
SPDX-FileCopyrightText: 2017 Sebastian Wagner, 2023 NASK
SPDX-License-Identifier: AGPL-3.0-or-later
"""
import enum
import os
import ssl
import sys
from typing import (
Any,
Callable,
List,
NoReturn,
Tuple,
Union,
)
try:
import stomp
except ImportError:
stom... | 17,101 | Python | .py | 337 | 39.154303 | 89 | 0.601916 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,555 | http.py | certtools_intelmq/intelmq/lib/mixins/http.py | """ HttpMixin for IntelMQ
SPDX-FileCopyrightText: 2021 Birger Schacht
SPDX-License-Identifier: AGPL-3.0-or-later
Based on `create_request_session` in intelmq.lib.utils and
`set_request_parameters` in intelmq.lib.bot.Bot
"""
from intelmq.lib.exceptions import MissingDependencyError
try:
import requests
except Im... | 3,476 | Python | .py | 86 | 32.244186 | 129 | 0.625408 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,556 | test_conf.py | certtools_intelmq/intelmq/tests/test_conf.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Tests if configuration in /etc is valid
"""
import collections
import importlib
import io
import json
import os
import pkgutil
import pprint
import re
import unittest
import cerberus
import pkg_r... | 4,309 | Python | .py | 99 | 35.686869 | 107 | 0.641234 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,557 | test_psql_initdb.py | certtools_intelmq/intelmq/tests/bin/test_psql_initdb.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner, 2023 CERT.at GmbH
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 9 14:04:13 2016
@author: sebastian
"""
import json
import os
import re
import tempfile
import unittest
import pkg_resources
import intelmq.bin.intelmq_psq... | 6,514 | Python | .py | 155 | 30.63871 | 123 | 0.586833 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,558 | test_intelmqdump.py | certtools_intelmq/intelmq/tests/bin/test_intelmqdump.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import contextlib
import io
import tempfile
import unittest
from pathlib import Path
from unittest import mock
import termstyle
from intelmq.bin import intelmqdump
from intelmq.lib.test import skip... | 8,173 | Python | .py | 175 | 36.948571 | 102 | 0.603143 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,559 | test_intelmqsetup.py | certtools_intelmq/intelmq/tests/bin/test_intelmqsetup.py | """Tests for the intelmqsetup
SPDX-FileCopyrightText: 2023 CERT.at GmbH <https://cert.at/>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
import unittest
from unittest import mock
from intelmq.bin import intelmqsetup
class TestOwnership(unittest.TestCase):
@mock.patch("shutil.chown")
def test_skip_changing... | 1,404 | Python | .py | 27 | 43 | 77 | 0.652301 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,560 | test_intelmqctl.py | certtools_intelmq/intelmq/tests/bin/test_intelmqctl.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
import unittest
from tempfile import TemporaryDirectory
from unittest import mock
from pkg_resources import resource_filename
import intelmq.bin.intelmqctl as ctl
import intelmq.lib.utils ... | 6,720 | Python | .py | 112 | 47.223214 | 133 | 0.624506 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,561 | test_message.py | certtools_intelmq/intelmq/tests/lib/test_message.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Testing the Message classes of intelmq.
Unicode is used for all tests.
Most tests are performed on Report, as it is formally the same as Message,
but has a valid Harmonization configuration.
"""
... | 32,681 | Python | .py | 690 | 37.27971 | 119 | 0.602153 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,562 | test_bot_output.py | certtools_intelmq/intelmq/tests/lib/test_bot_output.py | # SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Test OutputBot specifics
"""
from intelmq.lib.bot import OutputBot
from intelmq.lib.test import BotTestCase
from unittest import TestCase
from json import dumps
RAW = {"__type": "Event", "raw":... | 3,759 | Python | .py | 82 | 36.268293 | 77 | 0.605357 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,563 | test_bot_library_mode.py | certtools_intelmq/intelmq/tests/lib/test_bot_library_mode.py | # SPDX-FileCopyrightText: 2023 by Bundesamt für Sicherheit in der Informationstechnik (BSI)
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Copyright (c) 2023 by Bundesamt für Sicherheit in der Informationstechnik (BSI)
Software engineering by BSI & Intevation GmbH
This file tests IntelMQ b... | 5,688 | Python | .py | 114 | 42.438596 | 182 | 0.681465 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,564 | test_test.py | certtools_intelmq/intelmq/tests/lib/test_test.py | # SPDX-FileCopyrightText: 2022 Intevation GmbH
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import unittest
from intelmq.lib.test import BOT_INIT_REGEX
BOT_INIT_LINES = (
# Ubuntu 22.04 https://github.com/certtools/intelmq/issues/2185
'BOTNAME initialized with id BOTID and intelmq... | 672 | Python | .py | 16 | 38.1875 | 137 | 0.700155 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,565 | test_parser_bot.py | certtools_intelmq/intelmq/tests/lib/test_parser_bot.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import base64
import unittest
import unittest.mock as mock
import warnings
import intelmq.lib.bot as bot
import intelmq.lib.test as test
import intelmq.lib.utils as utils
RAW = """# ignore this
2015... | 12,408 | Python | .py | 260 | 37.269231 | 119 | 0.597585 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,566 | test_bot.py | certtools_intelmq/intelmq/tests/lib/test_bot.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Tests the Bot class itself.
"""
import unittest
import intelmq.lib.test as test
from intelmq.tests.lib import test_parser_bot
class TestDummyParserBot(test.BotTestCase, unittest.TestCase):
... | 3,179 | Python | .py | 68 | 39.029412 | 149 | 0.656442 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,567 | test_utils.py | certtools_intelmq/intelmq/tests/lib/test_utils.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- encoding: utf-8 -*-
"""
Testing the utility functions of intelmq.
Decoding and Encoding, Logging functionality (file and stream), and log
parsing.
base64 de-/encoding is not tested yet, as we fully rely on the module.... | 19,556 | Python | .py | 356 | 43.401685 | 152 | 0.597009 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,568 | test_exceptions.py | certtools_intelmq/intelmq/tests/lib/test_exceptions.py | # SPDX-FileCopyrightText: 2020 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Testing the IntelMQ-specific exceptions
"""
import unittest
import sys
import intelmq.lib.exceptions as excs
class TestUtils(unittest.TestCase):
def test_PipelineError(self):
messa... | 2,441 | Python | .py | 60 | 32.75 | 94 | 0.648626 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,569 | test_harmonization.py | certtools_intelmq/intelmq/tests/lib/test_harmonization.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Testing harmonization classes
"""
import datetime
import ipaddress
import time
import unittest
import intelmq.lib.harmonization as harmonization
import intelmq.lib.test as test
class TestHarmon... | 28,978 | Python | .py | 460 | 47.843478 | 111 | 0.613364 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,570 | test_splitreports.py | certtools_intelmq/intelmq/tests/lib/test_splitreports.py | # SPDX-FileCopyrightText: 2016 Bernhard Herzog
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Tests for intelmq.lib.splitreports
"""
import base64
import io
import itertools
import unittest
from intelmq.lib.message import Report
from intelmq.lib.splitreports import generate_reports, read_delimited_chunks
from .... | 6,504 | Python | .py | 124 | 39.508065 | 79 | 0.601356 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,571 | test_upgrades.py | certtools_intelmq/intelmq/tests/lib/test_upgrades.py | # SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Tests the upgrade functions.
"""
import unittest
import pkg_resources
from copy import deepcopy
import intelmq.lib.upgrades as upgrades
from intelmq.lib.utils import load_configuration
V202 = {"global": {},
"t... | 28,038 | Python | .py | 792 | 27.361111 | 221 | 0.581312 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,572 | test_expert_bot.py | certtools_intelmq/intelmq/tests/lib/test_expert_bot.py | # SPDX-FileCopyrightText: 2018 Edvard Rejthar
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import unittest
import intelmq.lib.test as test
from intelmq.lib.bot import Bot
EXAMPLE = {'feed.name': 'Test', "__type": "Report"}
QUEUES = {"_default", "other-way", "two-way"}
class DummyExpertBot(Bot):
def process(s... | 1,880 | Python | .py | 44 | 36.159091 | 97 | 0.681295 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,573 | test_collector_bot.py | certtools_intelmq/intelmq/tests/lib/test_collector_bot.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Test with reports
"""
import unittest
import intelmq.lib.bot as bot
import intelmq.lib.test as test
EXAMPLE_REPORT = {"__type": "Report",
"feed.name": "Example Feed",
... | 2,029 | Python | .py | 54 | 27.203704 | 91 | 0.561162 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,574 | test_pipeline.py | certtools_intelmq/intelmq/tests/lib/test_pipeline.py | # SPDX-FileCopyrightText: 2015 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- encoding: utf-8 -*-
"""
Testing the pipeline functions of intelmq.
We are testing sending and receiving on the same queue for Redis and
Pythonlist.
TODO: clear_queues
TODO: check internal representation of data in red... | 11,313 | Python | .py | 242 | 38.099174 | 124 | 0.636281 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,575 | test_datatypes.py | certtools_intelmq/intelmq/tests/lib/test_datatypes.py | # SPDX-FileCopyrightText: 2023 Filip Pokorn√Ω
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import unittest
from intelmq.lib.datatypes import TimeFormat
from intelmq.lib.exceptions import InvalidArgument
from intelmq.lib.harmonization import DateTime
class TestTimeFormat(unittest.TestCase):
def test_no_argumen... | 3,123 | Python | .py | 59 | 45.627119 | 80 | 0.713911 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,576 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/rt/test_output.py | # SPDX-FileCopyrightText: 2020 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Test for the RT Output Bot
"""
import os
if os.environ.get('INTELMQ_TEST_EXOTIC'):
import intelmq.bots.outputs.rt.output
# This file is a stub.
| 250 | Python | .py | 10 | 23.3 | 47 | 0.763713 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,577 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/restapi/test_output.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import json
import unittest
import requests_mock
import intelmq.lib.test as test
from intelmq.bots.outputs.restapi.output import RestAPIOutputBot
def request_callback(expected):
def callback(r... | 2,239 | Python | .py | 53 | 30.792453 | 113 | 0.569917 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,578 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/files/test_output.py | # SPDX-FileCopyrightText: 2017 Pavel Kácha
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
import tempfile
import shutil
import unittest
import json
import os.path as pth
import intelmq.lib.test as test
from intelmq.bots.outputs.files.output import FilesOutputBot
class TestFilesOut... | 2,597 | Python | .py | 64 | 29.9375 | 77 | 0.572222 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,579 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/mcafee/test_output.py | # SPDX-FileCopyrightText: 2018 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
if os.environ.get('INTELMQ_TEST_EXOTIC'):
import intelmq.bots.outputs.mcafee.output_esm_ip
| 202 | Python | .py | 6 | 31.666667 | 52 | 0.793814 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,580 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/udp/test_output.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import intelmq.bots.outputs.udp.output
| 160 | Python | .py | 5 | 30.6 | 47 | 0.764706 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,581 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/amqptopic/test_output.py | # SPDX-FileCopyrightText: 2016 pedromreis
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import json
import os
import unittest
import intelmq.lib.test as test
import intelmq.lib.utils as utils
from intelmq.bots.outputs.amqptopic.output import AMQPTopicOutputBot
from intelmq.tests.bots.outputs.... | 3,152 | Python | .py | 75 | 28.933333 | 71 | 0.548303 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,582 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/blackhole/test_output.py | # SPDX-FileCopyrightText: 2018 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import unittest
import intelmq.lib.test as test
from intelmq.bots.outputs.blackhole.output import BlackholeOutputBot
class TestBlackholeOutputBot(test.BotTestCase, unittest.TestCase):
@classme... | 551 | Python | .py | 16 | 30.375 | 68 | 0.731939 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,583 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/rpz_file/test_output.py | """
RPZ file output
SPDX-FileCopyrightText: 2021 Marius Karotkis <marius.karotkis@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
import os
import tempfile
import unittest
import intelmq.lib.test as test
from intelmq.bots.outputs.rpz_file.output import RpzFileOutputBot
INPUT = {
'__type': 'Event',
... | 4,185 | Python | .py | 87 | 41.873563 | 228 | 0.676211 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,584 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/stomp/test_output.py | # SPDX-FileCopyrightText: 2016 aaronkaplan
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
if os.environ.get('INTELMQ_TEST_EXOTIC'):
import intelmq.bots.outputs.stomp.output
| 213 | Python | .py | 7 | 28.571429 | 44 | 0.754902 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,585 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/touch/test_output.py | # SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
import unittest
from tempfile import TemporaryDirectory, NamedTemporaryFile
import intelmq.lib.test as test
from intelmq.bots.outputs.touch.output import TouchOutputBot
class TestTouchOut... | 1,113 | Python | .py | 28 | 32.75 | 81 | 0.684944 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,586 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/smtp/test_output.py | # SPDX-FileCopyrightText: 2017 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import unittest
import intelmq.lib.test as test
from intelmq.bots.outputs.smtp.output import SMTPOutputBot
SENT_MESSAGE = None
EVENT = {'__type': 'Event',
'source.ip': '127.0.0.1',
... | 3,801 | Python | .py | 77 | 39.376623 | 108 | 0.60383 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,587 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/file/test_output.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
import tempfile
import unittest
import intelmq.lib.test as test
from intelmq.bots.outputs.file.output import FileOutputBot
class TestFileOutputBot(test.BotTestCase, unittest.TestCase):
... | 911 | Python | .py | 27 | 27.888889 | 61 | 0.669336 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,588 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/smtp_batch/test_output.py | # SPDX-FileCopyrightText: 2022 CSIRT.cz <https://csirt.cz>
# SPDX-License-Identifier: AGPL-3.0-or-later
from pathlib import Path
import time
import unittest
try:
from envelope import Envelope
except ImportError:
Envelope = None
import intelmq.lib.test as test
from intelmq.bots.outputs.smtp_batch.output import... | 4,329 | Python | .py | 96 | 35.447917 | 102 | 0.605794 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,589 | test_output_postgresql.py | certtools_intelmq/intelmq/tests/bots/outputs/sql/test_output_postgresql.py | # SPDX-FileCopyrightText: 2019 Sebastian Wagner, 2022 Intevation GmbH
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import json
import os
import unittest
from unittest import mock
import intelmq.lib.test as test
from intelmq.bots.outputs.sql.output import SQLOutputBot
if os.environ.get('INTE... | 8,112 | Python | .py | 169 | 36.053254 | 120 | 0.58564 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,590 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/bro_file/test_output.py | """
Bro file output
SPDX-FileCopyrightText: 2021 Marius Karotkis <marius.karotkis@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
import os
import tempfile
import unittest
import intelmq.lib.test as test
from intelmq.bots.outputs.bro_file.output import BroFileOutputBot
INPUT = {
"__type": "Event",
... | 2,163 | Python | .py | 63 | 27.984127 | 108 | 0.637931 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,591 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/redis/test_output.py | # SPDX-FileCopyrightText: 2016 pedromreis
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import json
import os
import unittest
import redis
import intelmq.lib.test as test
import intelmq.lib.utils as utils
from intelmq.bots.outputs.redis.output import RedisOutputBot
EXAMPLE_EVENT = {"classi... | 3,514 | Python | .py | 72 | 36.097222 | 92 | 0.591175 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,592 | test_output_as_hierarchical_json.py | certtools_intelmq/intelmq/tests/bots/outputs/redis/test_output_as_hierarchical_json.py | # SPDX-FileCopyrightText: 2019 KRYSTOF
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import json
import os
import unittest
import redis
import intelmq.lib.test as test
import intelmq.lib.utils as utils
from intelmq.bots.outputs.redis.output import RedisOutputBot
EXAMPLE_EVENT = {"classific... | 5,430 | Python | .py | 114 | 30.675439 | 92 | 0.511531 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,593 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/mongodb/test_output.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
import unittest
import intelmq.lib.test as test
from intelmq.bots.outputs.mongodb.output import MongoDBOutputBot
if os.environ.get('INTELMQ_TEST_DATABASES'):
import pymongo
INPUT1 = {... | 1,639 | Python | .py | 44 | 28.840909 | 77 | 0.576656 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,594 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/templated_smtp/test_output.py | # SPDX-FileCopyrightText: 2021 Linköping University <https://liu.se/>
# SPDX-License-Identifier: AGPL-3.0-or-later
import unittest
import json
import base64
from ruamel.yaml import YAML
import intelmq.lib.test as test
from intelmq.bots.outputs.templated_smtp.output import TemplatedSMTPOutputBot
yaml = YAML(typ="sa... | 8,079 | Python | .py | 189 | 34.455026 | 118 | 0.592395 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,595 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/tcp/test_output.py | # SPDX-FileCopyrightText: 2016 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
See TCP Collector test
"""
import intelmq.bots.outputs.tcp.output
| 192 | Python | .py | 8 | 22.625 | 47 | 0.751381 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,596 | test_output_feed.py | certtools_intelmq/intelmq/tests/bots/outputs/misp/test_output_feed.py | # SPDX-FileCopyrightText: 2019 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import unittest
import sys
from tempfile import TemporaryDirectory
import intelmq.lib.test as test
from intelmq.bots.outputs.misp.output_feed import MISPFeedOutputBot
EXAMPLE_EVENT = {"classificatio... | 2,327 | Python | .py | 50 | 34.8 | 83 | 0.606811 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,597 | test_output_api.py | certtools_intelmq/intelmq/tests/bots/outputs/misp/test_output_api.py | # SPDX-FileCopyrightText: 2020 Bernhard Reiter
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
# import unittest
# import intelmq.lib.test as test
if os.environ.get('INTELMQ_TEST_EXOTIC'):
from intelmq.bots.outputs.misp.output_api import MISPAPIOutputBot # noqa
# This file is a stub
# We cannot do mu... | 397 | Python | .py | 11 | 34.454545 | 77 | 0.78329 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,598 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/cif3/test_output.py | # SPDX-FileCopyrightText: 2022 REN-ISAC
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
# import unittest
# import intelmq.lib.test as test
if os.environ.get('INTELMQ_TEST_EXOTIC'):
from intelmq.bots.outputs.cif3.output import CIF3OutputBot # noqa
# This file is a stub
# We ca... | 408 | Python | .py | 12 | 32.416667 | 71 | 0.75827 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,599 | test_output.py | certtools_intelmq/intelmq/tests/bots/outputs/elasticsearch/test_output.py | # SPDX-FileCopyrightText: 2017 Sebastian Wagner
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
import os
import unittest
import unittest.mock as mock
from datetime import datetime
import intelmq.lib.test as test
from intelmq.bots.outputs.elasticsearch.output import ElasticsearchOutputBot, get_... | 8,884 | Python | .py | 220 | 31.104545 | 117 | 0.587901 | certtools/intelmq | 963 | 295 | 206 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |