Class: Scaptimony::ScapContent

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/scaptimony/scap_content.rb

Instance Method Summary collapse

Instance Method Details

#benchmark_profilesObject

returns OpenSCAP::Xccdf::Benchmark with profiles.



62
63
64
65
66
67
68
# File 'app/models/scaptimony/scap_content.rb', line 62

def benchmark_profiles
  sds          = ::OpenSCAP::DS::Sds.new(source)
  bench_source = sds.select_checklist!
  benchmark = ::OpenSCAP::Xccdf::Benchmark.new(bench_source)
  sds.destroy
  benchmark
end

#digestObject



57
58
59
# File 'app/models/scaptimony/scap_content.rb', line 57

def digest
  self[:digest] ||= Digest::SHA256.hexdigest "#{scap_file}"
end

#sourceObject



53
54
55
# File 'app/models/scaptimony/scap_content.rb', line 53

def source
  @source ||= source_init
end

#to_labelObject



49
50
51
# File 'app/models/scaptimony/scap_content.rb', line 49

def to_label
  title
end