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

Consolidate local target checks #416

Closed
wants to merge 44 commits into from

Conversation

ikretz
Copy link
Contributor

@ikretz ikretz commented Jul 15, 2024

This PR makes three principal changes:

  1. It defines functions in guarddog/utils/archives.py for checking whether a file extension is for a supported archive format and uses them pervasively

  2. It clarifies the conditions under which Guarddog will decide to perform a local scan on a target: whenever the target is a directory or a regular file in the local filesystem. It also eliminates as much as possible duplicate checking for whether the target is local and what kind of local target it is (file or directory)

  3. It makes sure that PackageScanner.scan_local() uses its callback argument, closing issue Unused callback function argument in PackageScanner #411

@ikretz ikretz changed the title Consolidate archive file extension checking Consolidate local target checks Jul 17, 2024
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)
@ikretz ikretz closed this Jul 17, 2024
@ikretz ikretz deleted the ikretz/fix/package-scanner-callback branch July 17, 2024 10:16
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.

2 participants