-
Notifications
You must be signed in to change notification settings - Fork 71
Improve robustness of Sophos plugin #1083
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
Schamper
left a comment
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.
Can you describe what is fixed in the PR description and add a unit test?
| _target=self.target, | ||
| ) | ||
| except Exception as error: | ||
| self.target.log.warning(f"Error: {error} on log line: {line}.") |
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.
| self.target.log.warning(f"Error: {error} on log line: {line}.") | |
| self.target.log.warning("Error: {error} on log line: {line}.") |
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.
That results in the following linting error:
dissect/target/plugins/apps/av/sophos.py:127:21: F841 local variable 'error' is assigned to but never used
Should I leave the format string?
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.
Make it a proper logging format string using %s and passing error as argument.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1083 +/- ##
=======================================
Coverage 79.26% 79.26%
=======================================
Files 348 348
Lines 31127 31133 +6
=======================================
+ Hits 24673 24679 +6
Misses 6454 6454
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Schamper
left a comment
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.
Can you fix the linter?
Add support for Sophos Home AV logs for version
3.9.4.1or earlier and verify if log files exist.