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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34,600 | negative_test_suite.py | mozilla_MozDef/tests/mozdef_util/query_models/negative_test_suite.py | from .query_test_suite import QueryTestSuite
class NegativeTestSuite(QueryTestSuite):
"""
Represents a positive test case expectation.
Used in the elasticsearch abstract class unit tests.
"""
positive_test = False
| 240 | Python | .py | 7 | 29.571429 | 58 | 0.748918 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,601 | test_exists_match.py | mozilla_MozDef/tests/mozdef_util/query_models/test_exists_match.py | from .positive_test_suite import PositiveTestSuite
from .negative_test_suite import NegativeTestSuite
from mozdef_util.query_models import ExistsMatch
class TestExistsMatchPositiveTestSuite(PositiveTestSuite):
def query_tests(self):
tests = [
[
ExistsMatch('summary'), [
... | 1,327 | Python | .py | 41 | 18.073171 | 84 | 0.42701 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,602 | test_less_than_match.py | mozilla_MozDef/tests/mozdef_util/query_models/test_less_than_match.py | from .positive_test_suite import PositiveTestSuite
from .negative_test_suite import NegativeTestSuite
from mozdef_util.query_models import LessThanMatch
class TestLessThanMatchPositiveTestSuite(PositiveTestSuite):
def query_tests(self):
boundry_date = "2016-08-12T21:07:12.316450+00:00"
tests = [
... | 1,656 | Python | .py | 35 | 34.057143 | 73 | 0.555693 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,603 | test_aggregation.py | mozilla_MozDef/tests/mozdef_util/query_models/test_aggregation.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from mozdef_util.query_models import SearchQuery, Aggre... | 9,174 | Python | .py | 172 | 43.482558 | 99 | 0.584217 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,604 | test_wildcard_match.py | mozilla_MozDef/tests/mozdef_util/query_models/test_wildcard_match.py | from .positive_test_suite import PositiveTestSuite
from .negative_test_suite import NegativeTestSuite
from mozdef_util.query_models import WildcardMatch
class TestWildcardMatchPositiveTestSuite(PositiveTestSuite):
def query_tests(self):
tests = [
[
WildcardMatch('summary', 'te... | 1,863 | Python | .py | 53 | 20.622642 | 60 | 0.402216 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,605 | test_phrase_match.py | mozilla_MozDef/tests/mozdef_util/query_models/test_phrase_match.py | from .positive_test_suite import PositiveTestSuite
from .negative_test_suite import NegativeTestSuite
from mozdef_util.query_models import PhraseMatch
class TestPhraseMatchPositiveTestSuite(PositiveTestSuite):
def query_tests(self):
tests = [
[
PhraseMatch('summary', 'test run... | 1,804 | Python | .py | 52 | 20.288462 | 59 | 0.423583 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,606 | test_search_query.py | mozilla_MozDef/tests/mozdef_util/query_models/test_search_query.py | import pytest
from datetime import datetime
from mozdef_util.query_models import SearchQuery, ExistsMatch, TermMatch, Aggregation
from tests.unit_test_suite import UnitTestSuite
class SearchQueryUnitTest(UnitTestSuite):
def setup(self):
super().setup()
self.query = SearchQuery()
assert... | 21,343 | Python | .py | 430 | 39.695349 | 119 | 0.60666 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,607 | test_subnet_match.py | mozilla_MozDef/tests/mozdef_util/query_models/test_subnet_match.py | from .positive_test_suite import PositiveTestSuite
from .negative_test_suite import NegativeTestSuite
from mozdef_util.query_models import SubnetMatch
class TestSubnetMatchPositiveTestSuite(PositiveTestSuite):
def query_tests(self):
tests = [
[
SubnetMatch('details.sourceipadd... | 1,837 | Python | .py | 56 | 14.214286 | 72 | 0.326577 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,608 | positive_test_suite.py | mozilla_MozDef/tests/mozdef_util/query_models/positive_test_suite.py | from .query_test_suite import QueryTestSuite
class PositiveTestSuite(QueryTestSuite):
"""
Represents a positive test case expectation.
Used in the elasticsearch abstract class unit tests.
"""
positive_test = True
| 239 | Python | .py | 7 | 29.428571 | 58 | 0.747826 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,609 | test_range_match.py | mozilla_MozDef/tests/mozdef_util/query_models/test_range_match.py | from .positive_test_suite import PositiveTestSuite
from .negative_test_suite import NegativeTestSuite
from mozdef_util.query_models import RangeMatch
class TestRangeMatchPositiveTestSuite(PositiveTestSuite):
def query_tests(self):
begin_date = "2016-08-12T21:07:12.316450+00:00"
end_date = "2016-0... | 1,391 | Python | .py | 32 | 31.6875 | 73 | 0.567208 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,610 | plugin6.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin6.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
registers ... | 577 | Python | .py | 14 | 35.428571 | 69 | 0.671429 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,611 | plugin7.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin7.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
registers ... | 531 | Python | .py | 14 | 32.142857 | 69 | 0.651751 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,612 | plugin2.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin2.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
intended t... | 651 | Python | .py | 16 | 34.5 | 69 | 0.664557 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,613 | plugin5.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin5.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
modifies t... | 531 | Python | .py | 14 | 32.142857 | 69 | 0.657588 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,614 | plugin1.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin1.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
intended t... | 711 | Python | .py | 18 | 33 | 69 | 0.650725 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,615 | plugin3.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin3.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
intended t... | 624 | Python | .py | 16 | 32.8125 | 69 | 0.656198 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,616 | plugin8.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin8.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
registers ... | 600 | Python | .py | 14 | 37.071429 | 70 | 0.675815 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,617 | plugin4.py | mozilla_MozDef/tests/mozdef_util/test_plugins/plugin4.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
intended t... | 568 | Python | .py | 14 | 34.785714 | 69 | 0.671506 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,618 | createIPBlockList.py | mozilla_MozDef/cron/createIPBlockList.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import boto3
import netaddr
import sys
from datetime im... | 5,394 | Python | .py | 128 | 34.296875 | 152 | 0.635757 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,619 | createFDQNBlockList.py | mozilla_MozDef/cron/createFDQNBlockList.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import boto3
import logging
import random
import re
impo... | 6,124 | Python | .py | 141 | 35.921986 | 152 | 0.647849 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,620 | healthAndStatus.py | mozilla_MozDef/cron/healthAndStatus.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import json
import os
import requests
import sys
from d... | 6,786 | Python | .py | 139 | 38.165468 | 129 | 0.611983 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,621 | verify_event_fields.py | mozilla_MozDef/cron/verify_event_fields.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import sys
from configlib import getConfig, OptionParse... | 2,462 | Python | .py | 52 | 40.769231 | 93 | 0.689482 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,622 | sqs_queue_status.py | mozilla_MozDef/cron/sqs_queue_status.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
# kombu's support for SQS is buggy
# so this version us... | 4,718 | Python | .py | 103 | 40.126214 | 125 | 0.70546 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,623 | backupSnapshot.py | mozilla_MozDef/cron/backupSnapshot.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
# Snapshot configured backups
# Meant to be run once/da... | 4,820 | Python | .py | 130 | 28.538462 | 126 | 0.607357 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,624 | closeIndices.py | mozilla_MozDef/cron/closeIndices.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
# set this to run as a cronjob (after backup has comple... | 3,017 | Python | .py | 77 | 31.090909 | 113 | 0.628415 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,625 | okta2mozdef.py | mozilla_MozDef/cron/okta2mozdef.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import sys
from configlib import getConfig, OptionParse... | 6,717 | Python | .py | 122 | 40.139344 | 126 | 0.568344 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,626 | update_ip_list.py | mozilla_MozDef/cron/update_ip_list.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import sys
import os
from configlib import getConfig, O... | 3,151 | Python | .py | 67 | 41.656716 | 137 | 0.699054 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,627 | auth02mozdef.py | mozilla_MozDef/cron/auth02mozdef.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2016 Mozilla Corporation
# Imports auth0.com logs into MozDef
import hjson
impor... | 21,097 | Python | .py | 419 | 42.806683 | 188 | 0.629439 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,628 | syncAlertsToMongo.py | mozilla_MozDef/cron/syncAlertsToMongo.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import calendar
import random
import sys
from configlib... | 3,928 | Python | .py | 90 | 35.988889 | 102 | 0.65977 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,629 | pruneIndexes.py | mozilla_MozDef/cron/pruneIndexes.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
# set this to run as a cronjob (after backup has comple... | 3,584 | Python | .py | 94 | 29.265957 | 126 | 0.604832 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,630 | update_ipintel.py | mozilla_MozDef/cron/update_ipintel.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import argparse
import json
import typing as types
imp... | 1,672 | Python | .py | 44 | 32.863636 | 70 | 0.691635 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,631 | google2mozdef.py | mozilla_MozDef/cron/google2mozdef.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import sys
import json
from configlib import getConfig,... | 7,746 | Python | .py | 162 | 35.438272 | 125 | 0.5819 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,632 | duo_logpull.py | mozilla_MozDef/cron/duo_logpull.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
import sys
import json
import duo_client
import mozdef_client as mozdef
import pickle
from conf... | 9,367 | Python | .py | 213 | 34.821596 | 288 | 0.594589 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,633 | eventStats.py | mozilla_MozDef/cron/eventStats.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import json
import os
import sys
from datetime import d... | 4,155 | Python | .py | 96 | 34.729167 | 93 | 0.648194 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,634 | update_generic_alerts.py | mozilla_MozDef/cron/update_generic_alerts.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from git import Repo, cmd
import sys
import os
from co... | 1,981 | Python | .py | 43 | 41.255814 | 109 | 0.707076 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,635 | esCacheMaint.py | mozilla_MozDef/cron/esCacheMaint.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import json
import random
import requests
import sys
im... | 4,585 | Python | .py | 90 | 42.255556 | 175 | 0.641788 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,636 | healthToMongo.py | mozilla_MozDef/cron/healthToMongo.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import requests
import sys
from configlib import getCo... | 5,294 | Python | .py | 126 | 35.150794 | 119 | 0.649854 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,637 | triage_bot.py | mozilla_MozDef/cron/triage_bot.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import argparse
from datetime import datetime, timedelt... | 3,495 | Python | .py | 88 | 34.386364 | 79 | 0.702671 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,638 | update_geolite_db.py | mozilla_MozDef/cron/update_geolite_db.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import sys
import requests
import tempfile
import gzip
... | 3,321 | Python | .py | 72 | 40.777778 | 128 | 0.691213 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,639 | rotateIndexes.py | mozilla_MozDef/cron/rotateIndexes.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
# set this to run as a cronjob at 00:00 UTC to create t... | 8,407 | Python | .py | 172 | 36.186047 | 126 | 0.581163 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,640 | lambdalert.py | mozilla_MozDef/cloudy_mozdef/lambda_layer/lambdalert.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import logging
import sys
from lib.alerttask import Ale... | 1,959 | Python | .py | 47 | 35.510638 | 79 | 0.692552 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,641 | pack_and_copy | mozilla_MozDef/cloudy_mozdef/ci/pack_and_copy | #!/bin/bash
BRANCH=$1
AMI_MAP_TEMP_FILE=$2
TMPDIR=$(mktemp -d)
cd packer
packer -machine-readable build -var github_branch="${BRANCH}" packer.json 2>&1 | tee "${TMPDIR}/packer-output.txt"
awk -F "," '$4 == "0" {print $0}' "${TMPDIR}/packer-output.txt"
ami_source_region=$(awk -F "," '($4 == "0") && ($5 == "id") {prin... | 3,048 | Python | .py | 58 | 48.551724 | 128 | 0.636089 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,642 | esworker_sqs.py | mozilla_MozDef/mq/esworker_sqs.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
# kombu's support for SQS is buggy
# so this version us... | 15,359 | Python | .py | 313 | 36.910543 | 151 | 0.601362 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,643 | esworker_guardduty.py | mozilla_MozDef/mq/esworker_guardduty.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import json
import sys
import socket
from configlib imp... | 7,193 | Python | .py | 145 | 39.57931 | 151 | 0.630791 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,644 | esworker_cloudtrail.py | mozilla_MozDef/mq/esworker_cloudtrail.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import json
import os
import sys
import socket
from co... | 18,138 | Python | .py | 366 | 38.071038 | 151 | 0.611008 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,645 | esworker_papertrail.py | mozilla_MozDef/mq/esworker_papertrail.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2015 Mozilla Corporation
# Reads from papertrail using the API and inserts log d... | 16,207 | Python | .py | 331 | 36.836858 | 151 | 0.596178 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,646 | esworker_eventtask.py | mozilla_MozDef/mq/esworker_eventtask.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import json
import kombu
import sys
import socket
from... | 15,599 | Python | .py | 317 | 38.132492 | 151 | 0.622019 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,647 | esworker_pubsub.py | mozilla_MozDef/mq/esworker_pubsub.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import json
import sys
import socket
import time
from co... | 6,445 | Python | .py | 146 | 35.19863 | 151 | 0.648636 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,648 | esworker_sns_sqs.py | mozilla_MozDef/mq/esworker_sns_sqs.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import json
import sys
import socket
import time
impor... | 10,025 | Python | .py | 203 | 35.758621 | 151 | 0.582234 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,649 | plugins.py | mozilla_MozDef/mq/lib/plugins.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import os
from operator import itemgetter
from datetim... | 3,732 | Python | .py | 81 | 35.703704 | 113 | 0.626821 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,650 | aws.py | mozilla_MozDef/mq/lib/aws.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
def get_aws_credentials(region_name=None, aws_access_key_id=None, aws_secret_... | 842 | Python | .py | 15 | 51.266667 | 118 | 0.698182 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,651 | sqs.py | mozilla_MozDef/mq/lib/sqs.py | import boto3
from .aws import get_aws_credentials
def connect_sqs(region_name=None, aws_access_key_id=None,
aws_secret_access_key=None, task_exchange=None):
sqs = boto3.resource(
'sqs',
**get_aws_credentials(region_name, aws_access_key_id, aws_secret_access_key)
)
queue = s... | 383 | Python | .py | 10 | 32.3 | 84 | 0.690027 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,652 | ttl_auditd.py | mozilla_MozDef/mq/plugins/ttl_auditd.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
register o... | 3,717 | Python | .py | 76 | 35.855263 | 99 | 0.531938 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,653 | netflowFixup.py | mozilla_MozDef/mq/plugins/netflowFixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
takes an i... | 622 | Python | .py | 16 | 32.5625 | 69 | 0.657238 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,654 | squidFixup.py | mozilla_MozDef/mq/plugins/squidFixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2018 Mozilla Corporation
# http://www.squid-cache.org/Doc/config/logformat/
# https://wiki.squid-cache.o... | 5,583 | Python | .py | 124 | 33.25 | 104 | 0.562603 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,655 | stackdriver.py | mozilla_MozDef/mq/plugins/stackdriver.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import urllib
from mozdef_util.utilities.toUTC import toUTC
class message(ob... | 2,721 | Python | .py | 55 | 36.327273 | 107 | 0.563958 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,656 | sshdFindIP.py | mozilla_MozDef/mq/plugins/sshdFindIP.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import netaddr
def isIPv4(ip):
try:
# netaddr on it's own consid... | 2,302 | Python | .py | 53 | 32.264151 | 130 | 0.583482 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,657 | parse_su.py | mozilla_MozDef/mq/plugins/parse_su.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import re
class message(object):
def __init__(self):
'''
... | 1,497 | Python | .py | 27 | 42.703704 | 193 | 0.562628 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,658 | zoom_fixup.py | mozilla_MozDef/mq/plugins/zoom_fixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import os
import jmespath
import yaml
from mozdef_util.utilities.key_exists im... | 6,165 | Python | .py | 95 | 52.926316 | 171 | 0.617074 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,659 | lower_keys.py | mozilla_MozDef/mq/plugins/lower_keys.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
takes an ... | 1,195 | Python | .py | 26 | 35.192308 | 104 | 0.605331 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,660 | parse_sshd.py | mozilla_MozDef/mq/plugins/parse_sshd.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import re
class message(object):
def __init__(self):
'''
... | 5,262 | Python | .py | 64 | 68.140625 | 262 | 0.613606 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,661 | filterlog.py | mozilla_MozDef/mq/plugins/filterlog.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
class message(object):
def __init__(self):
'''
Plugin... | 4,158 | Python | .py | 74 | 45.216216 | 86 | 0.572727 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,662 | stackdriver_audit.py | mozilla_MozDef/mq/plugins/stackdriver_audit.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from mozdef_util.utilities.toUTC import toUTC
import os
import yaml
import jme... | 3,230 | Python | .py | 63 | 41.904762 | 151 | 0.629594 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,663 | broFixup.py | mozilla_MozDef/mq/plugins/broFixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import netaddr
import json
from datetime import datetime
from platform import ... | 36,647 | Python | .py | 629 | 37.755167 | 162 | 0.479343 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,664 | stackdriver_syslog.py | mozilla_MozDef/mq/plugins/stackdriver_syslog.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from mozdef_util.utilities.toUTC import toUTC
class message(object):
def... | 1,828 | Python | .py | 40 | 37.2 | 89 | 0.628652 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,665 | remove_dots.py | mozilla_MozDef/mq/plugins/remove_dots.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
takes an ... | 1,350 | Python | .py | 29 | 34.172414 | 75 | 0.565019 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,666 | googleFixup.py | mozilla_MozDef/mq/plugins/googleFixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
takes an i... | 1,049 | Python | .py | 24 | 35.25 | 88 | 0.608055 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,667 | suricataFixup.py | mozilla_MozDef/mq/plugins/suricataFixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2018 Mozilla Corporation
import json
from datetime import datetime
from platform import node
from mozde... | 10,750 | Python | .py | 172 | 45.104651 | 153 | 0.537966 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,668 | nagioshostname.py | mozilla_MozDef/mq/plugins/nagioshostname.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import hashlib
class message(object):
def __init__(self):
'''
... | 902 | Python | .py | 21 | 36.380952 | 95 | 0.666667 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,669 | ipFixup.py | mozilla_MozDef/mq/plugins/ipFixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import netaddr
def isIPv4(ip):
try:
return netaddr.valid_ipv4(ip... | 6,207 | Python | .py | 116 | 39.465517 | 127 | 0.574839 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,670 | geoip.py | mozilla_MozDef/mq/plugins/geoip.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import netaddr
import os
from mozdef_util.geo_ip import GeoIP
def isIP(ip):... | 3,222 | Python | .py | 63 | 35.587302 | 130 | 0.529206 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,671 | observium.py | mozilla_MozDef/mq/plugins/observium.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import re
class message(object):
def __init__(self):
'''register... | 1,905 | Python | .py | 33 | 43.454545 | 147 | 0.557043 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,672 | rt_flow.py | mozilla_MozDef/mq/plugins/rt_flow.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import re
class message(object):
def __init__(self):
'''register... | 4,655 | Python | .py | 54 | 66.277778 | 517 | 0.533943 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,673 | cloudtrail.py | mozilla_MozDef/mq/plugins/cloudtrail.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import json
from mozdef_util.utilities.key_exists import key_exists
class me... | 7,320 | Python | .py | 128 | 45.53125 | 145 | 0.688858 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,674 | complianceitems.py | mozilla_MozDef/mq/plugins/complianceitems.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import hashlib
from mozdef_util.utilities.logger import logger
class message... | 2,936 | Python | .py | 69 | 33.15942 | 81 | 0.559441 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,675 | large_strings.py | mozilla_MozDef/mq/plugins/large_strings.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
self.registration = ['... | 1,905 | Python | .py | 32 | 45.9375 | 106 | 0.555198 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,676 | auditdFixup.py | mozilla_MozDef/mq/plugins/auditdFixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''register our criter... | 5,525 | Python | .py | 106 | 38.839623 | 130 | 0.548835 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,677 | mozilla_location.py | mozilla_MozDef/mq/plugins/mozilla_location.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import os
from configlib import getConfig
class message(object):
def __i... | 2,358 | Python | .py | 43 | 42 | 107 | 0.573593 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,678 | guardDuty.py | mozilla_MozDef/mq/plugins/guardDuty.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import os
import yaml
import jmespath
from mozdef_util.utilities.toUTC import ... | 6,761 | Python | .py | 118 | 45.889831 | 180 | 0.617847 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,679 | ldap_fixup.py | mozilla_MozDef/mq/plugins/ldap_fixup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import typing as types
from mozdef_util.utilities.key_exists import key_exist... | 2,010 | Python | .py | 49 | 32.346939 | 83 | 0.597315 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,680 | triage_bot.py | mozilla_MozDef/mq/plugins/triage_bot.py | # triage_bot This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import enum
import json
import os
import typing as types
import re... | 6,971 | Python | .py | 169 | 34.87574 | 88 | 0.67033 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,681 | vulnerability.py | mozilla_MozDef/mq/plugins/vulnerability.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2015 Mozilla Corporation
import hashlib
from mozdef_util.utilities.logger import logger
class messag... | 3,353 | Python | .py | 79 | 32.278481 | 90 | 0.575107 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,682 | customDocType.py | mozilla_MozDef/mq/plugins/customDocType.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''
takes an i... | 846 | Python | .py | 19 | 36.578947 | 69 | 0.648846 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,683 | dropMessage.py | mozilla_MozDef/mq/plugins/dropMessage.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
class message(object):
def __init__(self):
'''register our criter... | 1,973 | Python | .py | 37 | 41.567568 | 104 | 0.610161 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,684 | snmptt.py | mozilla_MozDef/mq/plugins/snmptt.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import re
class message(object):
def __init__(self):
'''register... | 1,802 | Python | .py | 32 | 42.375 | 134 | 0.567705 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,685 | github_webhooks.py | mozilla_MozDef/mq/plugins/github_webhooks.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import os
import jmespath
import yaml
from mozdef_util.utilities.toUTC import ... | 4,858 | Python | .py | 89 | 44.123596 | 107 | 0.610726 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,686 | stackdriver_gceactivity.py | mozilla_MozDef/mq/plugins/stackdriver_gceactivity.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from mozdef_util.utilities.toUTC import toUTC
import os
import yaml
import jme... | 3,027 | Python | .py | 62 | 39.822581 | 151 | 0.634609 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,687 | mozdefbot.py | mozilla_MozDef/bot/irc/mozdefbot.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
"""mozdef bot using KitnIRC."""
import json
import kitni... | 16,001 | Python | .py | 395 | 29.625316 | 111 | 0.577785 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,688 | zilla.py | mozilla_MozDef/bot/irc/modules/zilla.py | #!/usr/bin/env python
# Inspired by https://github.com/ayust/kitnirc/blob/master/kitnirc/contrib/healthcheck.py
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copy... | 3,332 | Python | .py | 79 | 31.278481 | 111 | 0.574251 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,689 | roulette.py | mozilla_MozDef/bot/irc/modules/roulette.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
#
# Copy of https://github.com/gdestuynder/Stupid-python-... | 2,198 | Python | .py | 46 | 39.869565 | 97 | 0.651261 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,690 | slack_bot.py | mozilla_MozDef/bot/slack/slack_bot.py | import random
import sys
import os
import time
import websocket
from slackclient import SlackClient
from bot_plugin_set import BotPluginSet
from mozdef_util.utilities.logger import logger
greetings = [
"mozdef bot in da house",
"mozdef here..what's up",
"mozdef has joined the room..no one panic",
"... | 5,914 | Python | .py | 151 | 27.84106 | 123 | 0.562544 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,691 | bot_plugin_set.py | mozilla_MozDef/bot/slack/bot_plugin_set.py | import os
import pynsive
import importlib
from mozdef_util.utilities.logger import logger
class BotPluginSet():
def __init__(self, plugin_location, enabled_plugins=None):
self.plugin_location = plugin_location
self.enabled_plugins = self.identify_plugins(enabled_plugins)
def identify_plugin... | 1,741 | Python | .py | 36 | 37.083333 | 127 | 0.634218 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,692 | mozdefbot.py | mozilla_MozDef/bot/slack/mozdefbot.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
""" mozdef bot using slack
to install - 'pip install... | 6,683 | Python | .py | 154 | 34.688312 | 103 | 0.640659 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,693 | ip_whois.py | mozilla_MozDef/bot/slack/commands/ip_whois.py | import netaddr
from ipwhois import IPWhois
from mozdef_util.utilities.is_ip import is_ip
class Command():
def __init__(self):
self.command_name = '!ipwhois'
self.help_text = 'Perform a whois lookup on an ip address'
def handle_command(self, parameters):
response = ""
for ip_t... | 945 | Python | .py | 21 | 33.52381 | 91 | 0.565217 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,694 | roulette.py | mozilla_MozDef/bot/slack/commands/roulette.py | import random
class Command():
def __init__(self):
self.command_name = '!r'
self.help_text = 'Play a game of Russian Roulette'
self.gun_max_load = 6
self.gun_bullet_slot = random.randint(1, self.gun_max_load)
self.gun_current_slot = 0
def handle_command(self, parameter... | 970 | Python | .py | 22 | 34.772727 | 73 | 0.598942 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,695 | ip_info.py | mozilla_MozDef/bot/slack/commands/ip_info.py | import netaddr
import os
from mozdef_util.geo_ip import GeoIP
from mozdef_util.utilities.is_ip import is_ip
def ip_location(ip):
location = ""
try:
geoip_data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../data/GeoLite2-City.mmdb")
geoip = GeoIP(geoip_data_dir)
... | 1,480 | Python | .py | 36 | 31.055556 | 117 | 0.562587 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,696 | index.py | mozilla_MozDef/rest/index.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import bottle
import enum
import json
import netaddr
import os
import pynsive
... | 35,633 | Python | .py | 901 | 31.540511 | 121 | 0.627543 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,697 | watchlist.py | mozilla_MozDef/rest/plugins/watchlist.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import os
import random
from configlib import getConfig, OptionParser
from dat... | 6,080 | Python | .py | 137 | 31.145985 | 102 | 0.559757 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,698 | ipblocklist.py | mozilla_MozDef/rest/plugins/ipblocklist.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import netaddr
import os
import random
import requests
from configlib import g... | 12,075 | Python | .py | 246 | 33.101626 | 123 | 0.531541 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |
34,699 | fqdnblocklist.py | mozilla_MozDef/rest/plugins/fqdnblocklist.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
import os
import random
import requests
import re
from configlib import getCon... | 10,754 | Python | .py | 219 | 32.863014 | 119 | 0.52351 | mozilla/MozDef | 2,167 | 327 | 0 | MPL-2.0 | 9/5/2024, 5:15:03 PM (Europe/Amsterdam) |