Skip to content

Commit 4f3e72c

Browse files
committed
Changes to store source configuration #2287
1 parent 155f02a commit 4f3e72c

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

plaso/cli/extraction_tool.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,18 +493,15 @@ def _ProcessSources(self, session, storage_writer):
493493
path_spec=path_spec)
494494
source_configurations.append(source_configuration)
495495

496+
# TODO: check if source configuration for the path_spec already exists.
497+
storage_writer.AddAttributeContainer(source_configuration)
498+
496499
# TODO: improve to detect more than 1 system configurations.
497500
# TODO: improve to add volumes to system configuration.
498501
system_configuration = (
499502
extraction_engine.knowledge_base.GetSystemConfigurationArtifact())
500503
storage_writer.AddAttributeContainer(system_configuration)
501504

502-
source_configurations = []
503-
for path_spec in self._source_path_specs:
504-
source_configuration = artifacts.SourceConfigurationArtifact(
505-
path_spec=path_spec)
506-
source_configurations.append(source_configuration)
507-
508505
status_update_callback = (
509506
self._status_view.GetExtractionStatusUpdateCallback())
510507

plaso/containers/artifacts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,10 @@ class SourceConfigurationArtifact(ArtifactAttributeContainer):
445445

446446
CONTAINER_TYPE = 'source_configuration'
447447

448+
SCHEMA = {
449+
'mount_path': 'str',
450+
'path_spec': 'dfvfs.PathSpec'}
451+
448452
def __init__(self, path_spec=None):
449453
"""Initializes a source configuration artifact.
450454

plaso/storage/sqlite/sqlite_file.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ class SQLiteStorageFile(interface.BaseStore):
110110
'hostname',
111111
'mount_point',
112112
'operating_system',
113-
'path',
114-
'source_configuration')
113+
'path')
115114

116115
# Container types that are referenced from other container types.
117116
_REFERENCED_CONTAINER_TYPES = (

0 commit comments

Comments
 (0)