chore: improve max download restrictions for malicious metadata tutorial #1188
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.
Summary
Changes the behaviour and way
max_download_sizeis accessed with respect to package source code analysis.Description of changes
This PR makes two main changes. It moves the
max_download_sizeconfiguration fromslsa.verifiertodownloadsindefaults.ini, and adds a new functioncan_download_filethat is used to check first if the source code of a package can be downloaded before acting upon this information. This is useful inDetectMaliciousMetadataCheck.analyze_sourceto ensure that aHeuristicAnalyzerValueErroris not raised, and a subsequentUNKNOWNresult is not returned if the file limit stops the source code from being downloaded.This PR also updates the tutorial documentation to describe the changes needed to ensure some larger packages are downloaded when analyzing the source code.
Checklist
verifiedlabel should appear next to all of your commits on GitHub.