Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a new setup.py related heuristic in the pypi malware analyzer #932

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

art1f1c3R
Copy link
Member

@art1f1c3R art1f1c3R commented Dec 2, 2024

A new heuristic has been added to the PyPI package malware analyzer heuristics that checks if the specified package and version is available as a wheel (.whl) file. The rationale behind this is that, if a malicious package has a suspicious setup file (setup.py), then it will omit a wheel file in the package so that when installed, the setup file will be run automatically. This new heuristic passes if there is a wheel file available, and fails if there is not. It has been added to the suspicious combinations (SUSPICIOUS_COMBO) such that, when the suspicious setup heuristic fails, this heuristic must fail. When the suspicious setup heuristic passes, this heuristic is indifferent and has no effect.
New files added to the project are:

  • src/macaron/malware_analyzer/pypi_heuristics/metadata/wheel_absence.py: the new heuristic and its analyze functionality

  • tests/malware_analyzer/pypi/test_wheel_absence.py: a test file for the new heuristic.

This PR was previously approved as #930, but there were issues with commit signing, so a new branch and PR has been created to resolve those issues.

… in the pypi malware analyzer, which checks for whether a wheel file is available with the package.

Signed-off-by: Carl Flottmann <[email protected]>
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 2, 2024
Copy link
Member

@behnazh-w behnazh-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changeset was reviewed earlier in this PR and had to be recreated due to a commit signing issue.

@art1f1c3R art1f1c3R merged commit d4294d5 into staging Dec 2, 2024
10 checks passed
@art1f1c3R art1f1c3R deleted the art1f1c3R/download-file-presence-sign branch December 2, 2024 23:19
@art1f1c3R art1f1c3R self-assigned this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants