Skip to content
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

feat(checker): add dmidecode checker #2997

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"dhclient",
"dhcpcd",
"dhcpd",
"dmidecode",
"dnsmasq",
"domoticz",
"dovecot",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/dmidecode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for dmidecode

https://www.cvedetails.com/product/138316/Nongnu-Dmidecode.html?vendor_id=6788

"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class DmidecodeChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"([0-9]+\.[0-9]+)\r?\n(?:# |)dmidecode"]
VENDOR_PRODUCT = [("nongnu", "dmidecode")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
27 changes: 27 additions & 0 deletions test/test_data/dmidecode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "dmidecode", "version": "3.5", "version_strings": ["3.5\ndmidecode"]},
{"product": "dmidecode", "version": "3.0", "version_strings": ["3.0\n# dmidecode"]},
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/opensuse/tumbleweed/repo/oss/x86_64/",
"package_name": "dmidecode-3.5-2.1.x86_64.rpm",
"product": "dmidecode",
"version": "3.5",
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/d/dmidecode/",
"package_name": "dmidecode_3.0-4_amd64.deb",
"product": "dmidecode",
"version": "3.0",
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
"package_name": "dmidecode_3.2-1_x86_64.ipk",
"product": "dmidecode",
"version": "3.2",
},
]