foreman_scap_client 0.5.2 → 0.5.3
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 +4 -4
- data/lib/foreman_scap_client/base_client.rb +2 -24
- data/lib/foreman_scap_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cdea1319b49e7e730c03aad7fda81efe05ca03b40fbc4e935ef8be35a86a1dd8
|
|
4
|
+
data.tar.gz: 86281c1e0396bfde58cbff6b2f607e2d6bc2bda7d2428ae44180fc3adb20f4ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0a30cc7e90e5e0b5c024a2ba035d8a8534b6fc8ffc01a81f732aa987e46fd97af5878da3f444ac115905902a74d588757e6f0b000972e5d9322b84045410ddb
|
|
7
|
+
data.tar.gz: 88b379a4e4b3f1aee52e6c4d2d2b85c38646b2170874132fd0a375ce76a87e34b82b23b2b38f477fb0c6af4ae067114e52209e147ecc4950c3c5721fc0a08151
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require 'rubygems' if RUBY_VERSION.start_with? '1.8'
|
|
2
1
|
require 'yaml'
|
|
3
2
|
require 'tmpdir'
|
|
4
3
|
require 'net/http'
|
|
@@ -71,17 +70,13 @@ module ForemanScapClient
|
|
|
71
70
|
puts "DEBUG: running: " + scan_command
|
|
72
71
|
puts "with ENV vars: #{scan_command_env_vars}" unless scan_command_env_vars.empty?
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
legacy_run_scan
|
|
76
|
-
else
|
|
77
|
-
run_scan
|
|
78
|
-
end
|
|
73
|
+
run_scan
|
|
79
74
|
end
|
|
80
75
|
|
|
81
76
|
def run_scan
|
|
82
77
|
stdout_str, error_str, result = Open3.capture3(scan_command_env_vars, scan_command)
|
|
83
78
|
if result.success? || result.exitstatus == 2
|
|
84
|
-
|
|
79
|
+
error_str.each_line { |item| print item if item.start_with?('WARNING:') || item.start_with?('Downloading') }
|
|
85
80
|
@report = results_path
|
|
86
81
|
else
|
|
87
82
|
puts 'Scan failed'
|
|
@@ -91,19 +86,6 @@ module ForemanScapClient
|
|
|
91
86
|
end
|
|
92
87
|
end
|
|
93
88
|
|
|
94
|
-
def legacy_run_scan
|
|
95
|
-
warn_proxy_not_supported
|
|
96
|
-
result = `#{scan_command}`
|
|
97
|
-
|
|
98
|
-
if $?.success? || $?.exitstatus == 2
|
|
99
|
-
@report = results_path
|
|
100
|
-
else
|
|
101
|
-
puts 'Scan failed'
|
|
102
|
-
puts result
|
|
103
|
-
exit(2)
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
|
|
107
89
|
def scan_command_env_vars
|
|
108
90
|
if http_proxy_uri
|
|
109
91
|
{
|
|
@@ -130,10 +112,6 @@ module ForemanScapClient
|
|
|
130
112
|
"#{results_path}.bz2"
|
|
131
113
|
end
|
|
132
114
|
|
|
133
|
-
def warn_proxy_not_supported
|
|
134
|
-
puts 'Configuration for HTTP(S) proxy found but not supported for ruby 1.8' if http_proxy_uri
|
|
135
|
-
end
|
|
136
|
-
|
|
137
115
|
def bzip_command
|
|
138
116
|
"/usr/bin/env bzip2 #{results_path}"
|
|
139
117
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_scap_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marek Hulan
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2024-05-15 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: bundler
|