clue-api 1.3.0.dev102__tar.gz → 1.3.0.dev104__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.dev102 → clue_api-1.3.0.dev104}/PKG-INFO +1 -1
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/__init__.py +14 -21
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/pyproject.toml +1 -1
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/LICENSE +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/README.md +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/.gitignore +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/base.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/actions.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/auth.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/configs.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/fetchers.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/lookup.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/registration.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/api/v1/static.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/app.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/cache/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/classification.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/classification.yml +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/dict_utils.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/exceptions.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/forge.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/json_utils.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/list_utils.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/logging/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/logging/audit.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/logging/format.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/regex.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/str_utils.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/swagger.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/common/uid.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/config.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/constants/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/constants/env.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/constants/supported_types.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/cronjobs/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/cronjobs/plugins.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/error.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/extensions/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/extensions/config.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/gunicorn_config.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/healthz.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/helper/discover.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/helper/headers.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/helper/oauth.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/actions.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/config.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/fetchers.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/graph.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/model_list.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/network.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/results/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/results/base.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/results/graph.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/results/image.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/results/status.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/results/validation.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/selector.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/models/validators.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/patched.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/celery_app.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/helpers/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/helpers/central_server.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/helpers/email_render.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/helpers/token.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/helpers/trino.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/models.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/plugin/utils.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/py.typed +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/cache.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/events.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/hash.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/queues/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/queues/comms.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/set.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/remote/datatypes/user_quota_tracker.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/security/__init__.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/security/obo.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/security/utils.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/action_service.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/auth_service.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/config_service.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/fetcher_service.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/jwt_service.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/lookup_service.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/type_service.py +0 -0
- {clue_api-1.3.0.dev102 → clue_api-1.3.0.dev104}/clue/services/user_service.py +0 -0
|
@@ -977,28 +977,23 @@ class CluePlugin:
|
|
|
977
977
|
|
|
978
978
|
token: str | None = None
|
|
979
979
|
if self.validate_token:
|
|
980
|
-
|
|
981
|
-
self.logger.debug("Executing plugin-provided token validator")
|
|
980
|
+
self.logger.debug("Executing plugin-provided token validator")
|
|
982
981
|
|
|
983
982
|
token, error = self.validate_token()
|
|
984
983
|
|
|
985
984
|
if error:
|
|
986
985
|
return self.make_api_response(None, f"Error on token validation: {error}", status_code=401)
|
|
987
986
|
|
|
988
|
-
|
|
989
|
-
self.logger.debug("Token is valid")
|
|
987
|
+
self.logger.debug("Token is valid")
|
|
990
988
|
else:
|
|
991
|
-
|
|
992
|
-
self.logger.debug("No token validator provided")
|
|
989
|
+
self.logger.warning("No token validator provided")
|
|
993
990
|
|
|
994
991
|
# All results were cached
|
|
995
992
|
if len(remaining_items) == 0:
|
|
996
|
-
|
|
997
|
-
self.logger.info("All values retrieved from cache")
|
|
993
|
+
self.logger.info("All values retrieved from cache")
|
|
998
994
|
# Alternate bulk lookup is provided
|
|
999
995
|
elif self.alternate_bulk_lookup:
|
|
1000
|
-
|
|
1001
|
-
self.logger.debug("Executing plugin-provided alternate bulk lookup script")
|
|
996
|
+
self.logger.debug("Executing plugin-provided alternate bulk lookup script")
|
|
1002
997
|
|
|
1003
998
|
try:
|
|
1004
999
|
alternate_results = self.alternate_bulk_lookup(remaining_items, params)
|
|
@@ -1015,21 +1010,18 @@ class CluePlugin:
|
|
|
1015
1010
|
except UnprocessableException as e:
|
|
1016
1011
|
return self.make_api_response(None, e.message, 422)
|
|
1017
1012
|
except Exception as e:
|
|
1018
|
-
|
|
1019
|
-
self.logger.exception("Unknown internal exception")
|
|
1013
|
+
self.logger.exception("Unknown internal exception")
|
|
1020
1014
|
return self.make_api_response(None, f"Something went wrong when enriching: {e}", 500)
|
|
1021
1015
|
|
|
1022
1016
|
if self.cache and len(remaining_items) > 0:
|
|
1023
|
-
|
|
1024
|
-
self.logger.info("Caching results for %s selectors", len(remaining_items))
|
|
1017
|
+
self.logger.info("Caching results for %s selectors", len(remaining_items))
|
|
1025
1018
|
|
|
1026
1019
|
for entry in remaining_items:
|
|
1027
1020
|
try:
|
|
1028
1021
|
items = bulk_result[entry["type"]][entry["value"]].items
|
|
1029
1022
|
self.cache.set(entry["type"], entry["value"], params, items)
|
|
1030
1023
|
except KeyError:
|
|
1031
|
-
|
|
1032
|
-
self.logger.warning("Selector not present in bulk result, skipping cache step")
|
|
1024
|
+
self.logger.warning("Selector not present in bulk result, skipping cache step")
|
|
1033
1025
|
# Default bulk lookup
|
|
1034
1026
|
else:
|
|
1035
1027
|
self.__default_bulk_lookup(bulk_result, remaining_items, params, token)
|
|
@@ -1037,11 +1029,10 @@ class CluePlugin:
|
|
|
1037
1029
|
# Calculate how close we came to the deadline (positive = time remaining, negative = overrun)
|
|
1038
1030
|
variance = params.deadline - time.time()
|
|
1039
1031
|
|
|
1040
|
-
if
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
self.logger.debug(f"Deadline met, {round(variance * 1000)}ms to spare")
|
|
1032
|
+
if variance < 0:
|
|
1033
|
+
self.logger.warning(f"Deadline missed by {-round(variance * 1000)}ms")
|
|
1034
|
+
else:
|
|
1035
|
+
self.logger.debug(f"Deadline met, {round(variance * 1000)}ms to spare")
|
|
1045
1036
|
|
|
1046
1037
|
try:
|
|
1047
1038
|
serialized_reult = TypeAdapter(dict[str, dict[str, BulkEntry]]).dump_python(
|
|
@@ -1326,6 +1317,8 @@ class CluePlugin:
|
|
|
1326
1317
|
return self.make_api_response(None, f"Error on token validation: {error}", status_code=401)
|
|
1327
1318
|
|
|
1328
1319
|
self.logger.debug("Token is valid")
|
|
1320
|
+
else:
|
|
1321
|
+
self.logger.warning("No token validation provided. The access token will not be provided to the fetcher.")
|
|
1329
1322
|
|
|
1330
1323
|
status_code = 200
|
|
1331
1324
|
try:
|
|
@@ -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.dev104"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|