Sha256: dd4e09f15b0c55ce057f07df1700a6968823313f8736e5782d9f4eaf20f99600

Contents?: true

Size: 1.68 KB

Versions: 12

Compression:

Stored size: 1.68 KB

Contents

# frozen_string_literal: true

module Neetob
  class CLI
    module MonthlyAudit
      module InstancesAndAddons
        module NeetoDeploy
          class ScheduledExportsEnabled < CLI::Base
            def initialize
              super()
            end

            def run
              ui.success "### 3.1.5. Checking whether scheduled exports are enabled"

              apps_data = [["App", "Scheduled exports config", "Comments", "Audit Passed"]]
              ui.info("\n", print_to_audit_log: false)
              Neetob::CLI::Sre::Base::APPS_LIST[:neetodeploy].select { |app| app.include?("production") }.each do |app|
                ui.info("Checking Scheduled exports config for #{app}", print_to_audit_log: false)
                scheduled_exports_result = Neetob::CLI::NeetoDeploy::ScheduledExports.new(app).run
                audit_passed = nil
                comments = nil
                scheduled_exports_config = nil
                if scheduled_exports_result.include? "Forbidden"
                  audit_passed = "No"
                  comments = "You do not have permission to access the config for this app."
                else
                  scheduled_exports_config = scheduled_exports_result.gsub("\e[32m", "").gsub("\e[0m", "").strip
                  audit_passed = scheduled_exports_config.include?("turned on") ? "Yes" : "No"
                  if audit_passed == "No"
                    comments = scheduled_exports_config
                  end
                end
                apps_data << [app, scheduled_exports_config, comments, audit_passed]
              end
              ui.print_table(apps_data)
            end
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
neetob-0.5.28 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.27 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.26 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.25 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.24 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.23 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.22 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.21 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.20 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.19 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.18 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
neetob-0.5.17 lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb