clue-api 1.3.0.dev96__tar.gz → 1.3.0.dev102__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/PKG-INFO +1 -1
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/app.py +6 -1
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/regex.py +0 -2
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/constants/supported_types.py +10 -9
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/extensions/config.py +4 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/pyproject.toml +1 -1
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/LICENSE +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/README.md +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/.gitignore +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/base.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/actions.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/auth.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/configs.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/fetchers.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/lookup.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/registration.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/api/v1/static.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/cache/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/classification.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/classification.yml +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/dict_utils.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/exceptions.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/forge.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/json_utils.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/list_utils.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/logging/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/logging/audit.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/logging/format.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/str_utils.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/swagger.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/common/uid.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/config.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/constants/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/constants/env.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/cronjobs/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/cronjobs/plugins.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/error.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/extensions/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/gunicorn_config.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/healthz.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/helper/discover.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/helper/headers.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/helper/oauth.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/actions.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/config.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/fetchers.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/graph.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/model_list.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/network.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/results/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/results/base.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/results/graph.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/results/image.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/results/status.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/results/validation.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/selector.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/models/validators.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/patched.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/celery_app.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/helpers/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/helpers/central_server.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/helpers/email_render.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/helpers/token.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/helpers/trino.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/models.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/plugin/utils.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/py.typed +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/cache.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/events.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/hash.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/queues/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/queues/comms.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/set.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/remote/datatypes/user_quota_tracker.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/security/__init__.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/security/obo.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/security/utils.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/action_service.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/auth_service.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/config_service.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/fetcher_service.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/jwt_service.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/lookup_service.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/type_service.py +0 -0
- {clue_api-1.3.0.dev96 → clue_api-1.3.0.dev102}/clue/services/user_service.py +0 -0
|
@@ -2,6 +2,8 @@ import warnings
|
|
|
2
2
|
|
|
3
3
|
from gevent import monkey
|
|
4
4
|
|
|
5
|
+
from clue.constants.supported_types import SUPPORTED_TYPES
|
|
6
|
+
|
|
5
7
|
monkey.patch_all()
|
|
6
8
|
|
|
7
9
|
import os
|
|
@@ -132,7 +134,8 @@ app.register_blueprint(registration_api)
|
|
|
132
134
|
app.register_blueprint(static_api)
|
|
133
135
|
|
|
134
136
|
|
|
135
|
-
logger.info("Checking extensions for additional routes")
|
|
137
|
+
logger.info("Checking extensions for initialization and additional routes")
|
|
138
|
+
num_buildin_types = len(SUPPORTED_TYPES)
|
|
136
139
|
for extension in get_extensions():
|
|
137
140
|
if extension.modules.init:
|
|
138
141
|
extension.modules.init(flask_app=app)
|
|
@@ -144,6 +147,8 @@ for extension in get_extensions():
|
|
|
144
147
|
logger.info("Enabling additional endpoint: %s", route.url_prefix)
|
|
145
148
|
app.register_blueprint(route)
|
|
146
149
|
|
|
150
|
+
logger.info("%s types configured (%s custom types)", len(SUPPORTED_TYPES), len(SUPPORTED_TYPES) - num_buildin_types)
|
|
151
|
+
|
|
147
152
|
# Setup OAuth providers
|
|
148
153
|
if config.auth.oauth.enabled:
|
|
149
154
|
providers = []
|
|
@@ -40,5 +40,3 @@ URI_ONLY = f"^{URI_REGEX}$"
|
|
|
40
40
|
UUID4_REGEX = r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
|
|
41
41
|
|
|
42
42
|
EMAIL_PATH_REGEX = r"^[A-Z]+_EMAIL://.*"
|
|
43
|
-
HBS_AGENT_ID_REGEX = r"[0-9a-fA-F]{1,4}\.[0-9a-fA-F]{1,4}\.[0-9a-fA-F]{1,4}\.[0-9a-fA-F]{1,4}"
|
|
44
|
-
HBS_AGENT_ID_ONLY_REGEX = f"^{HBS_AGENT_ID_REGEX}$"
|
|
@@ -3,7 +3,6 @@ from clue.common.regex import (
|
|
|
3
3
|
DOMAIN_ONLY_REGEX,
|
|
4
4
|
EMAIL_PATH_REGEX,
|
|
5
5
|
EMAIL_REGEX,
|
|
6
|
-
HBS_AGENT_ID_REGEX,
|
|
7
6
|
IPV4_ONLY_REGEX,
|
|
8
7
|
IPV6_ONLY_REGEX,
|
|
9
8
|
MD5_REGEX,
|
|
@@ -32,16 +31,17 @@ SUPPORTED_TYPES = {
|
|
|
32
31
|
"md5": MD5_REGEX,
|
|
33
32
|
"sha1": SHA1_REGEX,
|
|
34
33
|
"sha256": SHA256_REGEX,
|
|
35
|
-
"hbs_oid": None,
|
|
36
|
-
"hbs_agent_id": HBS_AGENT_ID_REGEX,
|
|
37
34
|
"telemetry": None,
|
|
38
|
-
"howler_id": None,
|
|
39
35
|
"hostname": None,
|
|
40
36
|
"tenant-id": UUID4_REGEX,
|
|
41
37
|
}
|
|
42
38
|
|
|
39
|
+
CASE_INSENSITIVE_TYPES = ["ip", "domain", "port", "tenant-id", "hbs_oid", "hbs_agent_id"]
|
|
40
|
+
|
|
43
41
|
|
|
44
|
-
def add_supported_type(
|
|
42
|
+
def add_supported_type(
|
|
43
|
+
type: str, regex: str | None = None, namespace: str | None = None, case_insensitive: bool = False
|
|
44
|
+
):
|
|
45
45
|
r"""Add a supported type to the SUPPORTED_TYPES registry.
|
|
46
46
|
|
|
47
47
|
This function registers a new type with an optional regex pattern for validation.
|
|
@@ -62,10 +62,11 @@ def add_supported_type(type: str, regex: str | None = None, namespace: str | Non
|
|
|
62
62
|
"""
|
|
63
63
|
if not namespace:
|
|
64
64
|
logger.info("Adding new type %s to the default namespace with regex %s", type, regex)
|
|
65
|
-
|
|
65
|
+
new_entry = type
|
|
66
66
|
else:
|
|
67
67
|
logger.info("Adding type %s to namespace %s with regex %s", type, namespace, regex)
|
|
68
|
-
|
|
68
|
+
new_entry = f"{namespace}/{type}"
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
SUPPORTED_TYPES[new_entry] = regex
|
|
71
|
+
if case_insensitive:
|
|
72
|
+
CASE_INSENSITIVE_TYPES.append(new_entry)
|
|
@@ -59,6 +59,10 @@ class BaseExtensionConfig(BaseSettings):
|
|
|
59
59
|
|
|
60
60
|
data["modules"]["routes"] = new_routes
|
|
61
61
|
|
|
62
|
+
if "init" in data["modules"]:
|
|
63
|
+
if isinstance(data["modules"]["init"], bool):
|
|
64
|
+
data["modules"]["init"] = f"{plugin_name}.init:initialize"
|
|
65
|
+
|
|
62
66
|
if "obo_module" in data["modules"]:
|
|
63
67
|
if isinstance(data["modules"]["obo_module"], bool):
|
|
64
68
|
data["modules"]["obo_module"] = f"{plugin_name}.obo:get_obo_token"
|
|
@@ -142,7 +142,7 @@ log_cli_level = "WARN"
|
|
|
142
142
|
[tool.poetry]
|
|
143
143
|
package-mode = true
|
|
144
144
|
name = "clue-api"
|
|
145
|
-
version = "1.3.0.
|
|
145
|
+
version = "1.3.0.dev102"
|
|
146
146
|
description = "Clue distributed enrichment service"
|
|
147
147
|
authors = ["Canadian Centre for Cyber Security <contact@cyber.gc.ca>"]
|
|
148
148
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|