Skip to content

Commit

Permalink
feat(checker): add checker for Moby (intel#3753)
Browse files Browse the repository at this point in the history
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
  • Loading branch information
inosmeet committed Mar 12, 2024
1 parent 0fb4095 commit 36fd142
Show file tree
Hide file tree
Showing 4 changed files with 47 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 @@ -217,6 +217,7 @@
"minidlna",
"miniupnpc",
"miniupnpd",
"moby",
"modsecurity",
"monit",
"mosquitto",
Expand Down
26 changes: 26 additions & 0 deletions cve_bin_tool/checkers/moby.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

"""
CVE checker for moby:
https://www.cvedetails.com/version-list/17212/41384/1/Mobyproject-Moby.html
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class MobyChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = [
r"docker",
r"dockerd",
r"docker-init",
r"docker-proxy",
]
VERSION_PATTERNS: list[str] = [
r"moby-([0-9]+\.[0-9]+\.[0-9]+)",
]
VENDOR_PRODUCT: list[tuple[str, str]] = [
("mobyproject", "moby"),
]
Binary file not shown.
20 changes: 20 additions & 0 deletions test/test_data/moby.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mapping_test_data = [
{
"product": "moby",
"version": "24.0.5",
"version_strings": ["moby-24.0.5"],
},
]

package_test_data = [
{
"url": "https://www.rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/m/",
"product": "moby",
"version": "24.0.5",
"package_name": "moby-engine-24.0.5-1.fc40.aarch64.rpm",
"other_products": [
"gcc",
"go",
],
},
]

0 comments on commit 36fd142

Please sign in to comment.