Module: AbideDevUtils::XCCDF
- Defined in:
- lib/abide_dev_utils/xccdf.rb,
lib/abide_dev_utils/xccdf/diff.rb,
lib/abide_dev_utils/xccdf/utils.rb,
lib/abide_dev_utils/xccdf/parser.rb,
lib/abide_dev_utils/xccdf/parser/helpers.rb,
lib/abide_dev_utils/xccdf/parser/objects.rb,
lib/abide_dev_utils/xccdf/parser/objects/diffable_object.rb,
lib/abide_dev_utils/xccdf/parser/objects/numbered_object.rb
Overview
Contains modules and classes for working with XCCDF files
Defined Under Namespace
Modules: Common, Diff, Parser, Utils Classes: Benchmark, CisControl, CisControls, ObjectContainer, Profile, Profiles, StigControl, StigControls, XccdfElement, XccdfObject
Class Method Summary collapse
-
.diff(file1, file2, opts) ⇒ Object
Diffs two xccdf files.
-
.gen_map(xccdf_file, **opts) ⇒ Object
Generate map for SCE.
-
.to_hiera(xccdf_file, opts) ⇒ Object
Converts and xccdf file to a Hiera representation.
Class Method Details
.diff(file1, file2, opts) ⇒ Object
Diffs two xccdf files
36 37 38 39 |
# File 'lib/abide_dev_utils/xccdf.rb', line 36 def self.diff(file1, file2, opts) require 'abide_dev_utils/xccdf/diff' AbideDevUtils::XCCDF::Diff.benchmark_diff(file1, file2, opts) end |
.gen_map(xccdf_file, **opts) ⇒ Object
Generate map for SCE
14 15 16 17 18 19 20 21 22 |
# File 'lib/abide_dev_utils/xccdf.rb', line 14 def self.gen_map(xccdf_file, **opts) type = opts.fetch(:type, 'cis') case type.downcase when /cis|stig/ Benchmark.new(xccdf_file).gen_map(**opts) else raise AbideDevUtils::Errors::UnsupportedXCCDFError, "XCCDF type #{type} is unsupported!" end end |
.to_hiera(xccdf_file, opts) ⇒ Object
Converts and xccdf file to a Hiera representation
25 26 27 28 29 30 31 32 33 |
# File 'lib/abide_dev_utils/xccdf.rb', line 25 def self.to_hiera(xccdf_file, opts) type = opts.fetch(:type, 'cis') case type.downcase when 'cis' Benchmark.new(xccdf_file).to_hiera(**opts) else raise AbideDevUtils::Errors::UnsupportedXCCDFError, "XCCDF type #{type} is unsupported!" end end |