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

Use AMSI for archive malware scanning #4910

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pl4nty
Copy link

@pl4nty pl4nty commented Oct 27, 2024

Replace pure with AMSI for archive malware scanning, to allow archive types other than zip. Added tests for tgz with archiveExtractionMethod tar and a stub for testing a large file. I tested with a 1GB compressed 7z and scanning took slightly under two minutes on a 4 core VM.

This was partially an experiment to see how Copilot Workspace handles C++/Windows, no worries if this feature isn't useful.


For more details, open the Copilot Workspace session.

Microsoft Reviewers: Open in CodeFlow

* Remove `#include <pure.h>` and add necessary includes for AMSI in `src/AppInstallerCommonCore/Archive.cpp`
* Initialize AMSI, create a session, scan the file, and handle results in `ScanZipFile` function
* Add tests for new archive formats in `src/AppInstallerCLITests/Archive.cpp`
  - Add test cases for 7z, Rar, TarGz, and TarBz2 archive formats
  - Verify extraction and scanning of these new archive formats

This comment has been minimized.

@pl4nty pl4nty marked this pull request as ready for review October 27, 2024 12:49
@pl4nty pl4nty requested a review from a team as a code owner October 27, 2024 12:49
@pl4nty pl4nty marked this pull request as draft October 27, 2024 12:50
@pl4nty pl4nty marked this pull request as ready for review November 4, 2024 09:44
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.

1 participant