-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement vectorscan support to improve malware scan performance #236
Comments
v4.0.1-rc1 Re-opening this case per a slack discussion between Alex and I. These issues only happen on an arm64 environment for me (aws ec2 instance, Try to run:
And I do not have the issue when I use The second issue as also in the same arm64 (aarch64) environment. If I include --compile-local I get a segfault:
You suggested to use gdb to get more details and you helped out by doing a back trace which outputted:
I just thought I'd record this here fore posterity. Thanks for looking into this! So far all testing on AMD64 looks good. |
v4.0.1-rc1 Details of a new issue found per our slack discussion below. I am getting different results for each vectorscan run: /tmp/BATS/wordfence malware-scan ~/qa/malware-sets-for-testing-cli/ -a --no-verbose (USES VECTORSCAN per INI FILE) |
v4.0.1-rc1 On my ARM64 (M2 chip) Mac Mini I'm also encountering a segfault -- I get it with pcre specifically in this case though - vectorscan actually works for me. I could not reproduce this on Linux including when I install via In this case I simply execute: and right after scanning file I will see the output halt in my terminal (but appear to still be running) and only when I remote into the machine (VNC) I see python crashed with the following long error report (attached due to length). I tried to compare against the other segfault I reported earlier on arm64 linux but it's not clear to me if its the same issue. For the segfault I mentioned earlier in this issue I triggered it via specific arguments passed including vectorscan match-engine -- this is pcre on this mac mini. Note that there is no traceback/etc useful info I have -- I just have this error report from the mac error reporting system. I am happy to assist further however if there is anything I can do to help in this case. The issue might be environmental but I don't think the issue is due to endpoint protection, etc on this system -- not from what I can see in logs and such. Error report: |
The architecture detection has been fixed and should work correctly for The seg fault on ARM64 appears to be an issue with the build of the library on Ubuntu, specifically. I've opened a case there, but for now there doesn't seem to be a workaround on our side, so this will not be addressed. The issue with inconsistent results when using vectorscan has been addressed as well. This was due to an issue with the ordering of the call to reset the vectorscan stream and the one to report results. These should be consistent now. The issue on MacOS/ARM64 also appears to be an internal issue with the PCRE library. To address it, I've added detection for crashed workers that will skip problematic files and start a new replacement worker rather than leaving the process hanging if a worker crashes. I don't see a reasonable solution or workaround for the internal issue with library at present, so skipping files that fail in this way is likely the best path forward at this point. |
v4.0.1rc2 5/8/24 SUMMARY: I can confirm I now have no issues with arm64 (AKA aarch64) with the exception of the Ubuntu bug Alex referenced (segfault when try to compile-local). Additionally I can confirm that the inconsistent results issue is now fixed and on my MacOS/ARM64 machine (Mac Mini) I am able to scan even if the worker(s) crash due to problematic files. I feel comfortable with releasing now that these issues have been resolved as well as the exit-code issues mentioned in case 244 and all regression/automation checks are green. |
We encountered an issue when attempting to build the pre-compiled vectorscan databases due to attempting to move a file across filesystems.
|
v4.0.1rc5 I think we should make We should also do this for the My apologies again -- this is something I should have picked up earlier and prior to marking the issue as qa-passed. We'll have to do another RC now if we want this change. |
v4.0.1rc6 I can confirm the new changes work as expected. When the vectorscan database needs to be compiled locally there is now a warning level message indicating no compatible pre-compiled signature set was found and that they will be compiled locally. Additionally on the info log level there is a notice now describing not just that the compilation is in progress but that it may take a substantial amount of time depending on the system performance. This is great as this should help to set expectations for users in the not too likely situation local compilation is necessary. I also did some tests among various environments and the slowest I saw was about a 45 min compilation time and fastest about 15 minutes -- I did this just based on my own curiosity -- your experience may vary. I also confirmed the INFO level message will show still if specify -- Once the pre-compiled vectorscan databases are ready for testing (everything all set server-side) I'll test this as well and ensure the warning and info messages no longer appear (note however they could in some cases a compatible vectorscan database isn't available). |
v4.0.1rc6 5/20/2024 All checks pass now - remaining checks involved testing pre-built vectorscan database on production. I tested in a few ARM64, AMD64 environments utilizing hyperscan5 and vectorscan5 and also in one MacOS environment. All checks/tests passed without issue in all environments and we're good to release! :) |
Allow optionally using vectorscan instead of PCRE for malware scanning when available.
https://github.com/VectorCamp/vectorscan
The text was updated successfully, but these errors were encountered: