Skip to content

Commit

Permalink
Fix release (#1456)
Browse files Browse the repository at this point in the history
* Fix a bug with pinfo call

* Update version

* add pinfo to dependency for plasojob
  • Loading branch information
jleaniz committed Mar 13, 2024
1 parent e102b06 commit f98c58d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
22 changes: 14 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "turbinia"
version = "20240311"
version = "20240313"
description = "Automation and Scaling of Digital Forensics Tools"
authors = ["Turbinia Developers <[email protected]>"]
maintainers = ["Turbinia Developers <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion turbinia/config/turbinia_config_tmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
'timeout': 1200
}, {
'job': 'PlasoJob',
'programs': ['log2timeline'],
'programs': ['log2timeline', 'pinfo'],
'docker_image': None,
'timeout': 86400
}, {
Expand Down
10 changes: 5 additions & 5 deletions turbinia/evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ def _validate(self):
TurbiniaException: if validation fails.
"""
cmd = [
'pinfo.py',
'pinfo',
'--output-format',
'json',
'--sections',
Expand All @@ -1068,19 +1068,19 @@ def _validate(self):
total_file_events = 0

try:
log.info(f'Running pinfo.py to validate PlasoFile {self.local_path}')
log.info(f'Running pinfo to validate PlasoFile {self.local_path}')
command = subprocess.run(cmd, capture_output=True, check=True)
storage_counters_json = command.stdout.decode('utf-8').strip()
# pinfo.py might print warnings so we only need to last line of output
storage_counters_json = storage_counters_json.splitlines()[-1]
storage_counters = json.loads(storage_counters_json)
total_file_events = storage_counters.get('storage_counters', {}).get(
'parsers', {}).get('total', 0)
log.info(f'pinfo.py found {total_file_events} events.')
log.info(f'pinfo found {total_file_events} events.')
if not total_file_events:
raise TurbiniaException(
'PlasoFile validation failed, pinfo.py found no events.')
except subprocess.CalledProcessError as exception:
'PlasoFile validation failed, pinfo found no events.')
except (subprocess.CalledProcessError, FileNotFoundError) as exception:
raise TurbiniaException(
f'Error validating plaso file: {exception!s}') from exception
except json.decoder.JSONDecodeError as exception:
Expand Down

0 comments on commit f98c58d

Please sign in to comment.