Class: Proxy::OpenSCAP::Parse

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_proxy_openscap/openscap_report_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(arf_data) ⇒ Parse

Returns a new instance of Parse.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/smart_proxy_openscap/openscap_report_parser.rb', line 12

def initialize(arf_data)
  OpenSCAP.oscap_init
  size         = arf_data.size
  @arf_digest  = Digest::SHA256.hexdigest(arf_data)
  @arf         = OpenSCAP::DS::Arf.new(:content => arf_data, :path => 'arf.xml.bz2', :length => size)
  @results     = @arf.test_result.rr
  sds          = @arf.report_request
  bench_source = sds.select_checklist!
  @bench       = OpenSCAP::Xccdf::Benchmark.new(bench_source)
  @items       = @bench.items
end

Instance Method Details

#as_jsonObject



24
25
26
# File 'lib/smart_proxy_openscap/openscap_report_parser.rb', line 24

def as_json
  parse_report.to_json
end