From 883cd6e278177bcafbffd6e16d75e28511db68b2 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Thu, 5 Feb 2026 16:14:41 +0100 Subject: [PATCH 1/3] Remove deprecated IIS module --- acquire/acquire.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/acquire/acquire.py b/acquire/acquire.py index c7f88b0d..02862393 100644 --- a/acquire/acquire.py +++ b/acquire/acquire.py @@ -867,20 +867,6 @@ def get_spec_additions(cls, target: Target, cli_args: argparse.Namespace) -> Ite yield ("glob", f"{log_path}/ERRORLOG*") -@register_module("--iis") -class IIS(Module): - DESC = "IIS logs" - - @classmethod - def get_spec_additions(cls, target: Target, cli_args: argparse.Namespace) -> Iterator[tuple]: - warnings.warn( - "--iis is deprecated in favor of --webserver-logs and will be removed in acquire 3.22", - DeprecationWarning, - stacklevel=2, - ) - return Webserver.get_spec_additions(cls, target, cli_args) - - @register_module("--webserver") class Webserver(Module): DESC = "Various webserver logs and configuration files" @@ -2193,7 +2179,7 @@ class WindowsProfile: QuarantinedFiles, WindowsNotifications, SSH, - IIS, + Webserver, SharePoint, TextEditor, Docker, From c225d07a93b17b3a5a34f2894b5e57dab890e53c Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Thu, 5 Feb 2026 16:15:35 +0100 Subject: [PATCH 2/3] Remove --file and --dir commandline options --- acquire/acquire.py | 6 ------ acquire/utils.py | 5 ----- 2 files changed, 11 deletions(-) diff --git a/acquire/acquire.py b/acquire/acquire.py index 02862393..c1e4c949 100644 --- a/acquire/acquire.py +++ b/acquire/acquire.py @@ -2374,12 +2374,6 @@ def main() -> None: log.info("Default Arguments: %s", " ".join(args.config.get("arguments"))) log.info("") - if any(arg in sys.argv for arg in ["--file", "--dir", "-f", "-d"]): - warnings.warn( - "--file and --dir are deprecated in favor of --path and will be removed in acquire 3.22", - DeprecationWarning, - stacklevel=2, - ) if "--proc-net" in sys.argv: warnings.warn( "--proc-net will be merged with --proc and will be removed in acquire 3.23", diff --git a/acquire/utils.py b/acquire/utils.py index 330cacb6..db49b11d 100644 --- a/acquire/utils.py +++ b/acquire/utils.py @@ -125,12 +125,7 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg parser.add_argument("-p", "--profile", choices=profiles.keys(), help="collection profile") parser.add_argument("--volatile-profile", choices=volatile.keys(), help="volatile profile") - # Keep `--file` and `--dir` (-f, and -d) temporarily parser.add_argument( - "-f", - "-d", - "--file", - "--dir", "--path", dest="path", action="append", From a0a2ec750cd634c1f793f7e6945311a8c20beefe Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Tue, 10 Feb 2026 12:15:09 +0100 Subject: [PATCH 3/3] Update deprecated entrypoint selector It doesnt function with the dict lookup anymore since python3.12, so updating it to be compatible --- acquire/uploaders/plugin_registry.py | 20 +++----------------- tests/test_plugin.py | 7 +++---- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/acquire/uploaders/plugin_registry.py b/acquire/uploaders/plugin_registry.py index c8d5817a..6de78145 100644 --- a/acquire/uploaders/plugin_registry.py +++ b/acquire/uploaders/plugin_registry.py @@ -59,30 +59,16 @@ def items(self) -> ItemsView[str, T]: def get(self, name: str) -> T: return self.plugins.get(name) - def _find_entrypoint_data(self, entry_point_name: str) -> list[metadata.EntryPoint]: - """Searches through the entrypoints to find specific entry_point names. - - Args: - entry_point_name: The name to search for. - - Returns: - A list with entry_points associated with that name.""" - try: - entrypoint_plugins = metadata.entry_points()[entry_point_name] - except KeyError: - entrypoint_plugins = [] - return entrypoint_plugins - - def load_entrypoint_plugins(self, name: str) -> None: + def load_entrypoint_plugins(self, group_name: str) -> None: """Loads all classes defined in the entrypoints that use the specified ``name``. Loads the class loaded from the entrypoint with the form: ``=:`` as Args: - name: The entrypoint to search for. + group_name: The entrypoint to search for. """ - class_plugins = self._find_entrypoint_data(name) + class_plugins = metadata.entry_points(group=group_name) for ep in class_plugins: try: diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 973f539b..f0e082bf 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -23,7 +23,7 @@ def test_registry_functionality_iterator() -> None: def test_registry_entrypoint() -> None: mocked_output = Mock() - with patch.object(PluginRegistry, "_find_entrypoint_data", return_value=[mocked_output]): + with patch(f"{PluginRegistry.__module__}.metadata.entry_points", return_value=[mocked_output]): data = PluginRegistry("") assert data.get(mocked_output.name) == mocked_output.load.return_value @@ -33,6 +33,5 @@ def test_registry_entrypoint_failed() -> None: mocked_output.load.side_effect = [ModuleNotFoundError] data = PluginRegistry("-") - with patch.object(PluginRegistry, "_find_entrypoint_data", return_value=[mocked_output]): - data.load_entrypoint_plugins("test") - assert len(data.items()) == 0 + data.load_entrypoint_plugins("test") + assert len(data.items()) == 0