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

[Auditbeat] Cherry-pick #12028 to 7.1: Login: Fix re-read of utmp files #12104

Merged
merged 1 commit into from
May 15, 2019

Conversation

cwurm
Copy link
Contributor

@cwurm cwurm commented May 8, 2019

Cherry-pick of PR #12028 to 7.1 branch. Original message:

The login dataset is not using the previous file offset when reading new entries in a utmp file. As a result, whenever a new login event occurs, all records are re-read.

The fix for this is one line in utmp.go (utmpFile.Offset = savedUtmpFile.Offset).

I also took the opportunity to expand the documentation, move our test files to testdata/, and write a test case that adds a utmp record to the test file and re-reads it to make sure this bug does not happen again.

@cwurm cwurm requested a review from a team as a code owner May 8, 2019 18:50
@cwurm cwurm changed the title Cherry-pick #12028 to 7.1: [Auditbeat] Login: Fix re-read of utmp files [Auditbeat] Cherry-pick #12028 to 7.1: Login: Fix re-read of utmp files May 8, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/secops

The `login` dataset is not using the previous file offset when reading new entries in a utmp file. As a result, whenever a new login event occurs, all records are re-read.

Also expands the documentation, moves test files to testdata/, and adds a test case that adds a utmp record to the test file and re-reads it to make sure this bug does not happen again.

(cherry picked from commit 683f4f7)
@cwurm cwurm merged commit 047784e into elastic:7.1 May 15, 2019
@cwurm cwurm deleted the backport_12028_7.1 branch May 15, 2019 15:20
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…tmp files (elastic#12104)

The `login` dataset is not using the previous file offset when reading new entries in a utmp file. As a result, whenever a new login event occurs, all records are re-read.

Also expands the documentation, moves test files to testdata/, and adds a test case that adds a utmp record to the test file and re-reads it to make sure this bug does not happen again.

(cherry picked from commit 6978629)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants