foreman_scap_client 0.5.3 → 0.6.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07e020e26294471ddc11840c2e52796c5d1c955989c204ed73aaaca5de0a45e5
|
4
|
+
data.tar.gz: 2d68f8f29e34ea4ebc16051fdc80abcd36d3c70a20ec91a2f0e2e11db1117b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da76639059c37d8b83dfbf4a7b48bb672054d2fe868a8576d63cc110c0b2eb88776c4a11f9a0401757f545e1948b7c8fd42e2801578b29ea6b57a55d2a73089d
|
7
|
+
data.tar.gz: 149235483dae7d88e92e64b650c6cb03129989effffd733819f6e3fe21b1673382764b9bdc566c78cae50792b1df580b1285132d764942fb1c79fe18362edcbe
|
data/bin/foreman_scap_client
CHANGED
@@ -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
|
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
|
data/config/config.yaml.example
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/foreman_scap_client.rb
CHANGED
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.
|
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-
|
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.
|
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
|