openscap 0.5.1 → 0.6.0

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: 9c8eddf3fa5a4c04f1655827ba4f4b8422f32f314a20f888b36c5ef85e2e04cf
4
- data.tar.gz: 3e9d497efc4543111a4fee03d8db323c85b96360e31e23cd9ebc4387ec354d17
3
+ metadata.gz: 0bc547f7f6f44dcfc10ef4e815f6c26e7bab650247eae7241a4bc95abce56083
4
+ data.tar.gz: 5b0d572d1112b46c8559fe2111a5c296481293b673a0fafa4b7857baacd385cd
5
5
  SHA512:
6
- metadata.gz: 601b6ee58372cd9f943918611c5f10df28cf1245d1149547d2889531e4b623b3787fb70cc06c1b4a17d4fca7e4202dd27dcacc7a69eba5c99d156fcc7e2529f3
7
- data.tar.gz: 3a47312203579d8735b19032cfe427f76ede2467bbfb63b806dbd47edd79a8442ebd40fc61062fb4ece7b51742c38350e73c69d8677aafed5a5d8aef0d473db2
6
+ metadata.gz: 9f3f7b7bd3c070f859516235223d605f5601d16a89761ca5d1ff91ce2039636743747458e6c59b5d66be9bbf9ed40cf0a2914e2d18aa57ddd15eb9b971e23833
7
+ data.tar.gz: 6cca96b95d1a55adbeb61138a949f01f07e216e90e0d8619e1e40de674f1014b7108faa2fc0a8cbab59c86a4bc9448bab570fb7e61adc090b8d07f6fada62709
@@ -43,16 +43,6 @@ module OpenSCAP
43
43
  source = OpenSCAP::Source.new source_p
44
44
  OpenSCAP::DS::Sds.new(source)
45
45
  end
46
-
47
- def html
48
- html_p = OpenSCAP.ds_rds_session_get_html_report @session
49
- OpenSCAP.raise! if OpenSCAP.error?
50
- return nil if html_p.null?
51
-
52
- html = html_p.read_string
53
- OpenSCAP::LibC.free html_p
54
- html
55
- end
56
46
  end
57
47
  end
58
48
 
@@ -61,5 +51,4 @@ module OpenSCAP
61
51
  attach_function :ds_rds_session_select_report, %i[pointer string], :pointer
62
52
  attach_function :ds_rds_session_replace_report_with_source, %i[pointer pointer], :int
63
53
  attach_function :ds_rds_session_select_report_request, %i[pointer string], :pointer
64
- attach_function :ds_rds_session_get_html_report, [:pointer], :pointer
65
54
  end
@@ -34,12 +34,6 @@ module OpenSCAP
34
34
  checklist
35
35
  end
36
36
 
37
- def html_guide(profile = nil)
38
- html = OpenSCAP.ds_sds_session_get_html_guide(@raw, profile)
39
- OpenSCAP.raise! if html.nil?
40
- html
41
- end
42
-
43
37
  def destroy
44
38
  OpenSCAP.ds_sds_session_free(@raw)
45
39
  @raw = nil
@@ -50,5 +44,4 @@ module OpenSCAP
50
44
  attach_function :ds_sds_session_new_from_source, [:pointer], :pointer
51
45
  attach_function :ds_sds_session_free, [:pointer], :void
52
46
  attach_function :ds_sds_session_select_checklist, %i[pointer string string string], :pointer
53
- attach_function :ds_sds_session_get_html_guide, %i[pointer string], :string
54
47
  end
@@ -4,7 +4,7 @@ require 'ffi'
4
4
 
5
5
  module OpenSCAP
6
6
  extend FFI::Library
7
- ffi_lib ['libopenscap.so.8', 'libopenscap.so.25', 'openscap']
7
+ ffi_lib ['libopenscap.so.8', 'libopenscap.so.25', 'libopenscap.so.33', 'openscap']
8
8
 
9
9
  def self.error?
10
10
  oscap_err
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenSCAP
4
- VERSION = '0.5.1'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -9,24 +9,18 @@ module OpenSCAP
9
9
  @raw = raw
10
10
  end
11
11
 
