Skip to content
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

Refactor AuthLogPlugin #860

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

Poeloe
Copy link
Contributor

@Poeloe Poeloe commented Sep 20, 2024

Fixes #286

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 92.67016% with 14 lines in your changes missing coverage. Please review.

Project coverage is 76.76%. Comparing base (c5bf1ed) to head (9a5eef1).
Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/plugins/os/unix/log/auth.py 92.67% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #860      +/-   ##
==========================================
+ Coverage   75.59%   76.76%   +1.17%     
==========================================
  Files         311      316       +5     
  Lines       26561    27272     +711     
==========================================
+ Hits        20078    20935     +857     
+ Misses       6483     6337     -146     
Flag Coverage Δ
unittests 76.76% <92.67%> (+1.17%) ⬆️

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.

@Poeloe Poeloe force-pushed the feature/refactor-authlog-plugin branch from 66638fe to d5273dc Compare September 20, 2024 08:16
@Poeloe
Copy link
Contributor Author

Poeloe commented Sep 20, 2024

Small elaboration:

Went for an approach where each record will always contain:

  • ts
  • source
  • service
  • pid
  • message
  • _target

I then try to parse additional fields within the message based on the service that created the log line (where pam_unix is an exception).
This parsing is on a "best effort" basis. So if it fails or does not find any additional fields, the record would always still contain the above fields. Next to that, the additional fields are added dynamically to the record.

@Poeloe Poeloe force-pushed the feature/refactor-authlog-plugin branch 4 times, most recently from 284df3c to 13e8670 Compare September 20, 2024 12:16
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
tests/plugins/os/unix/log/test_auth.py Outdated Show resolved Hide resolved
tests/plugins/os/unix/log/test_auth.py Outdated Show resolved Hide resolved
@Poeloe Poeloe force-pushed the feature/refactor-authlog-plugin branch from e5f6a0e to 2d7e28e Compare September 27, 2024 13:12
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/log/auth.py Outdated Show resolved Hide resolved
@JSCU-CNI
Copy link
Contributor

JSCU-CNI commented Oct 17, 2024

When this PR is ready to be merged in main, could you fast-forward merge two commits instead of squashing everything in one commit? That should keep the git-blame correct for #901.

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.

Auth Log format update on rfc5424
3 participants