class ForemanScapClient::Client
Attributes
tailored[R]
Private Instance Methods
ensure_policy_exists()
click to toggle source
Calls superclass method
ForemanScapClient::BaseClient#ensure_policy_exists
# File lib/foreman_scap_client/client.rb, line 18 def ensure_policy_exists super @tailored = policy_from_config[:tailoring_path] && !policy_from_config[:tailoring_path].empty? end
ensure_scan_file()
click to toggle source
# File lib/foreman_scap_client/client.rb, line 51 def ensure_scan_file ensure_file :content_path, :download_path, "SCAP content" end
ensure_scan_files()
click to toggle source
# File lib/foreman_scap_client/client.rb, line 23 def ensure_scan_files ensure_scan_file ensure_tailoring_file if tailored end
ensure_tailoring_file()
click to toggle source
# File lib/foreman_scap_client/client.rb, line 55 def ensure_tailoring_file ensure_file :tailoring_path, :tailoring_download_path, "Tailoring file" end
policy_from_config()
click to toggle source
remove when we have made changes to puppet module/ansible role to start namespacing existing ds policies in config
Calls superclass method
ForemanScapClient::BaseClient#policy_from_config
# File lib/foreman_scap_client/client.rb, line 14 def policy_from_config super || @config[policy_id] end
policy_namespace()
click to toggle source
# File lib/foreman_scap_client/client.rb, line 9 def policy_namespace :ds end
scan_command()
click to toggle source
# File lib/foreman_scap_client/client.rb, line 28 def scan_command if config[@policy_id] && config[@policy_id][:profile] && !config[@policy_id][:profile].empty? profile = "--profile #{config[@policy_id][:profile]}" else profile = '' end fetch_remote_resources = if config[:fetch_remote_resources] '--fetch-remote-resources' else '' end "oscap xccdf eval #{fetch_remote_resources} #{profile} #{tailoring_subcommand} --results-arf #{results_path} #{config[@policy_id][:content_path]}" end
tailoring_subcommand()
click to toggle source
# File lib/foreman_scap_client/client.rb, line 42 def tailoring_subcommand tailored ? "--tailoring-file #{config[policy_id][:tailoring_path]}" : "" end
upload_uri()
click to toggle source
# File lib/foreman_scap_client/client.rb, line 47 def upload_uri foreman_proxy_uri + "/compliance/arf/#{@policy_id}" end