Sha256: 837360ea57bda8964bd64d2373b876a9b4e5e87d59391bc63119ef20e5681ce2

Contents?: true

Size: 1.14 KB

Versions: 66

Compression:

Stored size: 1.14 KB

Contents

require 'metadata/ScanProfile/ScanProfilesBase'
require 'metadata/ScanProfile/VmScanProfile'
require 'metadata/ScanProfile/VmScanItem'

class VmScanProfiles < ScanProfilesBase
  SCAN_TYPE_CATEGORY = "category"
  SCAN_TYPE_REGISTRY = "registry"

  SCAN_ITEM_CATEGORIES = "categories"

  def get_categories
    categories = []
    # Get data from each "category" scan item
    each_scan_definition(SCAN_TYPE_CATEGORY) do |sd|
      # Add the target items from the content array
      sd["content"].each { |si| categories << si["target"] } unless sd["content"].nil?
    end
    if categories.empty?
      categories = @options[SCAN_ITEM_CATEGORIES].split(",") if @options[SCAN_ITEM_CATEGORIES]
    end
    categories.each do |c|
      c.delete!("\"")
      c.strip!
    end
    categories << "profiles"
    categories.uniq
  end

  def get_registry_filters
    reg_filters = Hash.new { |h, k| h[k] = [] }
    each_scan_definition(SCAN_TYPE_REGISTRY) do |sd|
      # Add the target items from the content array and
      # split the registry request into hive/key
      sd["content"].each { |si| reg_filters[si["hive"].to_sym] << si }
    end
    reg_filters
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
manageiq-smartstate-0.10.1 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.10.0 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.9.0 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.8.1 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.8.0 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.7.0 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.6.2 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.5.10 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.3.10 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.6.1 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.3.9 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.6.0 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.5.9 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.5.8 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.3.8 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.5.7 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.3.7 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.5.6 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.3.6 lib/metadata/ScanProfile/VmScanProfiles.rb
manageiq-smartstate-0.5.5 lib/metadata/ScanProfile/VmScanProfiles.rb