[Auditbeat] Cherry-pick #10508 to 6.x: System module: Detect package updates#10562
Merged
cwurm merged 1 commit intoelastic:6.xfrom Feb 5, 2019
Merged
[Auditbeat] Cherry-pick #10508 to 6.x: System module: Detect package updates#10562cwurm merged 1 commit intoelastic:6.xfrom
cwurm merged 1 commit intoelastic:6.xfrom
Conversation
Detects package updates by checking if any of the "new" package objects have the same package name as one of the "old" package objects. The event will have `event.action: package_updated`. Also removes `InstallTime` from change detection. And for dpkg, reports packages as removed that have only been removed (`apt-get remove`) but not purged (`apt-get purge`). (cherry picked from commit 394d93d)
eece0ac to
aff9296
Compare
Contributor
|
Pinging @elastic/secops |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #10508 to 6.x branch. Original message:
Detects package updates by checking if any of the "new" package objects have the same package name as one of the "old" package objects. The event will have
event.action: package_updated.Also fixes two issues:
InstallTimefrom change detection. It is not set for dpkg, and for Homebrew it is currently the modification time of the package's directory. Atouchwill cause it to be reported as changed. I'm actually wondering if we should not set it for Homebrew at all. For change detection, we now rely onname,version,release(only set for RPM), andsize- all of which (hopefully) only change when the package has indeed changed.apt-get remove) but not purged (apt-get purge). Removed package stay around in/var/lib/dpkg/status, but with adeinstallstatus.As an urgent follow-up, we should add tests with sample files for at least:
/var/lib/dpkg/statusin various stages (no package, installed package, new version, deinstalled package). I wanted to add it here, but we'll need a way to pass the test files to the metricset, and at the moment there is no config value for it (but there probably should be). I didn't want to do that bigger change here./usr/local/Cellar/{pkg.Name}/INSTALL_RECEIPT.json(read since [Auditbeat] Read formula path from INSTALL_RECEIPT.json for Homebrew packages #10507), and a Ruby formula file.