-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve dhclient checker and add dhcpd checker (#2642)
- isc:dhcp CPE ID is not only related to ISC DHCP client but also to ISC DHCP server as both components have the same source code - Drop second pattern which is not used to find version in RPM - Add debian and OpenWRT test packages as well as additional signatures - Add dhcpd checker Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
- Loading branch information
Showing
10 changed files
with
80 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ | |
"dbus", | ||
"dhclient", | ||
"dhcpcd", | ||
"dhcpd", | ||
"dnsmasq", | ||
"domoticz", | ||
"dovecot", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (C) 2023 Orange | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
|
||
""" | ||
CVE checker for dhcpd (ISC DHCP server) | ||
https://www.cvedetails.com/product/2017/ISC-Dhcpd.html?vendor_id=64 | ||
https://www.cvedetails.com/product/17706/ISC-Dhcp.html?vendor_id=64 | ||
""" | ||
from __future__ import annotations | ||
|
||
from cve_bin_tool.checkers import Checker | ||
|
||
|
||
class DhcpdChecker(Checker): | ||
CONTAINS_PATTERNS: list[str] = [] | ||
FILENAME_PATTERNS: list[str] = [] | ||
VERSION_PATTERNS = [ | ||
r"\r?\ndhcpd\.c[a-zA-Z0-9 \'%-\[\]{}<>#%|\.:\r\n]*([0-9]+\.[0-9]+\.[0-9]+)", | ||
r"([0-9]+\.[0-9]+\.[0-9]+)[a-zA-Z0-9 \'%-\[\]{}<>#%|\.:\r\n]*dhcpd\.c\r?\n", | ||
] | ||
VENDOR_PRODUCT = [("isc", "dhcp"), ("isc", "dhcpd")] |
Binary file added
BIN
+361 KB
test/condensed-downloads/dhcp-server-4.4.3-7.P1.fc38.aarch64.rpm.tar.gz
Binary file not shown.
Binary file added
BIN
+271 KB
test/condensed-downloads/isc-dhcp-client-ipv4_4.4.1-4_x86_64.ipk.tar.gz
Binary file not shown.
Binary file added
BIN
+67.4 KB
test/condensed-downloads/isc-dhcp-client_4.3.1-6+deb8u3_amd64.deb.tar.gz
Binary file not shown.
Binary file added
BIN
+316 KB
test/condensed-downloads/isc-dhcp-server-ipv6_4.4.1-4_x86_64.ipk.tar.gz
Binary file not shown.
Binary file added
BIN
+110 KB
test/condensed-downloads/isc-dhcp-server_4.3.5-3+deb9u1_arm64.deb.tar.gz
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (C) 2023 Orange | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
mapping_test_data = [ | ||
{"product": "dhcpd", "version": "4.3.5", "version_strings": ["4.3.5\ndhcpd.c"]}, | ||
{ | ||
"product": "dhcpd", | ||
"version": "4.4.3", | ||
"version_strings": ["dhcpd.c\nCan't allocate new generic object: %s\n4.4.3"], | ||
}, | ||
] | ||
package_test_data = [ | ||
{ | ||
"url": "https://www.rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/d/", | ||
"package_name": "dhcp-server-4.4.3-7.P1.fc38.aarch64.rpm", | ||
"product": "dhcpd", | ||
"version": "4.4.3", | ||
"other_products": ["dhcp"], | ||
}, | ||
{ | ||
"url": "http://ftp.fr.debian.org/debian/pool/main/i/isc-dhcp/", | ||
"package_name": "isc-dhcp-server_4.3.5-3+deb9u1_arm64.deb", | ||
"product": "dhcpd", | ||
"version": "4.3.5", | ||
"other_products": ["dhcp"], | ||
}, | ||
{ | ||
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/", | ||
"package_name": "isc-dhcp-server-ipv6_4.4.1-4_x86_64.ipk", | ||
"product": "dhcpd", | ||
"version": "4.4.1", | ||
"other_products": ["dhcp"], | ||
}, | ||
] |