Class: AbideDevUtils::XCCDF::XccdfObject

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/abide_dev_utils/xccdf.rb

Direct Known Subclasses

ObjectContainer, XccdfElement

Constant Summary

Constants included from Common

Common::CIS_CONTROL_NUMBER, Common::CIS_CONTROL_PARTS, Common::CIS_LEVEL_CODE, Common::CIS_NEXT_GEN_WINDOWS, Common::CIS_PROFILE_PARTS, Common::CIS_TITLE_MARKER, Common::CONTROL_PARTS, Common::CONTROL_PREFIX, Common::PROFILE_PARTS, Common::STIG_CONTROL_PARTS, Common::STIG_PROFILE_PARTS, Common::STIG_TITLE_MARKER, Common::UNDERSCORED, Common::XPATHS

Instance Method Summary collapse

Methods included from Common

#==, #abide_object?, #control_parts, #control_profile_text, #name_normalize_control, #normalize_control_name, #normalize_profile_name, #normalize_string, #number_normalize_control, #profile_parts, #text_normalize, #validate_xccdf, #xpath

Constructor Details

#initialize(benchmark) ⇒ XccdfObject

Returns a new instance of XccdfObject.



387
388
389
390
# File 'lib/abide_dev_utils/xccdf.rb', line 387

def initialize(benchmark)
  @benchmark = benchmark
  @benchmark_type = benchmark_type
end

Instance Method Details

#control_classObject



414
415
416
417
418
419
420
421
422
423
# File 'lib/abide_dev_utils/xccdf.rb', line 414

def control_class
  case @benchmark_type
  when :cis
    CisControl
  when :stig
    StigControl
  else
    raise AbideDevUtils::Errors::UnsupportedXCCDFError
  end
end

#control_sort_keyObject



403
404
405
406
407
408
409
410
411
412
# File 'lib/abide_dev_utils/xccdf.rb', line 403

def control_sort_key
  case @benchmark_type
  when :cis
    :number
  when :stig
    :vulnid
  else
    raise AbideDevUtils::Errors::UnsupportedXCCDFError
  end
end

#controls_classObject



392
393
394
395
396
397
398
399
400
401
# File 'lib/abide_dev_utils/xccdf.rb', line 392

def controls_class
  case @benchmark_type
  when :cis
    CisControls
  when :stig
    StigControls
  else
    raise AbideDevUtils::Errors::UnsupportedXCCDFError
  end
end