-
Notifications
You must be signed in to change notification settings - Fork 1
Outsource scan actions #244
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the handling of malicious file scan results by moving the quarantine and prefix setting logic from the tagFile method in VerdictService to the actual scan callers. This separation of concerns ensures that file actions are properly executed in all scan contexts.
Key changes:
- Removed quarantine logic from the
tagFilemethod inVerdictService - Added malicious file handling logic to scan callers (
ScanService,ScanController,FileEventsListener) - Enhanced error handling and logging for failed quarantine operations
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/Service/VerdictService.php | Removed quarantine and prefix setting logic from tagFile method |
| lib/Service/ScanService.php | Added malicious file handling with quarantine and prefix setting |
| lib/Controller/ScanController.php | Added malicious file handling with quarantine and prefix setting |
| lib/EventListener/FileEventsListener.php | Enhanced error handling with fallback quarantine logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
25886d9 to
3d1e0cb
Compare
…is not just tagging and caused a bug in the event handler where the quarantine was created empty.
3d1e0cb to
3358883
Compare
* fix: correct syntax error in ScanService.php for constant declaration for PHP < 8.3 (#227) * chore(deps): update dependency webpack-dev-server to v5.2.2 (#225) Co-authored-by: Renovate Bot <[email protected]> * chore(deps): update all non-major dependencies (#231) Co-authored-by: Renovate Bot <[email protected]> * chore(deps): update dependency psalm/phar to v6.13.0 (#232) Co-authored-by: Renovate Bot <[email protected]> * chore(deps): update all non-major dependencies (#233) Co-authored-by: Renovate Bot <[email protected]> * Add a quicker way for development with a local Nextcloud server and the app code changeable inside this server (#234) * Add Nextclouds worklfow templates and apply Nextcloud coding style (#235) * Add maximum scan size setting for file uploads (#236) * Devcontainer and Workflow Performance (#237) - Faster local development in devcontainer - Add Make stages for local fast developing as well as unit and bats tests - Remove unmaintained files from old debugging sessions` - Cleanup unused files and bundle utility scripts * Settings improvements (#238) - Add button to test current vaas configuration - Rename app settings to be more intuitive * Add additional settings (#239) - Control scan timeout - Control usage of cache - Control usage of hash lookup * Refactor logging messages and remove redundant debug statements (#240) * Update README with development environment setup instructions (#241) * Remove unused settings (#242) - Malicious file notifications summary - Scan only new files * Add make target for production like local setup (#243) * Outsource file scan actions (#244) --------- Co-authored-by: vaas-bot <[email protected]> Co-authored-by: Renovate Bot <[email protected]>
* fix: correct syntax error in ScanService.php for constant declaration for PHP < 8.3 (#227) * Add a quicker way for development with a local Nextcloud server and the app code changeable inside this server (#234) * Add Nextclouds worklfow templates and apply Nextcloud coding style (#235) * Add maximum scan size setting for file uploads (#236) * Devcontainer and Workflow Performance (#237) - Faster local development in devcontainer - Add Make stages for local fast developing as well as unit and bats tests - Remove unmaintained files from old debugging sessions` - Cleanup unused files and bundle utility scripts * Settings improvements (#238) - Add button to test current vaas configuration - Rename app settings to be more intuitive * Add additional settings (#239) - Control scan timeout - Control usage of cache - Control usage of hash lookup * Refactor logging messages and remove redundant debug statements (#240) * Update README with development environment setup instructions (#241) * Remove unused settings (#242) - Malicious file notifications summary - Scan only new files * Add make target for production like local setup (#243) * Outsource file scan actions (#244)
Outsource the consequences of a file scan from tag function, as this is not just tagging and caused a bug in the event handler where the quarantine was created empty.