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

Adding support for running YARA as sourcecode rules #401

Merged
merged 32 commits into from
Jul 17, 2024

Conversation

sobregosodd
Copy link
Contributor

@sobregosodd sobregosodd commented Jun 28, 2024

This feature aims to provide support for running YARA rules also as sourcecode detection.
What it does:

  • Import and compile all .yar files placed in guarddog/analyzer/sourcecode/ directory
  • Includes yara-python package and makes use of the binding to run selected rules to all files.

Another tasks addressed by this PR:

  • Re-add safari output tests cases
  • Remove (or heavily reduce) code hardcoded for ecosystem
    • Refactor of SOURCECODE_RULES to hold generic rule type and ecosystem objects
    • Remove click CLI ecosystem dependant and repeatable code

@sobregosodd sobregosodd marked this pull request as ready for review July 11, 2024 13:07
wcmatch==8.4.1 ; python_version >= "3.10" and python_version < "4" \
--hash=sha256:3476cd107aba7b25ba1d59406938a47dc7eec6cfd0ad09ff77193f21a964dee7 \
--hash=sha256:b1f042a899ea4c458b7321da1b5e3331e3e0ec781583434de1301946ceadb943
wcwidth==0.2.6 ; python_version >= "3.10" and python_version < "4" \
--hash=sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e \
--hash=sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0
yara-python==4.5.1 ; python_version >= "3.10" and python_version < "4" \

Check warning

Code scanning / GuardDog-pypi

GuardDog rule: single_python_file Warning

This package has 1 or fewer Python source files
@@ -367,6 +367,9 @@
--hash=sha256:c05b847200ae72200e47c30d0b11d6f130a88e2f7b83b75751fd3a3344fd3168 \
--hash=sha256:c0c90e645bd1e870414efbbc997443176b3432aa7f2e48551f623edac2086bde \
--hash=sha256:fbbc043c155e153be837fdf208063f3d7748934077968bc20b21efed502a2d6d
setuptools==70.3.0 ; python_version >= "3.10" and python_version < "4" \

Check warning

Code scanning / GuardDog-pypi

GuardDog rule: bundled_binary Warning

Binary file/s detected in package:
3471b6140eadc6412277dbbefe3fef8c345a0f1a59776086b80a3618c3a83e3b: gui-64.exe (exe)
32acc1bc543116cbe2cff10cb867772df2f254ff2634c870aef0b46c4b696fdb: cli-32.exe (exe), cli.exe (exe)
b9a7d08da880dfac8bcf548eba4b06fb59b6f09b17d33148a0f6618328926c61: cli-arm64.exe (exe)
e694f4743405c8b5926ff457db6fe7f1a12dec7c16a9c3864784d3f4e07ae097: gui-arm64.exe (exe)
85dae1e95d77845f2cb59bcac3d4afe74bbe4c91a9bcc5bf4a71cd43104dbe7c: gui-32.exe (exe), gui.exe (exe)
bbb3de5707629e6a60a0c238cd477b28f07f0066982fda953fa6fcec39073a4a: cli-64.exe (exe)
guarddog/cli.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ikretz ikretz left a comment

Choose a reason for hiding this comment

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

Really cool! Just a few optional observations here and there, nothing major.

@sobregosodd sobregosodd merged commit b228c66 into main Jul 17, 2024
10 checks passed
@sobregosodd sobregosodd deleted the s.obregoso/feat_yara branch July 17, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants