-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Harden system/package parsing of deb size #17188
Conversation
Deb packages report their installed size in a field, Installed-Size, which is an integer interpreted as KiB. Some unoficial packages are adding a unit at the end of this field: Installed-Size: 65M Dpkg/Apt ignore everything after the number. Auditbeat is currently failing to parse the list of packages once this mistake is reached. This updates the dataset to: - Do not fail when installed size can't be parsed. - Understand prefixes k/K, m/M and G/b. Fixes elastic#16661
Pinging @elastic/siem (Team:SIEM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It is probably overkill in this case but we could look at https://godoc.org/github.com/dustin/go-humanize if we have more cases to worry about.
Thanks for the suggestion @leehinman. I didn't use it because I couldn't find a way to make it parse as KiB by default. |
* Harden system/package parsing of deb size Deb packages report their installed size in a field, Installed-Size, which is an integer interpreted as KiB. Some unofficial packages are adding a unit at the end of this field: Installed-Size: 65M System tools dpkg/apt ignore everything after the number. Auditbeat is currently failing to parse the list of installed packages once this mistake is reached. This updates the dataset to: - Do not fail when installed size can't be parsed. - Understand prefixes k/K, m/M and G/b. Fixes elastic#16661 (cherry picked from commit b131405)
* Harden system/package parsing of deb size Deb packages report their installed size in a field, Installed-Size, which is an integer interpreted as KiB. Some unofficial packages are adding a unit at the end of this field: Installed-Size: 65M System tools dpkg/apt ignore everything after the number. Auditbeat is currently failing to parse the list of installed packages once this mistake is reached. This updates the dataset to: - Do not fail when installed size can't be parsed. - Understand prefixes k/K, m/M and G/b. Fixes #16661 (cherry picked from commit b131405)
* Harden system/package parsing of deb size Deb packages report their installed size in a field, Installed-Size, which is an integer interpreted as KiB. Some unofficial packages are adding a unit at the end of this field: Installed-Size: 65M System tools dpkg/apt ignore everything after the number. Auditbeat is currently failing to parse the list of installed packages once this mistake is reached. This updates the dataset to: - Do not fail when installed size can't be parsed. - Understand prefixes k/K, m/M and G/b. Fixes elastic#16661 (cherry picked from commit b131405)
…17230) Deb packages report their installed size in a field, Installed-Size, which is an integer interpreted as KiB. Some unofficial packages are adding a unit at the end of this field: Installed-Size: 65M System tools dpkg/apt ignore everything after the number. Auditbeat is currently failing to parse the list of installed packages once this mistake is reached. This updates the dataset to: - Do not fail when installed size can't be parsed. - Understand prefixes k/K, m/M and G/b. Fixes #16661 (cherry picked from commit b131405)
What does this PR do?
Fixes system/package dataset parsing of Deb package's
Installed-Size
field in order to:Why is it important?
Deb packages report their installed size in a field,
Installed-Size
, which is an integer interpreted as KiB. Some rare third-party packages are adding a unit at the end of this field, by mistake:System tools dpkg/apt ignore everything after the number. However, Auditbeat is currently failing to parse the list of packages once this malformed field is reached.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesHow to test this PR locally
To generate a package with a malformed
Installed-Size
:Related issues
Fixes #16661
Logs