Skip to content

Commit

Permalink
feat(checker): add debianutils (intel#3390)
Browse files Browse the repository at this point in the history
* feat(checker): extended BindChecker

* feat(checker): added test names and additional version pattern

* feat(checker): add debianutils
  • Loading branch information
sw-sdiepold committed Oct 11, 2023
1 parent 30cc302 commit a4612c8
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"dav1d",
"davfs2",
"dbus",
"debianutils",
"dhclient",
"dhcpcd",
"dhcpd",
Expand Down
36 changes: 36 additions & 0 deletions cve_bin_tool/checkers/debianutils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (C) 2023 SCHUTZWERK GmbH
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for debianutils
References:
https://salsa.debian.org/debian/debianutils
"""

from __future__ import annotations

from cve_bin_tool.checkers import Checker


class DebianutilsChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS = [
r"run-parts",
r"tempfile",
r"ischroot",
r"installkernel",
r"savelog",
r"which.debianutils",
r"add-shell",
r"remove-shell",
r"update-shells",
]
VERSION_PATTERNS = [
r"\r?\nDebian run-parts program, version\s([0-9]+\.[0-9]+)",
r"\r?\ntempfile\s([0-9]+\.[0-9]+)",
r"\r?\nDebian ischroot, version\s([0-9]+\.[0-9]+)",
]
VENDOR_PRODUCT = [("debian", "debianutils")]
Binary file not shown.
22 changes: 22 additions & 0 deletions test/test_data/debianutils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2023 SCHUTZWERK GmbH
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "debianutils",
"version": "5.13",
"version_strings": [
"Debian run-parts program, version 5.13",
"tempfile 5.13",
"Debian ischroot, version 5.13",
],
}
]
package_test_data = [
{
"url": "http://ftp.us.debian.org/debian/pool/main/d/debianutils/",
"package_name": "debianutils_5.7-0.4_amd64.deb",
"product": "debianutils",
"version": "5.7",
}
]

0 comments on commit a4612c8

Please sign in to comment.