foreman_scap_client 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/foreman_scap_client +2 -3
- data/config/config.yaml.example +0 -4
- data/lib/foreman_scap_client/version.rb +1 -1
- data/lib/foreman_scap_client.rb +0 -1
- metadata +6 -7
- data/lib/foreman_scap_client/oval_client.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee515e83b0f3905864064b90029612792b2c607fa45b2d1e0b8d57739f1724aa
|
4
|
+
data.tar.gz: 62f2894c2f3e40fe977aff6f7b22e04add6c41a177da6be9061ed741432f8a1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08dc4cc7aec0dc4fea47b5202ee9b4b79aa409f18a45cf3d9c2602549d1d92ccc30bf1eafd6137f927f02e4fa4beecf3da595c3fc2f8ade50be71c7defe86316'
|
7
|
+
data.tar.gz: 41c69b9e16d6fcb586012fb6f57f581f0088d352176f3c62772ab409258592d4bc698b6f902e44361c3bdd2c4b7dbab4a791d4d554e4d6815bc810ab6616b3c4
|
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
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.0
|
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-
|
13
|
+
date: 2024-05-30 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
|