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.



379
380
381
382
# File 'lib/abide_dev_utils/xccdf.rb', line 379

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

Instance Method Details

#control_classObject



406
407
408
409
410
411
412
413
414
415
# File 'lib/abide_dev_utils/xccdf.rb', line 406

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

#control_sort_keyObject



395
396
397
398
399
400
401
402
403
404
# File 'lib/abide_dev_utils/xccdf.rb', line 395

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

#controls_classObject



384
385
386
387
388
389
390
391
392
393
# File 'lib/abide_dev_utils/xccdf.rb', line 384

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