Fix alert-exceeds-max feature for files > 2GB and < max-filesize#1032
Merged
val-ms merged 1 commit intoCisco-Talos:mainfrom Oct 19, 2023
Merged
Fix alert-exceeds-max feature for files > 2GB and < max-filesize#1032val-ms merged 1 commit intoCisco-Talos:mainfrom
val-ms merged 1 commit intoCisco-Talos:mainfrom
Conversation
The --alert-exceeds-max feature should alert for all files larger than 2GB because 2GB is the internal limit for individual files. This isn't working correctly because the `goto done;` exit condition after recording the exceeds-max heuristic skips over the logic that reports the alert. This fix moves the ">2GB" check up to the location where the max-filesize engine option is set by clamd or clamscan. If max-filesize > 2GB - 1 is requested, then max-filesize is set to 2GB - 1. Additionally, a warning is printed if max-filesize > 2GB is requested (with an exception for when it's maxed out by setting --max-filesize=0). Resolves: Cisco-Talos#1030
Contributor
Author
|
Note: I'm actually a little bit on the fence about the warning when setting max-filesize > 2GB. I expect it will draw a lot of attention. However, a lot of people mistakenly think the limit is 4GB or even unlimited because there is presently no warning. |
Contributor
I like having a warning that a file is not being scanned due to a size limit, so that the user is aware. |
ragusaa
approved these changes
Sep 27, 2023
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
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.
The --alert-exceeds-max feature should alert for all files larger than 2GB because 2GB is the internal limit for individual files. This isn't working correctly because the
goto done;exit condition after recording the exceeds-max heuristic skips over the logic that reports the alert.This fix moves the ">2GB" check up to the location where the max-filesize engine option is set by clamd or clamscan. If max-filesize > 2GB - 1 is requested, then max-filesize is set to 2GB - 1.
Additionally, a warning is printed if max-filesize > 2GB is requested (with an exception for when it's maxed out by setting --max-filesize=0).
Resolves: #1030