Sha256: 56c136c6a4958d6a03a2173cc3fe7f2e7850417dc9499bf8ab854baf8b9bf470
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
require 'linux_admin' module ManageIQ module ApplianceConsole class Scap def initialize(rules_dir) @rules_dir = rules_dir end def lockdown if packages_installed? && config_exists? say("Locking down the appliance for SCAP...") require 'yaml' scap_config = YAML.load_file(yaml_filename) begin LinuxAdmin::Scap.new("rhel8").lockdown(*scap_config['rules'], scap_config['values']) rescue => e say("Configuration failed: #{e.message}") else say("Complete") end end end private def yaml_filename File.expand_path("scap_rules.yml", @rules_dir) end def packages_installed? if !LinuxAdmin::Scap.openscap_available? say("OpenSCAP has not been installed") false elsif !LinuxAdmin::Scap.ssg_available?("rhel8") say("SCAP Security Guide has not been installed") false else true end end def config_exists? if File.exist?(yaml_filename) true else say("SCAP rules configuration file missing") false end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
manageiq-appliance_console-5.3.0 | lib/manageiq/appliance_console/scap.rb |