Skip to content

Conversation

@Zawadidone
Copy link
Contributor

@Zawadidone Zawadidone commented Mar 31, 2025

Add support for Sophos Home AV logs for version 3.9.4.1 or earlier and verify if log files exist.

Copy link
Member

@Schamper Schamper left a 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?

@Zawadidone Zawadidone marked this pull request as ready for review April 8, 2025 08:24
@Zawadidone Zawadidone requested a review from Schamper April 8, 2025 08:24
_target=self.target,
)
except Exception as error:
self.target.log.warning(f"Error: {error} on log line: {line}.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.target.log.warning(f"Error: {error} on log line: {line}.")
self.target.log.warning("Error: {error} on log line: {line}.")

Copy link
Contributor Author

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?

Copy link
Member

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
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

Attention: Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.

Project coverage is 79.26%. Comparing base (ae72d52) to head (739e428).

Files with missing lines Patch % Lines
dissect/target/plugins/apps/av/sophos.py 84.61% 4 Missing ⚠️
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           
Flag Coverage Δ
unittests 79.26% <84.61%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@Schamper Schamper left a 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?

@Zawadidone Zawadidone requested a review from Schamper April 8, 2025 13:41
@Schamper Schamper changed the title Improve robustness Sophos plugin Improve robustness of Sophos plugin Apr 10, 2025
@Schamper Schamper merged commit 2ffb153 into fox-it:main Apr 10, 2025
20 of 23 checks passed
@Zawadidone Zawadidone deleted the fix/sophos_plugin branch April 10, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants