aws_security_viz 0.2.1.pre.alpha.pre.376 → 0.2.2.pre.alpha.pre.383

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: 6bb54e677979f783753ba4fd9b3edb568bc7dfebd941cffbe292ddb6fa996580
4
- data.tar.gz: 3410e353079b7650cfcc909c431b4526320fe1749692795a9f7c60ee1efe35e1
3
+ metadata.gz: f9a0d7898f139ae192bac0c3e5b5592ce8633816a0ca0a24d5d7146b48699969
4
+ data.tar.gz: 136582d60fb6135fd950e932fdb519f9496f54dfa5906222e9ae8a594190ae9e
5
5
  SHA512:
6
- metadata.gz: 3a0033f321f0fb0d4ba7abaf1e05b7540e28bb876a2e5c85c40b667ae0cd47040a4e72fdfebaf6542897362d3f7c06288f2b5889af8b778249e5a76de1af234e
7
- data.tar.gz: a13d5f3b71dd1e6fa4dbfaa941c5387f7f8dd8b42baf5b7272f328618a58003a8921c3e89eab59bfac8fe6b3422821f880deab27d326598071f38a13ffd6a965
6
+ metadata.gz: 20ceaca72580f8d3c984e3265faa91ead73bb2a042ce440e269ecf3f58254853cd935194f62c9c4281a5b2f0d0aec0a0569f06f617ee4574c8cfda4b81513e9c
7
+ data.tar.gz: 134f8b8b5fa187607aec17b19836f09398a19289373c65a05f8ad7bec205ed1cb8f5d03668bf9e2d8d27a50dc8c08f4402ae3c31bf600d76ad7e14981caf2ae1
@@ -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
data/README.md CHANGED
@@ -78,6 +78,7 @@ Options:
78
78
  -l, --color Colored node edges
79
79
  -u, --source-filter=<s> Source filter
80
80
  -t, --target-filter=<s> Target filter
81
+ --serve=<i> Serve a HTTP server at specified port
81
82
  -h, --help Show this message
82
83
  ```
83
84
 
@@ -173,3 +174,9 @@ Via json renderer `aws_security_viz -a your_aws_key -s your_aws_secret_key -f aw
173
174
  ```
174
175
  $ aws_security_viz --region us-west-1 --vpc-id=vpc-12345
175
176
  ```
177
+
178
+ #### Serve webserver for the navigator view at port 3000
179
+ ```
180
+ $ aws_security_viz -a your_aws_key -s your_aws_secret_key -f aws.json --renderer navigator --serve 3000
181
+ ```
182
+ The browser link to the view is printed on the CLI
@@ -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 server', :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,3 +1,3 @@
1
1
  module AwsSecurityViz
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -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.376
4
+ version: 0.2.2.pre.alpha.pre.383
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-06-14 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