Sha256: 95ca296e573380d7ac9b3a44d96d8da543d2c1f83c56e7a1d16cf8a5a7a6d844

Contents?: true

Size: 920 Bytes

Versions: 3

Compression:

Stored size: 920 Bytes

Contents

require 'opsworks/permission'

module OpsWorks
  module CLI
    module Subcommands
      module Lockdown
        # rubocop:disable MethodLength
        # rubocop:disable CyclomaticComplexity
        def self.included(thor)
          thor.class_eval do
            desc 'lockdown [--stack STACK]', 'Remove all stack permissions'
            option :stack, type: :array
            def lockdown
              fetch_keychain_credentials unless env_credentials?
              stacks = parse_stacks(options.merge(active: true))
              stacks.each do |stack|
                say "Locking down #{stack.name}..."
                stack.permissions.each do |permission|
                  permission.update(ssh: false, sudo: false)
                end
              end
            end
          end
        end
        # rubocop:enable CyclomaticComplexity
        # rubocop:enable MethodLength
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opsworks-cli-0.2.4 lib/opsworks/cli/subcommands/lockdown.rb
opsworks-cli-0.2.3 lib/opsworks/cli/subcommands/lockdown.rb
opsworks-cli-0.2.2 lib/opsworks/cli/subcommands/lockdown.rb