This repository has been archived by the owner on May 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
environment.rb
34 lines (29 loc) · 1.92 KB
/
environment.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'bundler'
Bundler.require(:default)
ROOT = File.dirname(__FILE__)
Dir[File.join(ROOT, 'garrison/lib/*.rb')].each do |file|
require file
end
Dir[File.join(ROOT, 'garrison/checks/*.rb')].each do |file|
require file
end
Garrison::Api.configure do |config|
config.url = ENV['GARRISON_URL']
config.uuid = ENV['GARRISON_AGENT_UUID']
end
Garrison::Logging.info('Garrison Agent - AWS Inspector')
module Garrison
module Checks
@options = {}
@options[:regions] = ENV['GARRISON_AWS_REGIONS'] ? ENV['GARRISON_AWS_REGIONS'].split(',') : nil
@options[:rules_packages] = ENV['GARRISON_AWS_INSPECTOR_RULES_PACKAGE_NAMES'] ? ENV['GARRISON_AWS_INSPECTOR_RULES_PACKAGE_NAMES'].split(',') : nil
@options[:severity_threshold] = ENV['GARRISON_AWS_INSPECTOR_THRESHOLD'] ? ENV['GARRISON_AWS_INSPECTOR_THRESHOLD'].split(',') : nil
@options[:excluded_cis_rules] = {}
@options[:excluded_cis_rules][:amazon_linux] = ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_AMAZON_LINUX'] ? ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_AMAZON_LINUX'].split(',') : []
@options[:excluded_cis_rules][:amazon_linux_2] = ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_AMAZON_LINUX_2'] ? ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_AMAZON_LINUX_2'].split(',') : []
@options[:excluded_cis_rules][:centos_6] = ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_CENTOS_6'] ? ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_CENTOS_6'].split(',') : []
@options[:excluded_cis_rules][:centos_7] = ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_CENTOS_7'] ? ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_CENTOS_7'].split(',') : []
@options[:excluded_cis_rules][:ubuntu_trusty] = ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_UBUNTU_TRUSTY'] ? ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_UBUNTU_TRUSTY'].split(',') : []
@options[:excluded_cis_rules][:ubuntu_xenial] = ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_UBUNTU_XENIAL'] ? ENV['GARRISON_AWS_INSPECTOR_EXCLUDED_CIS_UBUNTU_XENIAL'].split(',') : []
end
end