Skip to content

Commit

Permalink
Handle when the AnalysisAbortedException is raised by a MACO extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed Feb 1, 2025
1 parent d87c913 commit b17956b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions configextractor/frameworks/maco.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from maco.model import ExtractorModel
from maco.utils import MACO_YARA_RULE, Base64Decoder, maco_extractor_validation
from maco.utils import VENV_SCRIPT as MACO_VENV_SCRIPT
from maco.exceptions import AnalysisAbortedException

from configextractor.frameworks.base import Extractor, Framework

Expand Down Expand Up @@ -33,6 +34,11 @@ def run(self, sample_path: str, parsers: Dict[Extractor, List[str]]) -> List[dic
if r:
result.update({"config": r.dict(exclude_defaults=True, exclude_none=True)})

except AnalysisAbortedException:
# Extractor voluntarily aborted extraction
# This is the equivalent of the sample being invalid for the extractor
continue

except Exception as e:
# Add exception to results
result["exception"] = str(e)
Expand Down

0 comments on commit b17956b

Please sign in to comment.