mirror of
https://github.com/mvt-project/mvt.git
synced 2026-10-19 14:07:23 +02:00
Preserve relative path indicator matches for iOS artifacts
This commit is contained in:
1 parent
e9f868a71a
commit
215b460a2e
2 files changed
+6
-1
No files matched your search
@@ -43,4 +43,5 @@ def check_ios_path(indicators: Indicators, path: str) -> Optional[IndicatorMatch
|
||||
match = indicators.check_file_path(candidate)
|
||||
if match:
|
||||
return match
|
||||
return None
|
||||
# Filesystem records and existing indicators may both use relative paths.
|
||||
return indicators.check_file_path(posixpath.normpath(path.replace("\\", "/")))
|
||||
@@ -187,6 +187,10 @@ def test_path_only_alert_is_medium():
|
||||
("/var/tmp/ioslab_ctl", "private\\var\\tmp\\ioslab_ctl", True),
|
||||
("/var/tmp/ioslab_ctl", "/var/tmp/ioslab_ctl2", False),
|
||||
("/private/var/tmp/.ghost_upper/", "/var/tmp/.ghost_upper-copy/file", False),
|
||||
("matched/directory", "matched/directory/file", True),
|
||||
("matched/directory", "matched\\directory\\file", True),
|
||||
("matched/directory", "matched/directory-copy/file", False),
|
||||
("matched/directory", "matched/directory/../other/file", False),
|
||||
],
|
||||
)
|
||||
def test_ios_path_iocs_respect_aliases_and_boundaries(ioc, path, expected):
|
||||
|
||||
Reference in new issue
Block a user