Skip to content

Commit

Permalink
feat(checker): add netdata checker (#3648)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine committed Jan 8, 2024
1 parent b700bfc commit 524d668
Show file tree
Hide file tree
Showing 6 changed files with 49 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 @@ -231,6 +231,7 @@
"neon",
"nessus",
"netatalk",
"netdata",
"netkit_ftp",
"netpbm",
"nettle",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/netdata.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 netdata
https://www.cvedetails.com/product/57777/Netdata-Netdata.html?vendor_id=20255
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class NetdataChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"NETDATA[A-Za-z_=%\-\r\n]*v([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("netdata", "netdata")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 28 additions & 0 deletions test/test_data/netdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "netdata", "version": "1.12.0", "version_strings": ["NETDATA\nv1.12.0"]}
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/n/",
"package_name": "netdata-1.44.1-1.fc40.aarch64.rpm",
"product": "netdata",
"version": "1.44.1",
"other_products": ["sqlite"],
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/n/netdata/",
"package_name": "netdata-core_1.12.0-1+deb10u1_amd64.deb",
"product": "netdata",
"version": "1.12.0",
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
"package_name": "netdata_1.30.1-2_x86_64.ipk",
"product": "netdata",
"version": "1.30.1",
"other_products": ["sqlite"],
},
]

0 comments on commit 524d668

Please sign in to comment.