forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 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
- Loading branch information
Showing
3 changed files
with
300 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
190 changes: 190 additions & 0 deletions
190
x-pack/auditbeat/module/system/package/testdata/dpkg-size/status
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
Package: libquadmath0 | ||
Status: install ok installed | ||
Priority: optional | ||
Section: libs | ||
Installed-Size: 269B | ||
Maintainer: Ubuntu Core developers <[email protected]> | ||
Architecture: amd64 | ||
Multi-Arch: same | ||
Source: gcc-8 | ||
Version: 8.3.0-26ubuntu1~18.04 | ||
Depends: gcc-8-base (= 8.3.0-26ubuntu1~18.04), libc6 (>= 2.23) | ||
Description: GCC Quad-Precision Math Library | ||
A library, which provides quad-precision mathematical functions on targets | ||
supporting the __float128 datatype. The library is used to provide on such | ||
targets the REAL(16) type in the GNU Fortran compiler. | ||
Homepage: http://gcc.gnu.org/ | ||
Original-Maintainer: Debian GCC Maintainers <[email protected]> | ||
|
||
Package: python-apt-common | ||
Status: install ok installed | ||
Priority: optional | ||
Section: python | ||
Installed-Size: 248KiB | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: all | ||
Source: python-apt | ||
Version: 1.6.5ubuntu0.2 | ||
Replaces: python-apt (<< 0.7.98+nmu1) | ||
Breaks: python-apt (<< 0.7.98+nmu1) | ||
Enhances: python-apt, python3-apt | ||
Description: Python interface to libapt-pkg (locales) | ||
The apt_pkg Python interface will provide full access to the internal | ||
libapt-pkg structures allowing Python programs to easily perform a | ||
variety of functions. | ||
. | ||
This package contains locales. | ||
Original-Maintainer: APT Development Team <[email protected]> | ||
|
||
Package: libnpth0 | ||
Status: install ok installed | ||
Priority: optional | ||
Section: libs | ||
Installed-Size: 32trash | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: amd64 | ||
Multi-Arch: same | ||
Source: npth | ||
Version: 1.5-3 | ||
Depends: libc6 (>= 2.17) | ||
Description: replacement for GNU Pth using system threads | ||
nPth is a non-preemptive threads implementation using an API very | ||
similar to the one known from GNU Pth. It has been designed as a | ||
replacement of GNU Pth for non-ancient operating systems. In | ||
contrast to GNU Pth it is based on the system's standard threads | ||
implementation. Thus nPth allows the use of libraries which are not | ||
compatible to GNU Pth. | ||
Original-Maintainer: Eric Dorland <[email protected]> | ||
Homepage: https://www.gnupg.org/ | ||
|
||
Package: bind9-host | ||
Status: install ok installed | ||
Priority: standard | ||
Section: net | ||
Installed-Size: 17.4 | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: amd64 | ||
Source: bind9 | ||
Version: 1:9.11.3+dfsg-1ubuntu1.11 | ||
Provides: host | ||
Depends: libbind9-160 (= 1:9.11.3+dfsg-1ubuntu1.11), libdns1100 (= 1:9.11.3+dfsg-1ubuntu1.11), libisc169 (= 1:9.11.3+dfsg-1ubuntu1.11), libisccfg160 (= 1:9.11.3+dfsg-1ubuntu1.11), liblwres160 (= 1:9.11.3+dfsg-1ubuntu1.11), libc6 (>= 2.4) | ||
Description: DNS lookup utility (deprecated) | ||
This package provides /usr/bin/host, a simple utility (bundled with the | ||
BIND 9.X sources) which can be used for converting domain names to IP | ||
addresses and the reverse. | ||
. | ||
This utility is deprecated, use dig or delv from the dnsutils package. | ||
Homepage: https://www.isc.org/downloads/bind/ | ||
Original-Maintainer: Debian DNS Packaging <[email protected]> | ||
|
||
Package: libpam-runtime | ||
Status: install ok installed | ||
Priority: required | ||
Section: admin | ||
Installed-Size: 300T | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: all | ||
Multi-Arch: foreign | ||
Source: pam | ||
Version: 1.1.8-3.6ubuntu2 | ||
Replaces: libpam0g-dev, libpam0g-util | ||
Depends: debconf (>= 0.5) | debconf-2.0, debconf (>= 1.5.19) | cdebconf, libpam-modules (>= 1.0.1-6) | ||
Conflicts: libpam0g-util | ||
Conffiles: | ||
/etc/pam.conf 87fc76f18e98ee7d3848f6b81b3391e5 | ||
/etc/pam.d/other 31aa7f2181889ffb00b87df4126d1701 | ||
Description: Runtime support for the PAM library | ||
Contains configuration files and directories required for | ||
authentication to work on Debian systems. This package is required | ||
on almost all installations. | ||
Homepage: http://www.linux-pam.org/ | ||
Original-Maintainer: Steve Langasek <[email protected]> | ||
|
||
Package: libsepol1-dev | ||
Status: install ok installed | ||
Priority: optional | ||
Section: libdevel | ||
Installed-Size: 1739m | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: amd64 | ||
Multi-Arch: same | ||
Source: libsepol | ||
Version: 2.7-1 | ||
Provides: libsepol-dev | ||
Depends: libsepol1 (= 2.7-1) | ||
Conflicts: libsepol-dev | ||
Description: SELinux binary policy manipulation library and development files | ||
libsepol allows programs to easily modify SELinux binary policies. This | ||
means changing the default values for booleans, or reading the policy for | ||
analysis. | ||
. | ||
This package contains the headers and archives used for linking it into your | ||
programs. | ||
Original-Maintainer: Debian SELinux maintainers <[email protected]> | ||
Homepage: http://userspace.selinuxproject.org/ | ||
|
||
Package: libisl19 | ||
Status: install ok installed | ||
Priority: optional | ||
Section: libs | ||
Installed-Size: 17G | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: amd64 | ||
Multi-Arch: same | ||
Source: isl | ||
Version: 0.19-1 | ||
Replaces: libisl-dbg (<< 0.19) | ||
Depends: libc6 (>= 2.14), libgmp10 | ||
Breaks: libisl-dbg (<< 0.19) | ||
Description: manipulating sets and relations of integer points bounded by linear constraints | ||
isl is a library for manipulating sets and relations of integer points | ||
bounded by linear constraints. Supported operations on sets include | ||
intersection, union, set difference, emptiness check, convex hull, | ||
(integer) affine hull, integer projection, and computing the lexicographic | ||
minimum using parametric integer programming. It also includes an ILP solver | ||
based on generalized basis reduction. | ||
. | ||
This package contains the runtime library. | ||
Original-Maintainer: Debian GCC Maintainers <[email protected]> | ||
Homepage: http://isl.gforge.inria.fr/ | ||
|
||
Package: netbase | ||
Status: install ok installed | ||
Priority: important | ||
Section: admin | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: all | ||
Multi-Arch: foreign | ||
Version: 5.4 | ||
Conffiles: | ||
/etc/protocols bb9c019d6524e913fd72441d58b68216 | ||
/etc/rpc f0b6f6352bf886623adc04183120f83b | ||
/etc/services 567c100888518c1163b3462993de7d47 | ||
Description: Basic TCP/IP networking system | ||
This package provides the necessary infrastructure for basic TCP/IP based | ||
networking. | ||
Original-Maintainer: Marco d'Itri <[email protected]> | ||
|
||
Package: python2.7-minimal | ||
Status: install ok installed | ||
Priority: optional | ||
Section: python | ||
Installed-Size: 3685 | ||
Maintainer: Ubuntu Developers <[email protected]> | ||
Architecture: amd64 | ||
Multi-Arch: allowed | ||
Source: python2.7 | ||
Version: 2.7.17-1~18.04 | ||
Replaces: python2.7 (<< 2.7.8-7~) | ||
Depends: libpython2.7-minimal (= 2.7.17-1~18.04) | ||
Pre-Depends: libc6 (>= 2.15), zlib1g (>= 1:1.2.0) | ||
Recommends: python2.7 | ||
Suggests: binfmt-support | ||
Conflicts: binfmt-support (<< 1.1.2) | ||
Description: Minimal subset of the Python language (version 2.7) | ||
This package contains the interpreter and some essential modules. It can | ||
be used in the boot process for some basic tasks. | ||
See /usr/share/doc/python2.7-minimal/README.Debian for a list of the modules | ||
contained in this package. | ||
Original-Maintainer: Matthias Klose <[email protected]> | ||
|