openscap 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +2 -0
- data/lib/openscap.rb +1 -10
- data/lib/openscap/all.rb +1 -10
- data/lib/openscap/ds/arf.rb +2 -10
- data/lib/openscap/ds/sds.rb +1 -10
- data/lib/openscap/exceptions.rb +1 -10
- data/lib/openscap/libc.rb +1 -10
- data/lib/openscap/openscap.rb +2 -11
- data/lib/openscap/source.rb +2 -13
- data/lib/openscap/text.rb +1 -10
- data/lib/openscap/version.rb +2 -11
- data/lib/openscap/xccdf.rb +1 -10
- data/lib/openscap/xccdf/benchmark.rb +1 -10
- data/lib/openscap/xccdf/fix.rb +2 -10
- data/lib/openscap/xccdf/group.rb +1 -10
- data/lib/openscap/xccdf/ident.rb +2 -10
- data/lib/openscap/xccdf/item.rb +3 -10
- data/lib/openscap/xccdf/policy.rb +1 -10
- data/lib/openscap/xccdf/policy_model.rb +1 -10
- data/lib/openscap/xccdf/profile.rb +1 -10
- data/lib/openscap/xccdf/reference.rb +2 -10
- data/lib/openscap/xccdf/rule.rb +2 -11
- data/lib/openscap/xccdf/ruleresult.rb +1 -10
- data/lib/openscap/xccdf/session.rb +2 -10
- data/lib/openscap/xccdf/tailoring.rb +1 -10
- data/lib/openscap/xccdf/testresult.rb +1 -10
- data/lib/openscap/xccdf/value.rb +1 -10
- data/test/common/testcase.rb +2 -11
- data/test/data/sds-complex.xml +1 -1
- data/test/ds/arf_test.rb +2 -11
- data/test/ds/sds_test.rb +1 -10
- data/test/integration/arf_waiver_test.rb +1 -10
- data/test/openscap_test.rb +1 -10
- data/test/source_test.rb +1 -10
- data/test/text_test.rb +1 -10
- data/test/xccdf/arf_test.rb +1 -10
- data/test/xccdf/benchmark_test.rb +5 -14
- data/test/xccdf/policy_test.rb +1 -10
- data/test/xccdf/profile_test.rb +1 -10
- data/test/xccdf/session_ds_test.rb +1 -10
- data/test/xccdf/session_test.rb +1 -10
- data/test/xccdf/tailoring_test.rb +1 -10
- data/test/xccdf/testresult_test.rb +1 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c9d56737a95b91a18225def06b0f8a1d23a749e565b5dc302cc50e61f75ef87b
|
4
|
+
data.tar.gz: bd13f950489c98534bfbc4bc174196c449c1eece3c870dfb5dae4d88e2a11c0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8315dd1675d6589d21a7324e9b125136c2a39dae45e1be4a30a47f5ea031d06e266aef58d4dee67e58515319173f547fb7bdfab2d7a68527fde27d952069e01
|
7
|
+
data.tar.gz: df5b605d6d6bb2e995bc7f7e0358134c57ef9c32b9fb154ddcbcb26875f376644c3f132ccac0cb13a73d5e21a1d63197d812b017eb87b9ac596307e1035e591f
|
data/Rakefile
CHANGED
data/lib/openscap.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/openscap'
|
13
4
|
require 'openscap/exceptions'
|
data/lib/openscap/all.rb
CHANGED
@@ -1,12 +1,3 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
Dir.glob(File.join(File.dirname(__FILE__), '{xccdf,ds,}', '*.rb'), &method(:require))
|
data/lib/openscap/ds/arf.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/ds/sds'
|
13
4
|
require 'openscap/source'
|
@@ -57,6 +48,7 @@ module OpenSCAP
|
|
57
48
|
html_p = OpenSCAP.ds_rds_session_get_html_report @session
|
58
49
|
OpenSCAP.raise! if OpenSCAP.error?
|
59
50
|
return nil if html_p.null?
|
51
|
+
|
60
52
|
html = html_p.read_string
|
61
53
|
OpenSCAP::LibC.free html_p
|
62
54
|
html
|
data/lib/openscap/ds/sds.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/source'
|
13
4
|
|
data/lib/openscap/exceptions.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
module OpenSCAP
|
13
4
|
class OpenSCAPError < StandardError
|
data/lib/openscap/libc.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'ffi'
|
13
4
|
|
data/lib/openscap/openscap.rb
CHANGED
@@ -1,19 +1,10 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'ffi'
|
13
4
|
|
14
5
|
module OpenSCAP
|
15
6
|
extend FFI::Library
|
16
|
-
ffi_lib ['libopenscap.so.8', 'openscap']
|
7
|
+
ffi_lib ['libopenscap.so.8', 'libopenscap.so.25', 'openscap']
|
17
8
|
|
18
9
|
def self.error?
|
19
10
|
oscap_err
|
data/lib/openscap/source.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
|
@@ -37,9 +28,7 @@ module OpenSCAP
|
|
37
28
|
|
38
29
|
def validate!
|
39
30
|
e = FFI::MemoryPointer.new(:char, 4096)
|
40
|
-
unless OpenSCAP.oscap_source_validate(@raw, XmlReporterCallback, e).zero?
|
41
|
-
OpenSCAP.raise! e.read_string
|
42
|
-
end
|
31
|
+
OpenSCAP.raise!(e.read_string) unless OpenSCAP.oscap_source_validate(@raw, XmlReporterCallback, e).zero?
|
43
32
|
end
|
44
33
|
|
45
34
|
def save(filepath = nil)
|
data/lib/openscap/text.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
module OpenSCAP
|
13
4
|
class Text
|
data/lib/openscap/version.rb
CHANGED
@@ -1,14 +1,5 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2018 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
module OpenSCAP
|
13
|
-
VERSION = '0.4.
|
4
|
+
VERSION = '0.4.9'
|
14
5
|
end
|
data/lib/openscap/xccdf.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/openscap'
|
13
4
|
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/source'
|
13
4
|
require 'openscap/xccdf/profile'
|
data/lib/openscap/xccdf/fix.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
module OpenSCAP
|
13
4
|
module Xccdf
|
@@ -15,6 +6,7 @@ module OpenSCAP
|
|
15
6
|
def initialize(raw)
|
16
7
|
raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{raw}'" \
|
17
8
|
unless raw.is_a?(FFI::Pointer)
|
9
|
+
|
18
10
|
@raw = raw
|
19
11
|
end
|
20
12
|
|
data/lib/openscap/xccdf/group.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/exceptions'
|
13
4
|
require 'openscap/xccdf'
|
data/lib/openscap/xccdf/ident.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
module OpenSCAP
|
13
4
|
module Xccdf
|
@@ -15,6 +6,7 @@ module OpenSCAP
|
|
15
6
|
def initialize(raw)
|
16
7
|
raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{raw}'" \
|
17
8
|
unless raw.is_a?(FFI::Pointer)
|
9
|
+
|
18
10
|
@raw = raw
|
19
11
|
end
|
20
12
|
|
data/lib/openscap/xccdf/item.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/exceptions'
|
13
4
|
require 'openscap/text'
|
@@ -21,6 +12,7 @@ module OpenSCAP
|
|
21
12
|
def self.build(t)
|
22
13
|
raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with #{t}" \
|
23
14
|
unless t.is_a?(FFI::Pointer)
|
15
|
+
|
24
16
|
# This is Abstract base class that enables you to build its child
|
25
17
|
case OpenSCAP.xccdf_item_get_type t
|
26
18
|
when :group
|
@@ -36,6 +28,7 @@ module OpenSCAP
|
|
36
28
|
if self.class == OpenSCAP::Xccdf::Item
|
37
29
|
raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} abstract base class."
|
38
30
|
end
|
31
|
+
|
39
32
|
@raw = t
|
40
33
|
end
|
41
34
|
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/exceptions'
|
13
4
|
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/exceptions'
|
13
4
|
require 'openscap/xccdf/benchmark'
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/text'
|
13
4
|
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
module OpenSCAP
|
13
4
|
module Xccdf
|
@@ -15,6 +6,7 @@ module OpenSCAP
|
|
15
6
|
def initialize(raw)
|
16
7
|
raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{raw}'" \
|
17
8
|
unless raw.is_a?(FFI::Pointer)
|
9
|
+
|
18
10
|
@raw = raw
|
19
11
|
end
|
20
12
|
|
data/lib/openscap/xccdf/rule.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/exceptions'
|
13
4
|
require 'openscap/xccdf/item'
|
@@ -27,7 +18,7 @@ module OpenSCAP
|
|
27
18
|
:xccdf_medium => 'Medium',
|
28
19
|
:xccdf_high => 'High'
|
29
20
|
}
|
30
|
-
severity_mapping[severity]
|
21
|
+
severity_mapping[severity] || severity_mapping[:xccdf_unknown]
|
31
22
|
end
|
32
23
|
|
33
24
|
def fixes
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/exceptions'
|
13
4
|
require 'openscap/text'
|
@@ -1,19 +1,11 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
module OpenSCAP
|
13
4
|
module Xccdf
|
14
5
|
class Session
|
15
6
|
def initialize(input_filename)
|
16
7
|
raise OpenSCAPError, 'No filename specified!' unless input_filename
|
8
|
+
|
17
9
|
@input_filename = input_filename
|
18
10
|
@s = OpenSCAP.xccdf_session_new(input_filename)
|
19
11
|
OpenSCAP.raise! if @s.null?
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/source'
|
13
4
|
require 'openscap/xccdf/profile'
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/source'
|
13
4
|
require 'openscap/exceptions'
|
data/lib/openscap/xccdf/value.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap/exceptions'
|
13
4
|
require 'openscap/xccdf/item'
|
data/test/common/testcase.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'test/unit'
|
13
4
|
|
@@ -26,7 +17,7 @@ module OpenSCAP
|
|
26
17
|
end
|
27
18
|
|
28
19
|
def cleanup
|
29
|
-
@s
|
20
|
+
@s&.destroy
|
30
21
|
Dir.chdir '../..'
|
31
22
|
OpenSCAP.raise! if OpenSCAP.error?
|
32
23
|
OpenSCAP.oscap_cleanup
|
data/test/data/sds-complex.xml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<ds:data-stream-collection xmlns:ds="http://scap.nist.gov/schema/scap/source/1.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cat="urn:oasis:names:tc:entity:xmlns:xml:catalog" id="scap_org.open-scap_collection_from_xccdf_first-xccdf.xml" schematron-version="1.
|
2
|
+
<ds:data-stream-collection xmlns:ds="http://scap.nist.gov/schema/scap/source/1.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cat="urn:oasis:names:tc:entity:xmlns:xml:catalog" id="scap_org.open-scap_collection_from_xccdf_first-xccdf.xml" schematron-version="1.2">
|
3
3
|
<!-- This is bit more complex Datastream. The purpose is to test that scanner is able to find
|
4
4
|
* datastream-id scap_org.open-scap_datastream_tst2
|
5
5
|
* xccdf-id scap_org.open-scap_cref_second-xccdf.xml2
|
data/test/ds/arf_test.rb
CHANGED
@@ -1,20 +1,11 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'openscap/ds/arf'
|
14
5
|
require 'common/testcase'
|
15
6
|
|
16
7
|
class TestArf < OpenSCAP::TestCase
|
17
|
-
REPORT = 'report.rds.xml'
|
8
|
+
REPORT = 'report.rds.xml'
|
18
9
|
|
19
10
|
def test_arf_new_nil
|
20
11
|
msg = nil
|
data/test/ds/sds_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'openscap/source'
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'openscap/xccdf/benchmark'
|
data/test/openscap_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'common/testcase'
|
13
4
|
require 'openscap'
|
data/test/source_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'openscap/source'
|
data/test/text_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'openscap/text'
|
data/test/xccdf/arf_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'common/testcase'
|
13
4
|
require 'openscap'
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'common/testcase'
|
13
4
|
require 'openscap'
|
@@ -87,11 +78,11 @@ class TestBenchmark < OpenSCAP::TestCase
|
|
87
78
|
def test_items_references
|
88
79
|
b = benchmark_from_file
|
89
80
|
install_hids_rule = b.items['xccdf_org.ssgproject.content_rule_install_hids']
|
90
|
-
expected_references = [{ :title
|
91
|
-
:href
|
81
|
+
expected_references = [{ :title => 'SC-7',
|
82
|
+
:href => 'http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf',
|
92
83
|
:html_link => "<a href='http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf'>SC-7</a>" },
|
93
|
-
{ :title
|
94
|
-
:href
|
84
|
+
{ :title => '1263',
|
85
|
+
:href => 'http://iase.disa.mil/cci/index.html',
|
95
86
|
:html_link => "<a href='http://iase.disa.mil/cci/index.html'>1263</a>" }]
|
96
87
|
assert_equal(expected_references, install_hids_rule.references.map(&:to_hash), 'Install hids references should be equal')
|
97
88
|
b.destroy
|
data/test/xccdf/policy_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'common/testcase'
|
13
4
|
require 'openscap'
|
data/test/xccdf/profile_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'common/testcase'
|
13
4
|
require 'openscap'
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'common/testcase'
|
data/test/xccdf/session_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'common/testcase'
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014--2016 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'openscap/source'
|
@@ -1,13 +1,4 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2014 Red Hat Inc.
|
3
|
-
#
|
4
|
-
# This software is licensed to you under the GNU General Public License,
|
5
|
-
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
|
6
|
-
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
|
7
|
-
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
|
8
|
-
# along with this software; if not, see
|
9
|
-
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
10
|
-
#
|
1
|
+
# frozen_string_literal: true
|
11
2
|
|
12
3
|
require 'openscap'
|
13
4
|
require 'openscap/source'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openscap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Lukasik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.6.
|
119
|
+
rubygems_version: 2.7.6.2
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: A FFI wrapper around the OpenSCAP library
|