Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

fix(updater): ignore non-module helper files from attack module catalog and silence migration logs

Mafifrizi0799e1037252
diff --git a/alembic.ini b/alembic.ini
index 2550b51..d9bf510 100644
--- a/alembic.ini
+++ b/alembic.ini
@@ -22,7 +22,7 @@ handlers =
qualname = sqlalchemy.engine
[logger_alembic]
-level = INFO
+level = WARN
handlers =
qualname = alembic
diff --git a/ares/cli/typer_main.py b/ares/cli/typer_main.py
index aa78e95..9a9734a 100644
--- a/ares/cli/typer_main.py
+++ b/ares/cli/typer_main.py
@@ -37,11 +37,15 @@ import uuid
import webbrowser
from collections.abc import Callable
from pathlib import Path
+import warnings
from typing import Any, Optional
from urllib import error as urllib_error
from urllib import parse as urllib_parse
from urllib import request as urllib_request
+warnings.filterwarnings("ignore", category=DeprecationWarning)
+warnings.filterwarnings("ignore", message=".*authlib.*")
+
import typer
from rich import box
from rich import print as rprint
diff --git a/ares/core/sso.py b/ares/core/sso.py
index ed42d6b..119577d 100644
--- a/ares/core/sso.py
+++ b/ares/core/sso.py
@@ -13,7 +13,11 @@ from typing import Any, Mapping
from urllib.parse import urlencode
import httpx
+import warnings
+from authlib.deprecate import AuthlibDeprecationWarning
+warnings.filterwarnings("ignore", category=AuthlibDeprecationWarning)
from authlib.jose import JsonWebKey, jwt as authlib_jwt
+
from onelogin.saml2.auth import OneLogin_Saml2_Auth
from onelogin.saml2.settings import OneLogin_Saml2_Settings
diff --git a/ares/core/updater.py b/ares/core/updater.py
index c643994..3996e1f 100644
--- a/ares/core/updater.py
+++ b/ares/core/updater.py
@@ -51,6 +51,17 @@ ALLOWED_DOMAINS = frozenset({
"codeload.github.com",
})
+# Internal module helper files that are not standalone attack modules
+MODULE_HELPER_FILES: frozenset[str] = frozenset({
+ "base.py",
+ "descriptors.py",
+ "params.py",
+ "sdk.py",
+ "ad/dependencies.py",
+ "ai/plan_validator.py",
+ "reporting/report_gen.py",
+})
+
# Resource quotas and safety limits
MAX_MODULE_FILE_SIZE = 5 * 1024 * 1024 # 5 MB
MAX_UI_BUNDLE_SIZE = 150 * 1024 * 1024 # 150 MB
@@ -398,7 +409,12 @@ class PlatformUpdateManager:
rel_mod_path = path_str[len("ares/modules/"):]
filename = Path(rel_mod_path).name
- if filename.startswith("_") or filename == "base.py" or not filename.endswith(".py"):
+ if (
+ filename.startswith("_")
+ or not filename.endswith(".py")
+ or rel_mod_path in MODULE_HELPER_FILES
+ or filename in {"base.py", "descriptors.py", "params.py", "sdk.py"}
+ ):
continue
remote_module_count += 1
@@ -957,10 +973,12 @@ class PlatformUpdateManager:
)
try:
+ import logging
from types import SimpleNamespace
from alembic import command as alembic_cmd
from alembic.config import Config as AlembicConfig
+ logging.getLogger("alembic").setLevel(logging.ERROR)
alembic_cfg = AlembicConfig(str(alembic_ini))
if custom_db:
alembic_cfg.cmd_opts = SimpleNamespace(x=[f"db_url={custom_db}"])