aws_security_viz 0.2.1.pre.alpha.pre.366 → 0.2.1.pre.alpha.pre.379

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e5096a65969a97ebd9d5a57e2a853a83c24728d8d8e7c81d15fd6a423a41d93
4
- data.tar.gz: c54f3af0aad79a4801b7b7ceaac5985cd13a22fa3d00d3bd9fbb0e763a7780af
3
+ metadata.gz: a4fceb4ddd9fa38b99e043c81577263e90a53fda18b8c81be2b3f151e9ff0481
4
+ data.tar.gz: cc59f3fbee5d2e01b8e9d97735e3dffe86cf87a96e246341d8e6ec5824b58190
5
5
  SHA512:
6
- metadata.gz: 07bde43a916cadf648ffaa6af74a1aa34fbabcea8b732e70e8d50777959871d1483f2bccad435cc44e178f1be7fe0e914da18e90e21d9c826eb634ac3b2545e1
7
- data.tar.gz: 60fd91284fd0a5597e4d26702936db7700e8b1872cac1cce81cc7ae6f317a2a94536263668e3386b27ddd2b51929abeb74ec056bb21cc8b248a45b5829d06bd2
6
+ metadata.gz: 218b7412bb348df10048794c55a244635434f7b2946858b6e0e9a3f15aac50a20923c0ecc3971d4214c4314add48a5c75250f094e06db228c83b065b778888d6
7
+ data.tar.gz: bac464a2e6084170ed1d7e97549de41abe2a07d846e8f262f7f5494f54ee592eb7b16ec9e1936afb1f0ce222e0dddc8ba634a51ac136e68b72b22765a8962c77
@@ -3,7 +3,14 @@ All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
+ ### Added
7
+ - Provide a webserver using a --serve PORT which provides a link to the navigator view
8
+
9
+ ### Changed
10
+ - Bumped InteractiveGraph to v0.3.2
6
11
 
12
+ ### Fixed
13
+ - Empty InfoPanel in navigator view now shows vpc, security group name.
7
14
 
8
15
  ## [0.2.0] - 2019-01-24
9
16
  ### Added
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.add_runtime_dependency 'optimist', '~> 3.0.0'
33
33
  s.add_runtime_dependency 'organic_hash', '~> 1.0', '>= 1.0.2'
34
34
  s.add_runtime_dependency 'rgl', '~> 0.5.3'
35
- s.add_runtime_dependency 'aws-sdk-ec2', '>= 1.65', '< 1.112'
35
+ s.add_runtime_dependency 'aws-sdk-ec2', '>= 1.65', '< 1.166'
36
36
 
37
37
  s.required_ruby_version = '>= 2.0.0'
38
38
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'aws_security_viz'
4
4
  require 'optimist'
5
+ require 'webrick'
5
6
 
6
7
  opts = Optimist::options do
7
8
  opt :access_key, 'AWS access key', :default => ENV['AWS_ACCESS_KEY'] || ENV['AWS_ACCESS_KEY_ID'], :type => :string
@@ -16,6 +17,7 @@ opts = Optimist::options do
16
17
  opt :renderer, "Renderer (#{Renderer.all.join('|')})", :default => 'graphviz'
17
18
  opt :source_filter, 'Source filter', :default => nil, :type => :string
18
19
  opt :target_filter, 'Target filter', :default => nil, :type => :string
20
+ opt :serve, 'Serve a HTTP serve', :default => nil, :type => :integer
19
21
  end
20
22
 
21
23
  cmd = ARGV.shift
@@ -28,6 +30,10 @@ end
28
30
  config = AwsConfig.load(opts[:config]).merge(obfuscate: ENV['OBFUSCATE'], debug: ENV['DEBUG'])
29
31
  begin
30
32
  VisualizeAws.new(config, opts).unleash(opts[:filename])
33
+ if opts[:serve]
34
+ puts "Navigate to http://localhost:#{opts[:serve]}/navigator.html##{opts[:filename]}"
35
+ WEBrick::HTTPServer.new({Port: opts[:serve], DocumentRoot: '.'}).start
36
+ end
31
37
  rescue Exception => e
32
38
  puts "[ERROR] #{e.message}"
33
39
  raise e if config.debug?
@@ -12,7 +12,8 @@ module Renderer
12
12
 
13
13
  def add_node(name, opts)
14
14
  vpc = opts[:vpc_id] || 'default'
15
- @nodes << {id: name, label: name, categories: [vpc]}
15
+ info = "<b>Security group</b>: #{name}, <br/><b>VPC:</b> #{vpc}"
16
+ @nodes << {id: name, label: name, categories: [vpc], info: info}
16
17
  @categories.add(vpc)
17
18
  end
18
19
 
@@ -1 +1 @@
1
- {"categories": {"default":"default"}, "data": {"nodes":[{"id":"app", "label":"app", "categories":["default"]}, {"id":"8.8.8.8/32", "label":"8.8.8.8/32", "categories":["default"]}, {"id":"amazon-elb-sg", "label":"amazon-elb-sg", "categories":["default"]}, {"id":"*", "label":"*", "categories":["default"]}, {"id":"db", "label":"db", "categories":["default"]}], "edges":[{"id":"app-db", "from":"app", "to":"db", "label":"5984/tcp"}, {"id":"8.8.8.8/32-app", "from":"8.8.8.8/32", "to":"app", "label":"80/tcp"}, {"id":"amazon-elb-sg-app", "from":"amazon-elb-sg", "to":"app", "label":"80/tcp"}, {"id":"*-app", "from":"*", "to":"app", "label":"22/tcp"}]}}
1
+ {"data":{"nodes":[{"id":"app","label":"app","categories":["default"],"info":"<b>Security group</b>: app, <br/><b>VPC:</b> default"},{"id":"8.8.8.8/32","label":"8.8.8.8/32","categories":["default"],"info":"<b>Security group</b>: 8.8.8.8/32, <br/><b>VPC:</b> default"},{"id":"amazon-elb-sg","label":"amazon-elb-sg","categories":["default"],"info":"<b>Security group</b>: amazon-elb-sg, <br/><b>VPC:</b> default"},{"id":"*","label":"*","categories":["default"],"info":"<b>Security group</b>: *, <br/><b>VPC:</b> default"},{"id":"db","label":"db","categories":["default"],"info":"<b>Security group</b>: db, <br/><b>VPC:</b> default"}],"edges":[{"id":"app-db","from":"app","to":"db","label":"5984/tcp"},{"id":"8.8.8.8/32-app","from":"8.8.8.8/32","to":"app","label":"80/tcp"},{"id":"amazon-elb-sg-app","from":"amazon-elb-sg","to":"app","label":"80/tcp"},{"id":"*-app","from":"*","to":"app","label":"22/tcp"}]},"categories":{"default":"default"}}
@@ -23,9 +23,16 @@ describe VisualizeAws do
23
23
  let(:expected_file) { File.join(File.dirname(__FILE__), 'dummy.dot') }
24
24
  let(:temp_file) { Tempfile.new(%w(aws .dot)) }
25
25
 
26
+ def without_pos(data)
27
+ return data
28
+ .gsub(/pos=\"[a-z,0-9\.\s]*\"/, '')
29
+ .gsub(/\s{2,}/, ' ') # trim spaces
30
+ .gsub(/\t/, ' ') # remove tabs
31
+ end
32
+
26
33
  it 'should parse json input', :integration => true do
27
34
  VisualizeAws.new(config, opts).unleash(temp_file.path)
28
- expect(expected_content).to eq(actual_content)
35
+ expect(without_pos(expected_content)).to eq(without_pos(actual_content))
29
36
  end
30
37
 
31
38
  it 'should parse json input with stubbed out graphviz' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_security_viz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1.pre.alpha.pre.366
4
+ version: 0.2.1.pre.alpha.pre.379
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anay Nayak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-24 00:00:00.000000000 Z
11
+ date: 2020-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -155,7 +155,7 @@ dependencies:
155
155
  version: '1.65'
156
156
  - - "<"
157
157
  - !ruby/object:Gem::Version
158
- version: '1.112'
158
+ version: '1.166'
159
159
  type: :runtime
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
@@ -165,7 +165,7 @@ dependencies:
165
165
  version: '1.65'
166
166
  - - "<"
167
167
  - !ruby/object:Gem::Version
168
- version: '1.112'
168
+ version: '1.166'
169
169
  description: Provides a quick mechanism to visualize your EC2 security groups in multiple
170
170
  formats
171
171
  email: anayak007+rubygems@gmail.com