foreman_cve_scanner 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ef55cf85764a1394ea0e94d9cdf96520e905f49a5e479d2c7254867c6797be9
|
|
4
|
+
data.tar.gz: 874cd48378be0b12d341e06b4f15172b7ad1c45cd607ee7d0c513a38b5a172ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ba5bf4caff8597578e07c110961376c6c3ae242b8f71092e023993c1514a5a0ae185fe34fc32b052fbb1d2d773ce1dfdfb5a17a0f8ec1bff955d0b69984e6c2
|
|
7
|
+
data.tar.gz: d89adc8ffb92d8075c133084815b9db47b4f17e7dcb73c9e8cb1811cf52441636d1c9b2b6bf2e781438252c3d7a041f1f616476fb0237a17dafeeef2b5fd5c37
|
data/README.md
CHANGED
|
@@ -81,7 +81,7 @@ module ForemanCveScanner
|
|
|
81
81
|
{
|
|
82
82
|
'name' => entry['artifact']['name'],
|
|
83
83
|
'version' => entry['artifact']['version'],
|
|
84
|
-
'title' => entry['vulnerability']['description'].gsub(/[\[\]"\\]/, ''),
|
|
84
|
+
'title' => entry['vulnerability']['description'].to_s.gsub(/[\[\]"\\]/, ''),
|
|
85
85
|
'severity' => entry['vulnerability']['severity'],
|
|
86
86
|
'url' => entry['vulnerability']['dataSource'],
|
|
87
87
|
}
|
|
@@ -91,7 +91,7 @@ module ForemanCveScanner
|
|
|
91
91
|
unified = {
|
|
92
92
|
'name' => entry['PkgName'],
|
|
93
93
|
'version' => entry['InstalledVersion'],
|
|
94
|
-
'title' => entry['Title'].gsub(/[\[\]"\\]/, ''),
|
|
94
|
+
'title' => entry['Title'].to_s.gsub(/[\[\]"\\]/, ''),
|
|
95
95
|
'severity' => entry['Severity'],
|
|
96
96
|
'url' => entry['PrimaryURL'],
|
|
97
97
|
'status' => entry['Status'],
|
|
@@ -59,13 +59,26 @@ grype_url = "https://github.com/anchore/grype/releases/download/v#{grype_version
|
|
|
59
59
|
|
|
60
60
|
case @host.operatingsystem.family
|
|
61
61
|
when 'Debian'
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
trivy_download_cmd = "wget -O /tmp/trivy.deb \"#{trivy_url}\""
|
|
63
|
+
grype_download_cmd = "wget -O /tmp/grype.deb \"#{grype_url}\""
|
|
64
|
+
trivy_install_cmd = "dpkg -i /tmp/trivy.deb"
|
|
65
|
+
grype_install_cmd = "dpkg -i /tmp/grype.deb"
|
|
66
|
+
trivy_cleanup_cmd = "rm -f /tmp/trivy.deb"
|
|
67
|
+
grype_cleanup_cmd = "rm -f /tmp/grype.deb"
|
|
64
68
|
when 'Redhat', 'Suse'
|
|
65
|
-
trivy_install_cmd = "rpm -ivh #{trivy_url}"
|
|
66
|
-
grype_install_cmd = "rpm -ivh #{grype_url}"
|
|
69
|
+
trivy_install_cmd = "rpm -ivh \"#{trivy_url}\""
|
|
70
|
+
grype_install_cmd = "rpm -ivh \"#{grype_url}\""
|
|
67
71
|
end
|
|
68
72
|
-%>
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
<%=
|
|
74
|
+
<% if input('scanner_to_install') == 'both' || input('scanner_to_install') == 'trivy' -%>
|
|
75
|
+
<%= trivy_download_cmd unless trivy_install_cmd.nil? %>
|
|
76
|
+
<%= trivy_install_cmd %>
|
|
77
|
+
<%= trivy_cleanup_cmd unless trivy_cleanup_cmd.nil? %>
|
|
78
|
+
<% end -%>
|
|
79
|
+
|
|
80
|
+
<% if input('scanner_to_install') == 'both' || input('scanner_to_install') == 'grype' -%>
|
|
81
|
+
<%= grype_download_cmd unless grype_download_cmd.nil? %>
|
|
82
|
+
<%= grype_install_cmd %>
|
|
83
|
+
<%= grype_cleanup_cmd unless grype_cleanup_cmd.nil? %>
|
|
84
|
+
<% end %>
|
data/package.json
CHANGED