Sha256: 66fcb764c5fae994c08fb4e22a86f4c846bf5ef91320da6655072f7c60b4e87f

Contents?: true

Size: 1.24 KB

Versions: 5

Compression:

Stored size: 1.24 KB

Contents

# encoding: utf-8
# copyright: 2015, Vulcano Security GmbH

module Inspec::Resources
  class Apache < Inspec.resource(1)
    name 'apache'
    supports platform: 'unix'
    desc 'Use the apache InSpec audit resource to retrieve Apache environment settings.'
    example "
      describe apache do
        its ('service') { should cmp 'apache2' }
      end

      describe apache do
        its ('conf_dir') { should cmp '/etc/apache2' }
      end

      describe apache do
        its ('conf_path') { should cmp '/etc/apache2/apache2.conf' }
      end

      describe apache do
        its ('user') { should cmp 'www-data' }
      end
    "

    attr_reader :service, :conf_dir, :conf_path, :user
    def initialize
      warn '[DEPRECATED] The `apache` resource is deprecated and will be removed in InSpec 3.0.'

      if inspec.os.debian?
        @service = 'apache2'
        @conf_dir = '/etc/apache2/'
        @conf_path = File.join @conf_dir, 'apache2.conf'
        @user = 'www-data'
      else
        @service = 'httpd'
        @conf_dir = '/etc/httpd/'
        @conf_path = File.join @conf_dir, '/conf/httpd.conf'
        @user = 'apache'
      end
    end

    def to_s
      'Apache Environment'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inspec-2.1.81 lib/resources/apache.rb
inspec-2.1.21 lib/resources/apache.rb
inspec-2.1.10 lib/resources/apache.rb
inspec-2.0.32 lib/resources/apache.rb
inspec-2.0.17 lib/resources/apache.rb