aws_security_viz 0.1.0 → 0.1.1.pre.alpha.pre.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c14a384a5ea5c2f6781421821503487e9a2e5c23
4
- data.tar.gz: 46669dc4475ba76b990be7f2ba6718871b72f06d
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODBhM2UxNDE5N2MwNDUzNmI3MjA2OTE4ODk2NTgxNGY0YjIwNjIyOQ==
5
+ data.tar.gz: !binary |-
6
+ OWJiZjYyMjc2Y2VhM2MxODkzMDhlZmE1MDY0MThmYWQ2ZmRlZjU1Yw==
5
7
  SHA512:
6
- metadata.gz: c59a023f8c48ebd6e98207bb36003bb9fa581f9936ee85c85d4fc6a6f8cd7a761d5e6645fe72d37452e5a4a605c4be68f0ef0bc807085ab3622c80df48262e19
7
- data.tar.gz: fe1d7db0623bb22c357e0305dc631752c188b56152337eeee93ce567969a2e927400fb40b0e5863f69ee9cf7514864f96b109f466bb4aa9ac9fe2824af68dd71
8
+ metadata.gz: !binary |-
9
+ ZDE1ZTJiZjExY2M2ZmNmNmQxYTM2OTJhNzY1MjM0YzUwNTljNmJkZGFkZmE4
10
+ ZjIwYjZhYzE4ZWNmYzgzNTlhMTU0MTQ3MWIwMzMxNjhiMmMwNmJlZmJmYmM1
11
+ ZWU5ODljNWExOTYxMmU4ZWQ5YWM4ZWM3ZWJlMGY4YWFlM2MyMWQ=
12
+ data.tar.gz: !binary |-
13
+ NDcyNzRmODg1MjkyNTkyMTk4MTg2NzBiZTU2NWJkNTkyMmRlZTViNWJiNDcz
14
+ N2FiNzhjZTZkY2I1Yzc4MWI2ZDNmOWU3MzRmYjNhNTZmNDAyNDFiMWM5YzY3
15
+ YTUzNzQzOTdlNTdkNzFhNzhiN2JiYmEzOTk3MDE2Y2RlNWI2MWQ=
@@ -1,6 +1,21 @@
1
1
  language: ruby
2
+
2
3
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.2
4
+ - 2.0.0
5
+ - 2.1.2
6
+
6
7
  script: bundle exec rspec spec --tag '~integration'
8
+
9
+ before_install: gem install bundler
10
+
11
+ cache: bundler
12
+
13
+ sudo: false
14
+
15
+ deploy:
16
+ provider: rubygems
17
+ api_key:
18
+ secure: FolEBkQI4oiqjZMzuZ/ELSJFxwCrUTmVhew+tr8yrDONOgphjvbOkDFMdPKnM48nMBekz0lS/yh6Ib5JXe0gxk6+fUq/37eNVF7eFc9poTJhJ2I6zkYOunxSTDInLy/Hxl90RXjKNnL+PFNPPZjLSXrUWeUxLViI00Dkfa9iT6s=
19
+ gem: aws_security_viz
20
+ on:
21
+ repo: anaynayak/aws-security-viz
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  aws-security-viz -- A tool to visualize aws security groups
2
2
  ============================================================
