ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.
Python active-directorycloud-securitydefensive-validationfastapigood-first-issuemitre-attackopsecreactred-teamreportingsecurity
fix(api): protect core module descriptors from being popped during /modules/reload
Mafifrizi6f641604fd49
diff --git a/ares/api/server.py b/ares/api/server.pyindex 34186b5..f1a1736 100644--- a/ares/api/server.py+++ b/ares/api/server.py@@ -2267,8 +2267,17 @@ async def reload_modules(import importlibimport sys+ _protected_core_modules = {+ "ares.modules.base",+ "ares.modules.descriptors",+ "ares.modules.params",+ "ares.modules.runner",+ "ares.modules.exceptions",+ }for mod_name in list(sys.modules.keys()):- if mod_name.startswith("ares.modules.") and not mod_name.endswith(".base"):+ if mod_name.startswith("ares.modules.") and not any(+ mod_name == p or mod_name.startswith(p + ".") for p in _protected_core_modules+ ):sys.modules.pop(mod_name, None)importlib.invalidate_caches()