Move some resources into Inspec::Resources module

The `DhParams`, `EtcHosts`, `GrubConfig`, `IisAppPool`, and `SSL`
resources were not properly located inside the `Inspec::Resources`
module.

Fixes: #4327

Signed-off-by: Kris Shannon <k.shannon@amaze.com.au>
This commit is contained in:
Kris Shannon 2019-08-05 18:17:01 +10:00
parent 723d53e6b1
commit 4a30a8aa32
5 changed files with 505 additions and 495 deletions

View file

@ -1,6 +1,7 @@
require "openssl" require "openssl"
require "inspec/utils/file_reader" require "inspec/utils/file_reader"
module Inspec::Resources
class DhParams < Inspec.resource(1) class DhParams < Inspec.resource(1)
name "dh_params" name "dh_params"
supports platform: "unix" supports platform: "unix"
@ -79,3 +80,4 @@ class DhParams < Inspec.resource(1)
"dh_params #{@dh_params_path}" "dh_params #{@dh_params_path}"
end end
end end
end

View file

@ -1,6 +1,7 @@
require "inspec/utils/parser" require "inspec/utils/parser"
require "inspec/utils/file_reader" require "inspec/utils/file_reader"
module Inspec::Resources
class EtcHosts < Inspec.resource(1) class EtcHosts < Inspec.resource(1)
name "etc_hosts" name "etc_hosts"
supports platform: "linux" supports platform: "linux"
@ -60,3 +61,4 @@ class EtcHosts < Inspec.resource(1)
->(data) { %w{ip_address primary_name all_host_names}.zip(data).to_h } ->(data) { %w{ip_address primary_name all_host_names}.zip(data).to_h }
end end
end end
end

View file

@ -1,6 +1,7 @@
require "inspec/utils/simpleconfig" require "inspec/utils/simpleconfig"
require "inspec/utils/file_reader" require "inspec/utils/file_reader"
module Inspec::Resources
class GrubConfig < Inspec.resource(1) class GrubConfig < Inspec.resource(1)
name "grub_conf" name "grub_conf"
supports platform: "unix" supports platform: "unix"
@ -226,3 +227,4 @@ class GrubConfig < Inspec.resource(1)
@params @params
end end
end end
end

View file

@ -5,6 +5,7 @@ require "inspec/resources/powershell"
# check for web applications in IIS # check for web applications in IIS
# Note: this is only supported in windows 2012 and later # Note: this is only supported in windows 2012 and later
module Inspec::Resources
class IisAppPool < Inspec.resource(1) class IisAppPool < Inspec.resource(1)
name "iis_app_pool" name "iis_app_pool"
desc "Tests IIS application pool configuration on windows." desc "Tests IIS application pool configuration on windows."
@ -127,3 +128,4 @@ class IisAppPool < Inspec.resource(1)
} }
end end
end end
end

View file

@ -6,6 +6,7 @@ require "uri"
require "parallel" require "parallel"
# Custom resource based on the InSpec resource DSL # Custom resource based on the InSpec resource DSL
module Inspec::Resources
class SSL < Inspec.resource(1) class SSL < Inspec.resource(1)
name "ssl" name "ssl"
supports platform: "unix" supports platform: "unix"
@ -95,3 +96,4 @@ class SSL < Inspec.resource(1)
end.flatten end.flatten
end end
end end
end