foreman_scap_client 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7697820fd581d3723fb127ccdf83de310d2f7112d7ceddc6884d7c6ccb56e155
4
- data.tar.gz: 3562f518e5bb87437d248e4270ab8ab7fd8508e3bc6b3aac21aef3bfda4bf6b4
3
+ metadata.gz: cdea1319b49e7e730c03aad7fda81efe05ca03b40fbc4e935ef8be35a86a1dd8
4
+ data.tar.gz: 86281c1e0396bfde58cbff6b2f607e2d6bc2bda7d2428ae44180fc3adb20f4ee
5
5
  SHA512:
6
- metadata.gz: f0f2ee21010276e9ef25f3d623ada4afc9a8fcb3314dd4773e94fab4d75fc4d6aa3a076c4b54ede2de4b9afb9da3b286af55538b35641a89c635a49f222a308f
7
- data.tar.gz: 80b63cabe6478142a34c0d365ba698774e23d8ee86ea21d6c204a700f8d590f3e8dfc05cc409338390ea527298582770b05ddae4b4b5e5d5cd587bd1887b6c75
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
- if RUBY_VERSION.start_with? '1.8'
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
- puts error_str.split("\n").select { |item| item.start_with?('WARNING:') || item.start_with?('Downloading') }.join("\n")
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
@@ -182,7 +160,7 @@ module ForemanScapClient
182
160
  https.ca_file = config[:ca_file]
183
161
  begin
184
162
  https.cert = OpenSSL::X509::Certificate.new File.read(config[:host_certificate])
185
- https.key = OpenSSL::PKey::RSA.new File.read(config[:host_private_key])
163
+ https.key = OpenSSL::PKey.read File.read(config[:host_private_key])
186
164
  rescue StandardError => e
187
165
  puts 'Unable to load certs'
188
166
  puts e.message
@@ -1,3 +1,3 @@
1
1
  module ForemanScapClient
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_scap_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  - Šimon Lukašík
9
9
  - Shlomi Zadok
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-05-09 00:00:00.000000000 Z
13
+ date: 2024-05-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -64,7 +64,7 @@ homepage: https://github.com/theforeman/foreman_scap_client
64
64
  licenses:
65
65
  - GPL-3.0
66
66
  metadata: {}
67
- post_install_message:
67
+ post_install_message:
68
68
  rdoc_options: []
69
69
  require_paths:
70
70
  - lib
@@ -80,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements:
82
82
  - bzip2
83
- rubygems_version: 3.1.6
84
- signing_key:
83
+ rubygems_version: 3.2.33
84
+ signing_key:
85
85
  specification_version: 4
86
86
  summary: Client script that runs openscap scan and uploads the result to foreman proxy
87
87
  test_files: []