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 TrouSerS checker #1266

Merged
merged 1 commit into from
Jul 21, 2021
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 @@ -98,6 +98,7 @@
"syslogng",
"systemd",
"tcpdump",
"trousers",
"varnish",
"webkitgtk",
"wireshark",
Expand Down
29 changes: 29 additions & 0 deletions cve_bin_tool/checkers/trousers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later


"""

CVE checker for TrouSerS

https://www.cvedetails.com/vendor/23743/?q=Trousers+Project

"""
from cve_bin_tool.checkers import Checker


class TrousersChecker(Checker):
CONTAINS_PATTERNS = [
r"TrouSerS Config file %s not found, using defaults.",
r"TrouSerS Could not retrieve client address info",
r"TrouSerS Could not set IPv6 socket option properly.",
r"TrouSerS IPv4 support disabled by configuration option",
r"TrouSerS IPv6 support disabled by configuration option",
]
FILENAME_PATTERNS = [r"tcsd"]
VERSION_PATTERNS = [r"trousers ([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [
("trustedcomputinggroup", "trousers"),
("suse", "trousers"),
("trousers_project", "trousers"),
]
Binary file not shown.
Binary file not shown.
39 changes: 39 additions & 0 deletions test/test_data/trousers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "trousers",
"version": "0.3.15",
"version_strings": [
"TrouSerS Config file %s not found, using defaults.",
"TrouSerS Could not retrieve client address info",
"TrouSerS Could not set IPv6 socket option properly.",
"trousers 0.3.15",
],
},
{
"product": "trousers",
"version": "0.3.13",
"version_strings": [
"TrouSerS Config file %s not found, using defaults.",
"TrouSerS Could not retrieve client address info",
"TrouSerS Could not set IPv6 socket option properly.",
"trousers 0.3.13",
],
},
]
package_test_data = [
{
"url": "https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/34/Everything/x86_64/os/Packages/t/",
"package_name": "trousers-0.3.15-2.fc34.x86_64.rpm",
"product": "trousers",
"version": "0.3.15",
},
{
"url": "http://ftp.br.debian.org/debian/pool/main/t/trousers/",
"package_name": "trousers_0.3.13-3_amd64.deb",
"product": "trousers",
"version": "0.3.13",
},
]