From d806b154203a817f35976dfd9f0c6602b8984f67 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Mon, 17 Jul 2023 23:09:19 -0400 Subject: [PATCH] Changes for image export #4708 (#4710) --- plaso/cli/image_export_tool.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plaso/cli/image_export_tool.py b/plaso/cli/image_export_tool.py index c08315e81e..1530c2cf0a 100644 --- a/plaso/cli/image_export_tool.py +++ b/plaso/cli/image_export_tool.py @@ -25,6 +25,7 @@ from plaso.lib import errors from plaso.lib import loggers from plaso.lib import specification +from plaso.storage.fake import writer as fake_writer class ImageExportTool(storage_media_tool.StorageMediaTool): @@ -317,6 +318,9 @@ def _Extract( extraction_engine.BuildArtifactsRegistry( artifact_definitions_path, custom_artifacts_path) + storage_writer = fake_writer.FakeStorageWriter() + storage_writer.Open() + # If the source is a directory or a storage media image run pre-processing. system_configurations = [] @@ -327,7 +331,7 @@ def _Extract( # Setting storage writer to None here since we do not want to store # preprocessing information. system_configurations = extraction_engine.PreprocessSource( - self._file_system_path_specs, None, + self._file_system_path_specs, storage_writer, resolver_context=self._resolver_context) logger.debug('Preprocessing done.') @@ -340,7 +344,7 @@ def _Extract( environment_variables = ( extraction_engine.knowledge_base.GetEnvironmentVariables()) - user_accounts = [] + user_accounts = list(storage_writer.GetAttributeContainers('user_account')) try: extraction_engine.BuildCollectionFilters(