generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 28
feat(heuristics): add whitespace check to detect excessive spacing and invisible characters for malware check #1086
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
Open
AmineRaouane
wants to merge
16
commits into
oracle:main
Choose a base branch
from
AmineRaouane:white-spaces-heuristic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+51
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
art1f1c3R
reviewed
May 26, 2025
src/macaron/malware_analyzer/pypi_heuristics/sourcecode/white_spaces.py
Outdated
Show resolved
Hide resolved
…d invisible characters Signed-off-by: Amine <amine.raouane@enim.ac.ma>
Signed-off-by: Amine <amine.raouane@enim.ac.ma>
db0e35c
to
6978bd7
Compare
art1f1c3R
reviewed
Jun 2, 2025
art1f1c3R
reviewed
Jun 2, 2025
src/macaron/slsa_analyzer/checks/detect_malicious_metadata_check.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
Signed-off-by: Amine <amine.raouane@enim.ac.ma>
…ackages (oracle#965) Include support for using Semgrep for analysis of source code to detect malicious code patterns, specified using Semgrep's YAML files. Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
This PR allows Macaron to discover GitHub attestation. To retrieve these attestations, the SHA256 hash of the related artefact is required. Hashes are computed from local artefact files if available, or from downloaded ones otherwise. Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
…acle#1096) This PR replaces the Go shared library previously used via C-bindings in Python with a standalone binary for the cuevalidator component. The binary can now be invoked as a subprocess, simplifying integration and improving portability. Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
…e. (oracle#1102) The detail info containing inspector links now contains links as keys regardless of whether they are reachable, and includes a boolean value for reachability. Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
…torial (oracle#1101) Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
oracle#1097) Signed-off-by: Amine <amine.raouane@enim.ac.ma>
…d invisible characters Signed-off-by: Amine <amine.raouane@enim.ac.ma>
Signed-off-by: Amine <amine.raouane@enim.ac.ma>
Signed-off-by: Amine <amine.raouane@enim.ac.ma>
Signed-off-by: Amine <amine.raouane@enim.ac.ma>
art1f1c3R
reviewed
Jun 19, 2025
tests/malware_analyzer/pypi/resources/sourcecode_samples/obfuscation/inline_imports.py
Show resolved
Hide resolved
art1f1c3R
reviewed
Jun 19, 2025
art1f1c3R
reviewed
Jun 19, 2025
…tion threshold Signed-off-by: Amine <amine.raouane@enim.ac.ma>
art1f1c3R
approved these changes
Aug 8, 2025
The CI test seems to be failing due to detecting excessive whitespace in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new heuristic that analyzes code to detect suspicious use of excessive spaces and invisible characters. It checks whether the amount of spacing and invisible Unicode characters exceeds a defined threshold.
Description of changes
WhiteSpaces
heuristic in a new Python module.heuristics.py
file.WhiteSpacesAnalyzer
heuristic.detect_malicious_metadata_check.py
to integrate and execute the new heuristic logic during analysis.Related issues
None
Checklist
verified
label should appear next to all of your commits on GitHub.