Sha256: 0443af42707121c868093a1ec40faa0449294f2eba42d52cd4beda540f4e0e6a

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

#!/usr/bin/env ruby

require 'aws_security_viz'
require 'trollop'

opts = Trollop::options do
  opt :access_key, 'AWS access key', :default => ENV['AWS_ACCESS_KEY'] || ENV['AWS_ACCESS_KEY_ID'], :type => :string
  opt :secret_key, 'AWS secret key', :default => ENV['AWS_SECRET_KEY'] || ENV['AWS_SECRET_ACCESS_KEY'], :type => :string
  opt :region, 'AWS region to query', :default => 'us-east-1', :type => :string
  opt :source_file, 'JSON source file containing security groups', :type => :string
  opt :filename, 'Output file name', :type => :string, :default => 'aws-security-viz.png'
  opt :config, 'Config file (opts.yml)', :type => :string, :default => 'opts.yml'
  opt :color, 'Colored node edges', :default => false
  opt :source_filter, 'Source filter', :default => nil, :type => :string
  opt :target_filter, 'Target filter', :default => nil, :type => :string
end

cmd = ARGV.shift
if cmd=="setup"
  AwsConfig.write(opts[:config])
  puts "#{opts[:config]} created in current directory."
  exit
end

config = AwsConfig.load(opts[:config]).merge(obfuscate: ENV['OBFUSCATE'], debug: ENV['DEBUG'])
begin
  VisualizeAws.new(config, opts).unleash(opts[:filename])
rescue Exception => e
  puts "[ERROR] #{e.message}"
  exit 1
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aws_security_viz-0.1.5.pre.alpha.pre.85 exe/aws_security_viz
aws_security_viz-0.1.5.pre.alpha.pre.84 exe/aws_security_viz