Skip to content

Commit ac7ff68

Browse files
authored
chore: add CLOSER_RELEASE_JOIN_DATE heuristic as a dependency of SUSPICIOUS_SETUP (#810)
This PR adds the CLOSER_RELEASE_JOIN_DATE heuristic as a dependency of SUSPICIOUS_SETUP to avoid running SUSPICIOUS_SETUP analyzer unnecessarily and improve performance. Signed-off-by: behnazh-w <[email protected]>
1 parent e9ced10 commit ac7ff68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/macaron/malware_analyzer/pypi_heuristics/sourcecode/suspicious_setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ class SuspiciousSetupAnalyzer(BaseHeuristicAnalyzer):
2626
"""Analyzer checks heuristic."""
2727

2828
def __init__(self) -> None:
29-
super().__init__(name="suspicious_setup_analyzer", heuristic=Heuristics.SUSPICIOUS_SETUP, depends_on=None)
29+
super().__init__(
30+
name="suspicious_setup_analyzer",
31+
heuristic=Heuristics.SUSPICIOUS_SETUP,
32+
depends_on=[(Heuristics.CLOSER_RELEASE_JOIN_DATE, HeuristicResult.FAIL)],
33+
)
3034
self.blacklist: list = ["base64", "request"]
3135

3236
def _get_setup_source_code(self, pypi_package_json: PyPIPackageJsonAsset) -> str | None:

0 commit comments

Comments
 (0)