3
-
4
- [![Build Status](https://secure.travis-ci.org/anaynayak/aws-security-viz.png)](http://travis-ci.org/anaynayak/aws-security-viz) [![Code Climate](https://codeclimate.com/github/anaynayak/aws-security-viz.png)](https://codeclimate.com/github/anaynayak/aws-security-viz) [![Dependency Status](https://gemnasium.com/anaynayak/aws-security-viz.png)](https://gemnasium.com/anaynayak/aws-security-viz)
3
+ [![Build Status](https://secure.travis-ci.org/anaynayak/aws-security-viz.png)](http://travis-ci.org/anaynayak/aws-security-viz)
4
+ [![Gem Version](https://badge.fury.io/rb/aws_security_viz.svg)](https://badge.fury.io/rb/aws_security_viz)
5
+ [![Code Climate](https://codeclimate.com/github/anaynayak/aws-security-viz.png)](https://codeclimate.com/github/anaynayak/aws-security-viz)
6
+ [![Dependency Status](https://gemnasium.com/anaynayak/aws-security-viz.png)](https://gemnasium.com/anaynayak/aws-security-viz)
5
7
 
6
8
  ## DESCRIPTION
7
9
  Need a quick way to visualize your current aws/amazon ec2 security group configuration? aws-security-viz does just that based on the EC2 security group ingress configuration.
@@ -13,9 +15,9 @@ aws-security-viz -- A tool to visualize aws security groups
13
15
 
14
16
  ## INSTALLATION
15
17
  ```
16
- $ bundle install
18
+ $ gem install aws_security_viz
19
+ $ aws_security_viz --help
17
20
  ```
18
- ([Bundler installation](http://gembundler.com/bundle_install.html))
19
21
 
20
22
  ## DEPENDENCIES
21
23
 
@@ -25,32 +27,49 @@ aws-security-viz -- A tool to visualize aws security groups
25
27
  ## USAGE
26
28
 
27
29
  To generate the graph directly using AWS keys
30
+
28
31
  ```
29
- $ bundle exec ruby lib/visualize_aws.rb -a your_aws_key -s your_aws_secret_key -f viz.svg --color=true
32
+ $ aws_security_viz -a your_aws_key -s your_aws_secret_key -f viz.svg --color=true
30
33
  ```
31
34
 
32
35
  To generate the graph using an existing security_groups.json (created using aws-cli)
36
+
33
37
  ```
34
- $ bundle exec ruby lib/visualize_aws.rb -o data/security_groups.json -f viz.svg --color
38
+ $ aws_security_viz -o data/security_groups.json -f viz.svg --color
35
39
  ```
36
40
 
37
41
  ```
38
- $ bundle exec ruby lib/visualize_aws.rb --help
42
+ $ aws_security_viz --help
39
43
  Options:
40
44
  -a, --access-key=<s> AWS access key
41
45
  -s, --secret-key=<s> AWS secret key
42
46
  -r, --region=<s> AWS region to query (default: us-east-1)
43
47
  -o, --source-file=<s> JSON source file containing security groups
44
48
  -f, --filename=<s> Output file name (default: aws-security-viz.png)
45
- -c, --color Colored node edges
49
+ -c, --config=<s> Config file (opts.yml) (default: opts.yml)
50
+ -l, --color Colored node edges
46
51
  -h, --help Show this message
47
52
  ```
53
+
54
+ #### Advanced configuration
55
+
56
+ You can generate a configuration file using the following command:
57
+ ```
58
+ $ aws_security_viz setup [-c opts.yml]
59
+ ```
60
+
61
+ The opts.yml file lets you define the following options:
62
+
63
+ * Grouping of CIDR ips
64
+ * Define exclusion patterns
65
+ * Change graphviz format (neato, dot, sfdp etc)
66
+
48
67
  ## DEBUGGING
49
68
 
50
69
  To generate the graph with debug statements, execute the following command
51
70
 
52
71
  ```
53
- $ DEBUG=true bundle exec ruby lib/visualize_aws.rb -a your_aws_key -s your_aws_secret_key -f viz.svg
72
+ $ DEBUG=true aws_security_viz -a your_aws_key -s your_aws_secret_key -f viz.svg
54
73
  ```
55
74
 
56
75
  If it doesn't indicate the problem, please share the generated json file with me @ whynospam-awsviz@yahoo.co.in
@@ -58,7 +77,7 @@ If it doesn't indicate the problem, please share the generated json file with me
58
77
  You can send me an obfuscated version using the following command:
59
78
 
60
79
  ```
61
- $ DEBUG=true OBFUSCATE=true bundle exec ruby lib/visualize_aws.rb -a your_aws_key -s your_aws_secret_key -f viz.svg
80
+ $ DEBUG=true OBFUSCATE=true aws_security_viz -a your_aws_key -s your_aws_secret_key -f viz.svg
62
81
  ```
63
82
 
64
83
  Execute the following command to generate the json. You will need [aws-cli](https://github.com/aws/aws-cli) to execute the command
@@ -5,6 +5,7 @@ require 'version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'aws_security_viz'
7
7
  s.version = AwsSecurityViz::VERSION
8
+ s.version = "#{s.version}-alpha-#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
8
9
  s.date = '2015-10-15'
9
10
  s.summary = "Visualize your aws security groups"
10
11
  s.description = "Provides a quick mechanism to visualize your EC2 security groups in multiple formats"
@@ -21,14 +22,16 @@ Gem::Specification.new do |s|
21
22
  s.require_paths = ["lib"]
22
23
 
23
24
  s.add_development_dependency "bundler", "~> 1.9"
24
- s.add_development_dependency "rake", "~> 10.0"
25
- s.add_development_dependency "rspec", "~> 3.1.0"
25
+ s.add_development_dependency "rake", "~> 10.4.2"
26
+ s.add_development_dependency "rspec", "~> 3.3.0"
26
27
 
27
- s.add_runtime_dependency 'ruby-graphviz', "~> 1.2.1"
28
- s.add_runtime_dependency 'fog', "~> 1.26.0"
28
+ s.add_runtime_dependency 'ruby-graphviz', "~> 1.2.2"
29
+ s.add_runtime_dependency 'fog-aws', "~> 0.7.6"
29
30
  s.add_runtime_dependency 'unf', "~> 0.1.4"
30
- s.add_runtime_dependency 'json', "~> 1.8.1"
31
- s.add_runtime_dependency 'trollop', "~> 2.1.1"
31
+ s.add_runtime_dependency 'json', "~> 1.8.3"
32
+ s.add_runtime_dependency 'trollop', "~> 2.1.2"
32
33
  s.add_runtime_dependency 'organic_hash', "~> 1.0.2"
34
+
35
+ s.required_ruby_version = '>= 2.0.0'
33
36
  end
34
37
 
@@ -9,13 +9,22 @@ opts = Trollop::options do
9
9
  opt :region, 'AWS region to query', :default => 'us-east-1', :type => :string
10
10
  opt :source_file, 'JSON source file containing security groups', :type => :string
11
11
  opt :filename, 'Output file name', :type => :string, :default => 'aws-security-viz.png'
12
+ opt :config, 'Config file (opts.yml)', :type => :string, :default => 'opts.yml'
12
13
  opt :color, 'Colored node edges', :default => false
13
14
  end
15
+
16
+ cmd = ARGV.shift
17
+ if cmd=="setup"
18
+ AwsConfig.write(opts[:config])
19
+ puts "#{opts[:config]} created in current directory."
20
+ exit
21
+ end
22
+
14
23
  if opts[:source_file].nil?
15
24
  Trollop::die :access_key, 'is required' if opts[:access_key].nil?
16
25
  Trollop::die :secret_key, 'is required' if opts[:secret_key].nil?
17
26
  end
18
27
 
19
- VisualizeAws.new(AwsConfig.load, opts).unleash(opts[:filename])
28
+ VisualizeAws.new(AwsConfig.load(opts[:config]), opts).unleash(opts[:filename])
20
29
 
21
30
 
@@ -15,8 +15,12 @@ class AwsConfig
15
15
  @opts[:format] || 'dot'
16
16
  end
17
17
 
18
- def self.load
19
- config_opts = File.exist?('opts.yml') ? YAML.load_file('opts.yml') : {}
18
+ def self.load(file)
19
+ config_opts = File.exist?(file) ? YAML.load_file(file) : {}
20
20
  AwsConfig.new(config_opts)
21
21
  end
22
+
23
+ def self.write(file)
24
+ FileUtils.cp(File.expand_path('../opts.yml.sample', __FILE__), file)
25
+ end
22
26
  end
File without changes
@@ -1,4 +1,4 @@
1
- require 'fog'
1
+ require 'fog/aws'
2
2
 
3
3
  class Ec2Provider
4
4
 
@@ -1,3 +1,3 @@
1
1
  module AwsSecurityViz
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_security_viz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1.pre.alpha.pre.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anay Nayak
@@ -14,126 +14,126 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.9'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 10.4.2
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 10.4.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 3.1.0
47
+ version: 3.3.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 3.1.0
54
+ version: 3.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: ruby-graphviz
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2.1
61
+ version: 1.2.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 1.2.1
68
+ version: 1.2.2
69
69
  - !ruby/object:Gem::Dependency
70
- name: fog
70
+ name: fog-aws
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 1.26.0
75
+ version: 0.7.6
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: 1.26.0
82
+ version: 0.7.6
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: unf
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.1.4
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.1.4
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: json
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 1.8.1
103
+ version: 1.8.3
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 1.8.1
110
+ version: 1.8.3
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: trollop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 2.1.1
117
+ version: 2.1.2
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: 2.1.1
124
+ version: 2.1.2
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: organic_hash
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
131
  version: 1.0.2
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.0.2
139
139
  description: Provides a quick mechanism to visualize your EC2 security groups in multiple
@@ -144,10 +144,9 @@ executables:
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
- - ".gitignore"
148
- - ".travis.yml"
147
+ - .gitignore
148
+ - .travis.yml
149
149
  - Gemfile
150
- - Gemfile.lock
151
150
  - LICENSE.md
152
151
  - README.md
153
152
  - Rakefile
@@ -167,10 +166,10 @@ files:
167
166
  - lib/exclusions.rb
168
167
  - lib/export/html/view.html
169
168
  - lib/graph.rb
169
+ - lib/opts.yml.sample
170
170
  - lib/provider/ec2.rb
171
171
  - lib/provider/json.rb
172
172
  - lib/version.rb
173
- - opts.yml.sample
174
173
  - spec/integration/dummy.dot
175
174
  - spec/integration/dummy.json
176
175
  - spec/integration/visualize_aws_spec.rb
@@ -187,17 +186,17 @@ require_paths:
187
186
  - lib
188
187
  required_ruby_version: !ruby/object:Gem::Requirement
189
188
  requirements:
190
- - - ">="
189
+ - - ! '>='
191
190
  - !ruby/object:Gem::Version
192
- version: '0'
191
+ version: 2.0.0
193
192
  required_rubygems_version: !ruby/object:Gem::Requirement
194
193
  requirements:
195
- - - ">="
194
+ - - ! '>'
196
195
  - !ruby/object:Gem::Version
197
- version: '0'
196
+ version: 1.3.1
198
197
  requirements: []
199
198
  rubyforge_project:
200
- rubygems_version: 2.2.2
199
+ rubygems_version: 2.4.5
201
200
  signing_key:
202
201
  specification_version: 4
203
202
  summary: Visualize your aws security groups
@@ -1,126 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- aws_security_viz (0.1.0)
5
- fog (~> 1.26.0)
6
- json (~> 1.8.1)
7
- organic_hash (~> 1.0.2)
8
- ruby-graphviz (~> 1.2.1)
9
- trollop (~> 2.1.1)
10
- unf (~> 0.1.4)
11
-
12
- GEM
13
- remote: http://rubygems.org/
14
- specs:
15
- CFPropertyList (2.3.1)
16
- builder (3.2.2)
17
- diff-lcs (1.2.5)
18
- excon (0.45.4)
19
- fission (0.5.0)
20
- CFPropertyList (~> 2.2)
21
- fog (1.26.0)
22
- fog-atmos
23
- fog-brightbox (~> 0.4)
24
- fog-core (~> 1.27, >= 1.27.1)
25
- fog-ecloud
26
- fog-json
27
- fog-profitbricks
28
- fog-radosgw (>= 0.0.2)
29
- fog-sakuracloud (>= 0.0.4)
30
- fog-softlayer
31
- fog-storm_on_demand
32
- fog-terremark
33
- fog-vmfusion
34
- fog-voxel
35
- fog-xml (~> 0.1.1)
36
- ipaddress (~> 0.5)
37
- nokogiri (~> 1.5, >= 1.5.11)
38
- fog-atmos (0.1.0)
39
- fog-core
40
- fog-xml
41
- fog-brightbox (0.8.0)
42
- fog-core (~> 1.22)
43
- fog-json
44
- inflecto (~> 0.0.2)
45
- fog-core (1.32.0)
46
- builder
47
- excon (~> 0.45)
48
- formatador (~> 0.2)
49
- mime-types
50
- net-scp (~> 1.1)
51
- net-ssh (>= 2.1.3)
52
- fog-ecloud (0.1.1)
53
- fog-core
54
- fog-xml
55
- fog-json (1.0.2)
56
- fog-core (~> 1.0)
57
- multi_json (~> 1.10)
58
- fog-profitbricks (0.0.5)
59
- fog-core
60
- fog-xml
61
- nokogiri
62
- fog-radosgw (0.0.4)
63
- fog-core (>= 1.21.0)
64
- fog-json
65
- fog-xml (>= 0.0.1)
66
- fog-sakuracloud (1.0.1)
67
- fog-core
68
- fog-json
69
- fog-softlayer (0.4.7)
70
- fog-core
71
- fog-json
72
- fog-storm_on_demand (0.1.1)
73
- fog-core
74
- fog-json
75
- fog-terremark (0.1.0)
76
- fog-core
77
- fog-xml
78
- fog-vmfusion (0.1.0)
79
- fission
80
- fog-core
81
- fog-voxel (0.1.0)
82
- fog-core
83
- fog-xml
84
- fog-xml (0.1.2)
85
- fog-core
86
- nokogiri (~> 1.5, >= 1.5.11)
87
- formatador (0.2.5)
88
- inflecto (0.0.2)
89
- ipaddress (0.8.0)
90
- json (1.8.3)
91
- mime-types (2.6.1)
92
- mini_portile (0.6.2)
93
- multi_json (1.11.2)
94
- net-scp (1.2.1)
95
- net-ssh (>= 2.6.5)
96
- net-ssh (2.9.2)
97
- nokogiri (1.6.6.2)
98
- mini_portile (~> 0.6.0)
99
- organic_hash (1.0.2)
100
- rake (10.1.0)
101
- rspec (3.1.0)
102
- rspec-core (~> 3.1.0)
103
- rspec-expectations (~> 3.1.0)
104
- rspec-mocks (~> 3.1.0)
105
- rspec-core (3.1.7)
106
- rspec-support (~> 3.1.0)
107
- rspec-expectations (3.1.2)
108
- diff-lcs (>= 1.2.0, < 2.0)
109
- rspec-support (~> 3.1.0)
110
- rspec-mocks (3.1.3)
111
- rspec-support (~> 3.1.0)
112
- rspec-support (3.1.2)
113
- ruby-graphviz (1.2.2)
114
- trollop (2.1.2)
115
- unf (0.1.4)
116
- unf_ext
117
- unf_ext (0.0.7.1)
118
-
119
- PLATFORMS
120
- ruby
121
-
122
- DEPENDENCIES
123
- aws_security_viz!
124
- bundler (~> 1.9)
125
- rake (~> 10.0)
126
- rspec (~> 3.1.0)