foreman_scap_client 0.5.3 → 0.6.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: cdea1319b49e7e730c03aad7fda81efe05ca03b40fbc4e935ef8be35a86a1dd8
4
- data.tar.gz: 86281c1e0396bfde58cbff6b2f607e2d6bc2bda7d2428ae44180fc3adb20f4ee
3
+ metadata.gz: 07e020e26294471ddc11840c2e52796c5d1c955989c204ed73aaaca5de0a45e5
4
+ data.tar.gz: 2d68f8f29e34ea4ebc16051fdc80abcd36d3c70a20ec91a2f0e2e11db1117b8b
5
5
  SHA512:
6
- metadata.gz: e0a30cc7e90e5e0b5c024a2ba035d8a8534b6fc8ffc01a81f732aa987e46fd97af5878da3f444ac115905902a74d588757e6f0b000972e5d9322b84045410ddb
7
- data.tar.gz: 88b379a4e4b3f1aee52e6c4d2d2b85c38646b2170874132fd0a375ce76a87e34b82b23b2b38f477fb0c6af4ae067114e52209e147ecc4950c3c5721fc0a08151
6
+ metadata.gz: da76639059c37d8b83dfbf4a7b48bb672054d2fe868a8576d63cc110c0b2eb88776c4a11f9a0401757f545e1948b7c8fd42e2801578b29ea6b57a55d2a73089d
7
+ data.tar.gz: 149235483dae7d88e92e64b650c6cb03129989effffd733819f6e3fe21b1673382764b9bdc566c78cae50792b1df580b1285132d764942fb1c79fe18362edcbe
@@ -12,12 +12,11 @@ end
12
12
 
13
13
  if args.size == 1
14
14
  ForemanScapClient::Client.new.run(args[0].to_i, skip_upload)
15
+ # Left around for compatibility
15
16
  elsif args.size == 2 && args[0] == 'ds'
16
17
  ForemanScapClient::Client.new.run(args[1].to_i, skip_upload)
17
- elsif args.size == 2 && args[0] == 'oval'
18
- ForemanScapClient::OvalClient.new.run(args[1].to_i, skip_upload)
19
18
  else
20
- puts "Usage: #{$0} [ds | oval] policy_id [--skip-upload]"
19
+ puts "Usage: #{$0} [ds] policy_id [--skip-upload]"
21
20
  puts " where policy_id is a key used in config file"
22
21
  exit 2
23
22
  end
@@ -33,7 +33,3 @@
33
33
  2:
34
34
  :profile: 'xccdf_org.ssgproject.content_profile_common'
35
35
  :content_path: '/usr/share/xml/scap/ssg/content/ssg-fedora-ds.xml'
36
-
37
- :oval:
38
- 3:
39
- :content_path: '/var/lib/openscap/oval_content/ansible-2.9.oval.xml.bz2'
@@ -45,8 +45,9 @@ module ForemanScapClient
45
45
 
46
46
  def supports_local_file_option?
47
47
  # OpenSCAP 1.3.6 and newer requires the `--local-files` option to use local copies of remote SDS components
48
- version, _stderr, status = Open3.capture3('rpm', '-q', '--qf', '%{version}', 'openscap')
48
+ versions, _stderr, status = Open3.capture3('oscap', '--version')
49
49
  return false unless status.success?
50
+ version = versions.lines[0].split.last
50
51
  Gem::Version.new(version) >= Gem::Version.new('1.3.6')
51
52
  end
52
53
 
@@ -1,3 +1,3 @@
1
1
  module ForemanScapClient
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -1,3 +1,2 @@
1
1
  require "foreman_scap_client/version"
2
2
  require "foreman_scap_client/client"
3
- require "foreman_scap_client/oval_client"
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.3
4
+ version: 0.6.1
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: 2024-05-15 00:00:00.000000000 Z
13
+ date: 2024-07-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -58,13 +58,12 @@ files:
58
58
  - lib/foreman_scap_client.rb
59
59
  - lib/foreman_scap_client/base_client.rb
60
60
  - lib/foreman_scap_client/client.rb
61
- - lib/foreman_scap_client/oval_client.rb
62
61
  - lib/foreman_scap_client/version.rb
63
62
  homepage: https://github.com/theforeman/foreman_scap_client
64
63
  licenses:
65
64
  - GPL-3.0
66
65
  metadata: {}
67
- post_install_message:
66
+ post_install_message:
68
67
  rdoc_options: []
69
68
  require_paths:
70
69
  - lib
@@ -80,8 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
79
  version: '0'
81
80
  requirements:
82
81
  - bzip2
83
- rubygems_version: 3.2.33
84
- signing_key:
82
+ rubygems_version: 3.3.26
83
+ signing_key:
85
84
  specification_version: 4
86
85
  summary: Client script that runs openscap scan and uploads the result to foreman proxy
87
86
  test_files: []
@@ -1,31 +0,0 @@
1
- require 'foreman_scap_client/base_client'
2
-
3
- module ForemanScapClient
4
- class OvalClient < BaseClient
5
- private
6
-
7
- def policy_namespace
8
- :oval
9
- end
10
-
11
- def ensure_scan_files
12
- ensure_file :content_path, :download_path, "OVAL content"
13
- end
14
-
15
- def upload_uri
16
- foreman_proxy_uri + "/compliance/oval_reports/#{@policy_id}"
17
- end
18
-
19
- def scan_command
20
- "oscap oval eval --results #{results_path} #{policy_from_config[:content_path]}"
21
- end
22
-
23
- def print_upload_result(parsed)
24
- if parsed['reported_at']
25
- puts "Report successfully uploaded at #{parsed['reported_at']}"
26
- else
27
- puts "Report not uploaded, cause: #{parsed['result']}"
28
- end
29
- end
30
- end
31
- end