-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 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 |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
"strongswan", | ||
"syslogng", | ||
"systemd", | ||
"varnish", | ||
"xerces", | ||
"xml2", | ||
"zlib", | ||
|
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,35 @@ | ||
#!/usr/bin/python3 | ||
|
||
""" | ||
CVE checker for varnish | ||
https://www.cvedetails.com/vulnerability-list/vendor_id-12937/product_id-26407/Varnish-cache-Varnish.html | ||
""" | ||
import os | ||
from ..util import regex_find | ||
|
||
|
||
def get_version(lines, filename): | ||
"""returns version information for varnish as found in a given file. | ||
The version info is returned as a tuple: | ||
[modulename, is_or_contains, version] | ||
modulename will be varnish if varnish is found (and blank otherwise) | ||
is_or_contains indicates if the file is a copy of varnish or contains one | ||
version gives the actual version number | ||
VPkg: varnish-cache, varnish | ||
""" | ||
regex = [r"varnish-([0-9]+\.[0-9]+\.[0-9]+)"] | ||
version_info = dict() | ||
version = regex_find(lines, *regex) | ||
|
||
if "varnish" in filename: | ||
version_info["is_or_contains"] = "is" | ||
version_info["modulename"] = "varnish" | ||
version_info["version"] = version | ||
return version_info | ||
|
||
if version != "UNKNOWN" and "is_or_contains" not in version_info: | ||
version_info["is_or_contains"] = "contains" | ||
version_info["modulename"] = "varnish" | ||
version_info["version"] = version | ||
return version_info | ||
return {} |
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,11 @@ | ||
#include <stdio.h> | ||
|
||
int main() { | ||
printf("This program is designed to test the cve-bin-tool checker."); | ||
printf("It outputs a few strings normally associated with varnish_4.1.1"); | ||
printf("They appear below this line."); | ||
printf("------------------"); | ||
printf("varnish-4.1.1"); | ||
|
||
return 0; | ||
} |
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