Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
15 changes: 10 additions & 5 deletions .github/workflows/fastir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ jobs:
draft: false
build:
runs-on: ${{ matrix.os }}
needs: release
strategy:
matrix:
os: [windows-2019]
python-version: ['3.10']
python-version: ['3.11']
arch: [x86, x64]
include:
- os: ubuntu-latest
arch: x64
python-version: '3.10'
python-version: '3.11'
- os: macos-latest
arch: x64
python-version: '3.10'
python-version: '3.11'
steps:
- name: Use FastIR repository
uses: actions/checkout@v3
Expand All @@ -66,10 +65,16 @@ jobs:
run: |
python -m pytest --cov-report xml --cov fastir tests
pyinstaller fastir_artifacts.spec
- name: run tests on build
- name: run tests & zip
run: |
python -m pytest integration_tests
python -m zipfile -c FastIR-Artifacts-${{ runner.os }}-${{ matrix.arch }}.zip dist/fastir_artifacts
- name: Archive build results
uses: actions/upload-artifact@v3
if: github.event_name == 'push' && !contains(github.ref, 'master')
with:
name: FastIR-Artifacts-${{ runner.os }}-${{ matrix.arch }}
path: FastIR-Artifacts-${{ runner.os }}-${{ matrix.arch }}.zip
- name: Upload asset
uses: AButler/upload-release-assets@v2.0
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
Expand Down
21 changes: 21 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
artifacts = "==20230928"
configargparse = "==1.7"
pywin32 = {version= "==306", sys_platform = "== 'win32'"}
pyyaml = "==6.0.1"
pytsk3 = "==20231007"
pyinstaller = "==6.1.0"
psutil = "==5.9.6"
jsonlines = "==4.0.0"
filetype = "==1.2.0"
pefile = "==2023.2.7"

[dev-packages]

[requires]
python_version = "3.11"
14 changes: 7 additions & 7 deletions fastir/common/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def __init__(self, manager, device, path):

# Cache parsed entries for better performances
self._entries_cache = {}
self._entries_cache_last = []

# Open drive
img_info = pytsk3.Img_Info(self._device)
Expand Down Expand Up @@ -135,18 +134,20 @@ def list_directory(self, path_object):
return self._entries_cache[path_object.path]
else:
# Make sure we do not keep more than 10 000 entries in the cache
if len(self._entries_cache_last) >= 10000:
first = self._entries_cache_last.pop(0)
del self._entries_cache[first]
if len(self._entries_cache) >= 10000:
self._entries_cache.pop(next(iter(self._entries_cache)))

entries = []
directory = path_object.obj

if not isinstance(directory, pytsk3.Directory):
if not self.is_directory(path_object):
return

directory = path_object.obj.as_directory()
try:
directory = path_object.obj.as_directory()
except Exception as err:
logger.error(f"Error collecting '{str(path_object.path)}': {err}")
return

for entry in directory:
if (
Expand Down Expand Up @@ -174,7 +175,6 @@ def list_directory(self, path_object):
entries.append(entry_path_object)

self._entries_cache[path_object.path] = entries
self._entries_cache_last.append(entries)

return entries

Expand Down
2 changes: 1 addition & 1 deletion fastir/common/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ def substitute(self, value):

if not values:
logger.warning(f"Value '{value}' contains unsupported variables")
values.add(value)
# values.add(value)

return values
2 changes: 1 addition & 1 deletion fastir_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def resolve_artifact_groups(registry, artifact_names):
resolved_names = set()

for artifact in artifact_names:
definition = registry.GetDefinitionByName(artifact)
definition = registry.GetDefinitionByAlias(artifact)

if definition:
resolved_names.add(artifact)
Expand Down
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest==7.1.0
pytest-cov==3.0.0
pytest==7.4.2
pytest-cov==4.1.0
20 changes: 10 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
git+https://github.com/ForensicArtifacts/artifacts.git@6b4753931aeb55f97a1838bdf582e4100ac2b3ee#egg=artifacts
ConfigArgParse==1.5.3
pypiwin32==223 ; sys_platform == 'win32'
PyYAML==6.0
pytsk3==20211111
PyInstaller==4.10
psutil==5.9.0
jsonlines==3.0.0
filetype==1.0.10
pefile==2021.9.3
artifacts==20230928
ConfigArgParse==1.7
pywin32==306; platform_system=='Windows'
PyYAML==6.0.1
pytsk3==20231007
PyInstaller==6.1.0
psutil==5.9.6
jsonlines==4.0.0
filetype==1.2.0
pefile==2023.2.7