12
- def id
13
- OpenSCAP.xccdf_fix_get_id @raw
14
- end
15
-
16
- def platform
17
- OpenSCAP.xccdf_fix_get_platform @raw
18
- end
19
-
20
- def fix_system
21
- OpenSCAP.xccdf_fix_get_system @raw
22
- end
23
-
24
- def content
25
- OpenSCAP.xccdf_fix_get_content @raw
26
- end
12
+ def id = OpenSCAP.xccdf_fix_get_id @raw
13
+ def platform = OpenSCAP.xccdf_fix_get_platform @raw
14
+ def system = OpenSCAP.xccdf_fix_get_system @raw
15
+ def content = OpenSCAP.xccdf_fix_get_content @raw
16
+ def reboot = OpenSCAP.xccdf_fix_get_reboot @raw
17
+ def strategy = OpenSCAP.xccdf_fix_get_strategy @raw
18
+ def disruption = OpenSCAP.xccdf_fix_get_disruption @raw
19
+ def complexity = OpenSCAP.xccdf_fix_get_complexity @raw
20
+ alias fix_system system
27
21
 
28
22
  def to_hash
29
- { id:, platform:, system: fix_system, content: }
23
+ { id:, platform:, system:, content: }
30
24
  end
31
25
  end
32
26
  end
@@ -34,4 +28,28 @@ module OpenSCAP
34
28
  attach_function :xccdf_fix_get_platform, [:pointer], :string
35
29
  attach_function :xccdf_fix_get_system, [:pointer], :string
36
30
  attach_function :xccdf_fix_get_content, [:pointer], :string
31
+ attach_function :xccdf_fix_get_reboot, [:pointer], :bool
32
+
33
+ XccdfStrategy = enum(
34
+ :unknown, 0, # Strategy not defined
35
+ :configure, # Adjust target config or settings
36
+ :disable, # Turn off or deinstall something
37
+ :enable, # Turn on or install something
38
+ :patch, # Apply a patch, hotfix, or update
39
+ :policy, # Remediation by changing policies/procedures
40
+ :restrict, # Adjust permissions or ACLs
41
+ :update, # Install upgrade or update the system
42
+ :combination # Combo of two or more of the above
43
+ )
44
+ attach_function :xccdf_fix_get_strategy, [:pointer], XccdfStrategy
45
+ XccdfLevel = enum(
46
+ :not_defined, 0,
47
+ :unknown, 1,
48
+ :info,
49
+ :low,
50
+ :medium,
51
+ :high
52
+ )
53
+ attach_function :xccdf_fix_get_disruption, [:pointer], XccdfLevel
54
+ attach_function :xccdf_fix_get_complexity, [:pointer], XccdfLevel
37
55
  end
@@ -9,11 +9,19 @@ module OpenSCAP
9
9
  @raw = raw
10
10
  end
11
11
 
12
- def text
13
- Text.new(OpenSCAP.xccdf_fixtext_get_text(@raw)).text
14
- end
12
+ def content = Text.new(OpenSCAP.xccdf_fixtext_get_text(@raw)).text
13
+ def fixref = OpenSCAP.xccdf_fixtext_get_fixref @raw
14
+ def reboot = OpenSCAP.xccdf_fixtext_get_reboot @raw
15
+ def strategy = OpenSCAP.xccdf_fixtext_get_strategy @raw
16
+ def disruption = OpenSCAP.xccdf_fixtext_get_disruption @raw
17
+ def complexity = OpenSCAP.xccdf_fixtext_get_complexity @raw
15
18
  end
16
19
  end
17
20
 
18
21
  attach_function :xccdf_fixtext_get_text, [:pointer], :pointer
22
+ attach_function :xccdf_fixtext_get_fixref, [:pointer], :string
23
+ attach_function :xccdf_fixtext_get_reboot, [:pointer], :bool
24
+ attach_function :xccdf_fixtext_get_strategy, [:pointer], XccdfStrategy
25
+ attach_function :xccdf_fixtext_get_disruption, [:pointer], XccdfLevel
26
+ attach_function :xccdf_fixtext_get_complexity, [:pointer], XccdfLevel
19
27
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openscap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Lukasik
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-02 00:00:00.000000000 Z
10
+ date: 2025-02-13 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ffi
@@ -68,7 +67,6 @@ homepage: https://github.com/isimluk/ruby-openscap
68
67
  licenses:
69
68
  - GPL-2.0
70
69
  metadata: {}
71
- post_install_message:
72
70
  rdoc_options: []
73
71
  require_paths:
74
72
  - lib
@@ -83,8 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
81
  - !ruby/object:Gem::Version
84
82
  version: '0'
85
83
  requirements: []
86
- rubygems_version: 3.4.10
87
- signing_key:
84
+ rubygems_version: 3.6.2
88
85
  specification_version: 4
89
86
  summary: A FFI wrapper around the OpenSCAP library
90
87
  test_files: []