2015-10-26 21:41:02 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
# copyright: 2015, Vulcano Security GmbH
|
|
|
|
# author: Christoph Hartmann
|
|
|
|
# author: Dominik Richter
|
|
|
|
|
2016-03-08 18:06:55 +00:00
|
|
|
module Inspec::Resources
|
|
|
|
class Apache < Inspec.resource(1)
|
|
|
|
name 'apache'
|
2015-10-26 21:41:02 +00:00
|
|
|
|
2016-03-08 18:06:55 +00:00
|
|
|
attr_reader :service, :conf_dir, :conf_path, :user
|
|
|
|
def initialize
|
2016-08-03 17:18:24 +00:00
|
|
|
if inspec.os.debian?
|
2016-03-08 18:06:55 +00:00
|
|
|
@service = 'apache2'
|
|
|
|
@conf_dir = '/etc/apache2/'
|
2016-03-09 09:39:07 +00:00
|
|
|
@conf_path = File.join @conf_dir, 'apache2.conf'
|
2016-03-08 18:06:55 +00:00
|
|
|
@user = 'www-data'
|
|
|
|
else
|
|
|
|
@service = 'httpd'
|
|
|
|
@conf_dir = '/etc/httpd/'
|
2016-03-09 09:39:07 +00:00
|
|
|
@conf_path = File.join @conf_dir, '/conf/httpd.conf'
|
2016-03-08 18:06:55 +00:00
|
|
|
@user = 'apache'
|
|
|
|
end
|
2015-10-26 21:41:02 +00:00
|
|
|
end
|
|
|
|
|
2016-03-08 18:06:55 +00:00
|
|
|
def to_s
|
|
|
|
'Apache Environment'
|
|
|
|
end
|
2015-10-26 21:41:02 +00:00
|
|
|
end
|
|
|
|
end
|