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: 8d2e1f0a7bfd0f9bf0856ef7acb0a7aeb238dd35dfedccf2acd833824ba59790
4
- data.tar.gz: c91bf1095a846cc47c1d73e551065c8fa80b0e7a1d18b474684b1b07d5127a38
3
+ metadata.gz: 0ef55cf85764a1394ea0e94d9cdf96520e905f49a5e479d2c7254867c6797be9
4
+ data.tar.gz: 874cd48378be0b12d341e06b4f15172b7ad1c45cd607ee7d0c513a38b5a172ae
5
5
  SHA512:
6
- metadata.gz: be53822e1090aed249a18a64ad21b12f4142092fc8b9a8dafe7f4f204dbca0ab6f11893501480c1df5507a030ba89921b172b5bb80c457f8a4a8a321d015290f
7
- data.tar.gz: 674c34da1ff2274566619e5ea9690cbf4537f285e95ec5f9d880272f081e5bae57e26e6b3aa079bdc246ffb7b758995a82a48a1aeed5e27d1732f34802b587fb
6
+ metadata.gz: 8ba5bf4caff8597578e07c110961376c6c3ae242b8f71092e023993c1514a5a0ae185fe34fc32b052fbb1d2d773ce1dfdfb5a17a0f8ec1bff955d0b69984e6c2
7
+ data.tar.gz: d89adc8ffb92d8075c133084815b9db47b4f17e7dcb73c9e8cb1811cf52441636d1c9b2b6bf2e781438252c3d7a041f1f616476fb0237a17dafeeef2b5fd5c37
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # ForemanCveScanner
2
2
 
3
- Version: 0.5.0
4
-
5
3
  Plugin to:
6
4
  1. install Trivy/Grype on a host using Foreman Remote Execution (REX)
7
5
  2. run CVE scans via REX and parse the results
@@ -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
- trivy_install_cmd = "wget -o /tmp/outfile.deb #{trivy_url} && dpkg -i /tmp/outfile.deb; rm -f /tmp/outfile.deb"
63
- grype_install_cmd = "wget -o /tmp/outfile.deb #{grype_url} && dpkg -i /tmp/outfile.deb; rm -f /tmp/outfile.deb"
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
- <%= trivy_install_cmd if input('scanner_to_install') == 'both' || input('scanner_to_install') == 'trivy' %>
71
- <%= grype_install_cmd if input('scanner_to_install') == 'both' || input('scanner_to_install') == 'grype' %>
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 %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanCveScanner
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_cve_scanner",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Run CVE scan on host and collect report",
5
5
  "main": "webpack/index.js",
6
6
  "directories": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_cve_scanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernhard Suttner