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

Merged
merged 2 commits into from
Oct 31, 2024
Merged

Refactor AuthLogPlugin #860

merged 2 commits into from
Oct 31, 2024

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.47312% with 14 lines in your changes missing coverage. Please review.

Project coverage is 76.99%. Comparing base (041d41d) to head (8a2d499).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/plugins/os/unix/log/auth.py 92.47% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #860      +/-   ##
==========================================
+ Coverage   76.88%   76.99%   +0.10%     
==========================================
  Files         322      322              
  Lines       27408    27574     +166     
==========================================
+ Hits        21074    21230     +156     
- Misses       6334     6344      +10     
Flag Coverage Δ
unittests 76.99% <92.47%> (+0.10%) ⬆️

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 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
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.

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
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
@Poeloe Poeloe force-pushed the feature/refactor-authlog-plugin branch 2 times, most recently from 754a8aa to ba82ceb Compare October 29, 2024 11:35
@Poeloe Poeloe requested a review from Schamper October 29, 2024 14:13
@Poeloe Poeloe requested a review from Schamper October 30, 2024 08:05
@Poeloe Poeloe requested a review from Schamper October 30, 2024 15:21
Schamper
Schamper previously approved these changes Oct 30, 2024
@Miauwkeru Miauwkeru force-pushed the feature/refactor-authlog-plugin branch from 9411828 to 8a2d499 Compare October 31, 2024 13:42
@Poeloe Poeloe merged commit 6c5e601 into main Oct 31, 2024
18 of 20 checks passed
@Poeloe Poeloe deleted the feature/refactor-authlog-plugin branch October 31, 2024 14:12
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