Skip to content

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

Merged
cwurm merged 1 commit intoelastic:6.8from
cwurm:backport_12028_6.8
May 15, 2019
Merged

[Auditbeat] Cherry-pick #12028 to 6.8: Login: Fix re-read of utmp files#12108
cwurm merged 1 commit intoelastic:6.8from
cwurm:backport_12028_6.8

Conversation

@cwurm
Copy link
Copy Markdown
Contributor

@cwurm cwurm commented May 8, 2019

Cherry-pick of PR #12028 to 6.8 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 changed the title Cherry-pick #12028 to 6.8: [Auditbeat] Login: Fix re-read of utmp files [Auditbeat] Cherry-pick #12028 to 6.8: Login: Fix re-read of utmp files May 8, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

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 force-pushed the backport_12028_6.8 branch from cff4da6 to 9720963 Compare May 15, 2019 04:39
@cwurm cwurm merged commit 1fa89cc into elastic:6.8 May 15, 2019
@cwurm cwurm deleted the backport_12028_6.8 branch May 15, 2019 14:15
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