mirror of
https://github.com/mvt-project/mvt.git
synced 2026-07-06 04:57:52 +02:00
Add packages module for androidqf (#506)
* Add Packages module for androidqf * Update test
This commit is contained in:
@@ -8,6 +8,8 @@ import os
|
||||
import pytest
|
||||
|
||||
from .artifacts.generate_stix import generate_test_stix_file
|
||||
import logging
|
||||
from mvt.common.indicators import Indicators
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
@@ -24,3 +26,31 @@ def clean_test_env(request, tmp_path_factory):
|
||||
del os.environ["MVT_STIX2"]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def indicators_factory(indicator_file):
|
||||
def f(
|
||||
domains=[],
|
||||
emails=[],
|
||||
file_names=[],
|
||||
processes=[],
|
||||
app_ids=[],
|
||||
android_property_names=[],
|
||||
files_sha256=[],
|
||||
):
|
||||
|
||||
ind = Indicators(log=logging.getLogger())
|
||||
ind.parse_stix2(indicator_file)
|
||||
|
||||
ind.ioc_collections[0]["domains"].extend(domains)
|
||||
ind.ioc_collections[0]["emails"].extend(emails)
|
||||
ind.ioc_collections[0]["file_names"].extend(file_names)
|
||||
ind.ioc_collections[0]["processes"].extend(processes)
|
||||
ind.ioc_collections[0]["app_ids"].extend(app_ids)
|
||||
ind.ioc_collections[0]["android_property_names"].extend(android_property_names)
|
||||
ind.ioc_collections[0]["files_sha256"].extend(files_sha256)
|
||||
|
||||
return ind
|
||||
|
||||
return f
|
||||
|
||||
Reference in New Issue
Block a user