Skip to content

Commit 3b24f01

Browse files
authored
feat(checker): add iputils checker (#5224)
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
1 parent e432311 commit 3b24f01

File tree

7 files changed

+61
-0
lines changed

7 files changed

+61
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
"ipmitool",
164164
"ipsec_tools",
165165
"iptables",
166+
"iputils",
166167
"irssi",
167168
"iucode_tool",
168169
"iwd",

cve_bin_tool/checkers/iputils.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for iputils
7+
8+
https://www.cvedetails.com/product/150862/Iputils-Project-Iputils.html?vendor_id=31725
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class IputilsChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"([0-9]+)\r?\n[a-z, ]*iputils",
21+
r"iputils[A-Za-z0-9 \-\r\n]*\r?\n([0-9]+)\r?\n",
22+
]
23+
VENDOR_PRODUCT = [("iputils_project", "iputils")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/iputils.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "iputils",
7+
"version": "20180629",
8+
"version_strings": ["20180629\niputils"],
9+
}
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://rpmfind.net/linux/fedora-secondary/development/rawhide/Everything/ppc64le/os/Packages/i/",
14+
"package_name": "iputils-20240905-4.fc43.ppc64le.rpm",
15+
"product": "iputils",
16+
"version": "20240905",
17+
},
18+
{
19+
"url": "http://ftp.debian.org/debian/pool/main/i/iputils/",
20+
"package_name": "iputils-ping_20180629-2+deb10u2_amd64.deb",
21+
"product": "iputils",
22+
"version": "20180629",
23+
},
24+
{
25+
"url": "https://downloads.openwrt.org/releases/21.02.0/packages/x86_64/packages/",
26+
"package_name": "iputils-ping_20210202-1_x86_64.ipk",
27+
"product": "iputils",
28+
"version": "20210202",
29+
},
30+
{
31+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86/",
32+
"package_name": "iputils-ping-20240905-r0.apk",
33+
"product": "iputils",
34+
"version": "20240905",
35+
"other_products": ["gcc"],
36+
},
37+
]

0 commit comments

Comments
 (0)