Coder Social home page Coder Social logo

duo-labs / cloudmapper Goto Github PK

View Code? Open in Web Editor NEW
5.8K 137.0 788.0 10.69 MB

CloudMapper helps you analyze your Amazon Web Services (AWS) environments.

License: BSD 3-Clause "New" or "Revised" License

Python 17.25% Shell 0.32% CSS 1.86% HTML 1.43% JavaScript 79.08% Makefile 0.01% Dockerfile 0.06%
aws cytoscape diagram security

cloudmapper's Introduction

CloudMapper

Note the Network Visualization functionality (command prepare) is no longer maintained.

CloudMapper helps you analyze your Amazon Web Services (AWS) environments. The original purpose was to generate network diagrams and display them in your browser (functionality no longer maintained). It now contains much more functionality, including auditing for security issues.

Commands

  • audit: Check for potential misconfigurations.
  • collect: Collect metadata about an account. More details here.
  • find_admins: Look at IAM policies to identify admin users and roles, or principals with specific privileges. More details here.
  • find_unused: Look for unused resources in the account. Finds unused Security Groups, Elastic IPs, network interfaces, volumes and elastic load balancers.
  • prepare/webserver: See Network Visualizations
  • public: Find public hosts and port ranges. More details here.
  • sg_ips: Get geoip info on CIDRs trusted in Security Groups. More details here.
  • stats: Show counts of resources for accounts. More details here.
  • weboftrust: Show Web Of Trust. More details here.
  • report: Generate HTML report. Includes summary of the accounts and audit findings. More details here.
  • iam_report: Generate HTML report for the IAM information of an account. More details here.

If you want to add your own private commands, you can create a private_commands directory and add them there.

Screenshots

Ideal layout

Report screenshot Findings summary
Findings IAM report
Command-line audit Command-line public command

Installation

Requirements:

On macOS:

# clone the repo
git clone https://github.com/duo-labs/cloudmapper.git
# Install pre-reqs for pyjq
brew install autoconf automake awscli freetype jq libtool python3
cd cloudmapper/
python3 -m venv ./venv && source venv/bin/activate
pip install --prefer-binary -r requirements.txt

On Linux:

# clone the repo
git clone https://github.com/duo-labs/cloudmapper.git
# (AWS Linux, Centos, Fedora, RedHat etc.):
# sudo yum install autoconf automake libtool python3-devel.x86_64 python3-tkinter python-pip jq awscli
# (Debian, Ubuntu etc.):
# You may additionally need "build-essential"
sudo apt-get install autoconf automake libtool python3.7-dev python3-tk jq awscli
cd cloudmapper/
python3 -m venv ./venv && source venv/bin/activate
pip install -r requirements.txt

Run with demo data

A small set of demo data is provided. This will display the same environment as the demo site https://duo-labs.github.io/cloudmapper/

# Generate the data for the network map
python cloudmapper.py prepare --config config.json.demo --account demo
# Generate a report
python cloudmapper.py report --config config.json.demo --account demo
python cloudmapper.py webserver

This will run a local webserver at http://127.0.0.1:8000/ View the network map from that link, or view the report at http://127.0.0.1:8000/account-data/report.html

Setup

  1. Configure information about your account.
  2. Collect information about an AWS account.

1. Configure your account

Copy the config.json.demo to config.json and edit it to include your account ID and name (ex. "prod"), along with any external CIDR names. A CIDR is an IP range such as 1.2.3.4/32 which means only the IP 1.2.3.4.

2. Collect data about the account

This step uses the CLI to make describe and list calls and records the json in the folder specified by the account name under account-data.

AWS Privileges required

You must have AWS credentials configured that can be used by the CLI with read permissions for the different metadata to collect. I recommend using aws-vault. CloudMapper will collect IAM information, which means you MUST use MFA. Only the collect step requires AWS access.

You must have the following privileges (these grant various read access of metadata):

  • arn:aws:iam::aws:policy/SecurityAudit
  • arn:aws:iam::aws:policy/job-function/ViewOnlyAccess

Collect the data

Collecting the data is done as follows:

python cloudmapper.py collect --account my_account

Analyze the data

From here, try running the different commands, such as:

python cloudmapper.py report --account my_account
python cloudmapper.py webserver

Then view the report in your browser at 127.0.0.1:8000/account-data/report.html

Further configuration

Generating a config file

Instead of modifying config.json directly, there is a command to configure the data there, in case that is needed:

python cloudmapper.py configure {add-account|remove-account} --config-file CONFIG_FILE --name NAME --id ID [--default DEFAULT]
python cloudmapper.py configure {add-cidr|remove-cidr} --config-file CONFIG_FILE --cidr CIDR --name NAME

This will allow you to define the different AWS accounts you use in your environment and the known CIDR IPs.

If you use AWS Organizations, you can also automatically add organization member accounts to config.json using:

python cloudmapper.py configure discover-organization-accounts

You need to be authenticated to the AWS CLI and have the permission organization:ListAccounts prior to running this command.

Using audit config overrides

You may find that you don't care about some of audit items. You may want to ignore the check entirely, or just specific resources. Copy config/audit_config_override.yaml.example to config/audit_config_override.yaml and edit the file based on the comments in there.

Using a Docker container

The docker container that is created is meant to be used interactively.

docker build -t cloudmapper .

Cloudmapper needs to make IAM calls and cannot use session credentials for collection, so you cannot use the aws-vault server if you want to collect data, and must pass role credentials in directly or configure aws credentials manually inside the container. The following code exposes your raw credentials inside the container.

(                                                              
    export $(aws-vault exec YOUR_PROFILE --no-session -- env | grep ^AWS | xargs) && \ 
    docker run -ti \
        -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
        -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
        -p 8000:8000 \
        cloudmapper /bin/bash
)

This will drop you into the container. Run aws sts get-caller-identity to confirm this was setup correctly. Cloudmapper demo data is not copied into the docker container so you will need to collect live data from your system. Note docker defaults may limit the memory available to your container. For example on Mac OS the default is 2GB which may not be enough to generate the report on a medium sized account.

python cloudmapper.py configure add-account --config-file config.json --name YOUR_ACCOUNT --id YOUR_ACCOUNT_NUMBER
python cloudmapper.py collect --account YOUR_ACCOUNT
python cloudmapper.py report --account YOUR_ACCOUNT
python cloudmapper.py prepare --account YOUR_ACCOUNT
python cloudmapper.py webserver --public

You should then be able to view the report by visiting http://127.0.0.1:8000/account-data/report.html

Running CloudMapper regularly to audit your environment

A CDK app for deploying CloudMapper via Fargate so that it runs nightly, sends audit findings as alerts to a Slack channel, and generating a report that is saved on S3, is described here.

Alternatives

For network diagrams, you may want to try https://github.com/lyft/cartography or https://github.com/anaynayak/aws-security-viz

For auditing and other AWS security tools see https://github.com/toniblyx/my-arsenal-of-aws-security-tools

Licenses

cloudmapper's People

Contributors

0xdabbad00 avatar alanquillin avatar almogcohen avatar andrewkrug avatar asloan7 avatar cbeltranbird avatar cdstrachan avatar clholm avatar danielpops avatar dependabot[bot] avatar elliot avatar eugenechang avatar francilioaraujo avatar heikkivertasc avatar jdyke avatar jordan-wright avatar julesdt avatar kylelady avatar maestretti avatar nimrodkor avatar paweldefee avatar rderewianko avatar rjcassara- avatar roskyfrosky avatar schosterbarak avatar soffensive avatar syucream avatar w0rmr1d3r avatar williambherman avatar yannvanhalewyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudmapper's Issues

Filter by tag

Provide option to Prepare data only for the Tags as it might get too complicated for an enterprise to run it on there infrastructure

  • 0 nodes built in region eu-west-3
  • 0 nodes built in region eu-west-2
  • 6 nodes built in region eu-west-1
  • 0 nodes built in region ap-northeast-2
  • 0 nodes built in region ap-northeast-1
  • 0 nodes built in region sa-east-1
  • 0 nodes built in region ca-central-1
  • 0 nodes built in region ap-southeast-1
  • 0 nodes built in region ap-southeast-2
  • 0 nodes built in region eu-central-1
  • 999 nodes built in region us-east-1
  • 0 nodes built in region us-east-2
  • 0 nodes built in region us-west-1
  • 0 nodes built in region us-west-2
  • 507426 connections built
    WARNING: There are 1120 total nodes and 507426 total edges.
    This will be difficult to display and may be too complex to make sense of.
    Consider reducing the number of items in the diagram by viewing a single
    region, ignoring internal edges, or other filtering.

White Blank Screen during serve

After successful prepare step I ran:

python cloudmapper.py serve --public

When I go to the web page I can see the toolbar at the top and there is a blue progress bar that goes left to right, but it never makes it all the way to the right.

Here are the messages in the console during the page view (notice the code 404 message File not found) :

173.23.49.44 - - [20/Feb/2018 18:57:30] "GET / HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/nprogress.css HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/jquery.qtip.css HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/cytoscape.js-panzoom.css HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/cytoscape.js-navigator.css HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/font-awesome-4.7.0/css/font-awesome.css HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/akkordion.css HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/cloudmap.css HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/nprogress.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape.min.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/jquery.qtip.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/jquery.min.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-cose-bilkent.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-grid-guide.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /css/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0 HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-qtip.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-panzoom.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-undo-redo.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-view-utilities.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-expand-collapse.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:30] "GET /js/cytoscape-navigator.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /js/cytoscape-autopan-on-drag.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /js/FileSaver.min.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /js/circular-json.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /js/mousetrap.min.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /js/akkordion.min.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /js/nodeInfo.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /js/cloudmap.js HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] code 404, message File not found
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /data.json HTTP/1.1" 404 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /favicon.ico HTTP/1.1" 200 -
173.23.49.44 - - [20/Feb/2018 18:57:31] "GET /style.json HTTP/1.1" 200 -

expose parameters inline

instead of the config.json file maybe it would be nice to declare these values inline.
makes it easier when running a docker

On my mac, did not have jq

I didn't have "jq" on my mac, which broke collect_data.sh. Recommend adding that to your installation instructions.

Add ability to append security group description

This is a feature request more than anything.

It would be great if there was an option to append security group IP descriptions next to their IP address.

It would help when we visually look at a map and say hey what is this IP?

I suppose this would basically be automating the IP definitions in the config.json. (Assuming descriptions exist for those IPs in EC2)

Anyways, wouldn't make sense to enable this by default by an option such as --include-descriptions would be a nice add.

Handle reserved characters in filenames

Dies very quickly:
cloudmapper$ ./collect_data.sh --account 2267e1

  • Startup checks
    jq - commandline JSON processor [version 1.3]
    Usage: jq [options] [file...]

Feature request: optional connection visibility

Using cloudmapper to help unpick a rats nest of systems:

image

Would like the option of a connectionless view, with instances vaguely grouped near each other inside subnets by name or a tag, etc. e.g.

image

(Achieved connection removal locally by leaving source and target empty in nodes.py cytoscape_data.

Code is very readable.

what are the guidance for visualizing large JSON.files

some of our accounts have 1000's of EC2 instances. the combined JSON is 1000MB+.
The UI is not loading or taking forever to display this information.
Any guidance on how to handle the large number of nodes/json in the UI ?

Thank you for the support..

Add "incremental layout" command

I received an email:

You already have an option to “redraw with randomized layout” (this is layout from scratch). I suggest you add (next to it?) another button for “redraw with adjusted layout” or something similar and apply incremental layout (randomize: false). Since layout algorithms are not meant to give optimal results, often times a user will like to adjust the drawing partially manually. After which, an incremental layout “tidies up” the drawing.

Centos install issues

I had some install pains on a plain, fresh built centOS7 on AWS:

normal instructions:

clone the repo

git clone [email protected]:duo-labs/cloudmapper.git

(Centos, Fedora, RedHat etc.):

sudo yum install autoconf automake libtool python-dev jq
cd cloudmapper/

at this point I had to run:
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
pip install virtualenv

then I could continue
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

then it bombed out with a python error, so I had to run
yum install python-devel

In summary, I had to run the additional commands at any time before the command "virtualenv venv"
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
pip install virtualenv
yum install python-devel

Duplicate/additional databases

When rendering RDS databases, I am seeing non-multiAZ DBs located in just 1 availability zone, being shown in all AZs.

Eg: here, this DB is only in one subnet, in 1 AZ, but shows up three times in 3 subnets.

image

boto determine account id

could this use

import boto3
print(boto3.client('sts').get_caller_identity()['Account'])

to determine the account id it is running ?

Set randomize to false when expanding/collapsing

When expanding and collapsing I can set randomize: false with the cose-bilkent as the layout so the user doesn't lose their mental map of where things were and so the whole layout is not redrawn.

Provide guidance on minimal IAM privileges

SecurityAuditor is sufficient for CloudMapper, but that still provides a lot of unused privileges. Provide guidance on the absolute minimum set of privileges needed.

Bug in prepare `takes exactly 3 arguments (2 given)`

I received a bug report on Slack https://awssecurityforum.slack.com/files/U7K04K073/F9BNUTJ03/-.txt

Traceback (most recent call last):
  File "cloudmapper.py", line 121, in <module>
    main()
  File "cloudmapper.py", line 111, in main
    run_prepare(arguments)
  File "cloudmapper.py", line 90, in run_prepare
    prepare(account, config, outputfilter)
  File ".../Scrap/cloudmapper/cloudmapper/prepare.py", line 339, in prepare
    cytoscape_json = build_data_structure(account, config, outputfilter)
  File ".../cloudmapper/cloudmapper/prepare.py", line 300, in build_data_structure
    for c, reasons in get_connections(cidrs, vpc, outputfilter).iteritems():
  File ".../cloudmapper/cloudmapper/prepare.py", line 199, in get_connections
    add_connection(connections, source, target, sg)
  File ".../cloudmapper/cloudmapper/prepare.py", line 129, in add_connection
    reasons = connections.get(Connection(source, target), [])
TypeError: __eq__() takes exactly 3 arguments (2 given)%

Provide a way to collapse named CIDR ranges

If I have a /30 as a named range in my config.json, but a security group references just a /32 in that range, it would be nice to have an option to have the connection terminate at the /30 rather than having a separate node for the /32.

Display large environments

What would be the recommended config or steps to display a very large environment?

I am not able to display what we have currently, using the built-in web server mentioned or another web server like IIS. Willing to use something else, just not sure what was suggested.

Filter only recources in one or several CloudFormation stacks (--stack-names option)

This is an awesome project. Bravo.
We have AWS accounts with many projects and huge number of resources in each of them. Current filters do not allow to ignore 99% resources and we have crowd of resources mixed from different projects. Web server getting overloaded very slow. It takes couple of minutes to generate web page in browser and result is not informative.
Is it possible do add filter like "--stack-names" that will filter resources only from one/two/three... CloudFormation stacks. Stacks usually have 5-25 resources and visualisation will be much better.
In this case we can start many web servers on different ports and see each project on personal port.
Thank you for you fantastic work.

Scanning all the resources within the account

This is an awesome project. Liked the way visualization is organized and the details provided. I am looking forward for an enhancement which scans all the resources with AWS including but not limited to API Gateways, Lambda, SES, SNS, SQS and so on.....

Prepare data error KeyError: 'cidrs'

Hi, i just caught this error when i tried to prepare data, i'm running on MacOS Sierra and Python 2.7.10

python cloudmapper.py prepare --account Dev
Building data for account Dev (0000123456)
- 0 nodes built in region ap-south-1
- 0 nodes built in region eu-west-3
- 0 nodes built in region eu-west-2
- 0 nodes built in region eu-west-1
- 0 nodes built in region ap-northeast-2
- 0 nodes built in region ap-northeast-1
- 0 nodes built in region sa-east-1
- 0 nodes built in region ca-central-1
- 0 nodes built in region ap-southeast-1
- 0 nodes built in region ap-southeast-2
- 0 nodes built in region eu-central-1
- 90 nodes built in region us-east-1
- 0 nodes built in region us-east-2
- 0 nodes built in region us-west-1
- 0 nodes built in region us-west-2
Traceback (most recent call last):
  File "cloudmapper.py", line 121, in <module>
    main()
  File "cloudmapper.py", line 111, in main
    run_prepare(arguments)
  File "cloudmapper.py", line 90, in run_prepare
    prepare(account, config, outputfilter)
  File "/private/tmp/cloudmapper/cloudmapper/prepare.py", line 339, in prepare
    cytoscape_json = build_data_structure(account, config, outputfilter)
  File "/private/tmp/cloudmapper/cloudmapper/prepare.py", line 292, in build_data_structure
    for cidr in get_external_cidrs(account, config):
  File "/private/tmp/cloudmapper/cloudmapper/prepare.py", line 120, in get_external_cidrs
    external_cidrs.append(Cidr(cidr, get_cidr_name(cidr, config)))
  File "/private/tmp/cloudmapper/cloudmapper/prepare.py", line 125, in get_cidr_name
    return config["cidrs"].get(cidr, {}).get("name", None)
KeyError: 'cidrs'

Error on vanilla install of Ubuntu 16.04.4 LTS

error: [Errno 2] No such file or directory


Failed building wheel for pyjq
Running setup.py clean for pyjq
Failed to build pyjq
Installing collected packages: six, pyjq, netaddr, jmespath, docutils, python-dateutil, botocore, futures, s3transfer, boto3
Running setup.py install for pyjq ... error

Fixed by installing build-essential (sudo apt-get install build-essential)

Create a Filter "--Public-Connection" (0.0.0.0/0 + PublicIP)

Create a Filter "--Public-Connection" (0.0.0.0/0 + PublicIP)

How can i get just public instances ? Web server keep showing instances with no public connection when "--no-internal-edges" is used .

Another great filter to be create is "--instance-name" in "ghaterer.py" script. Sometimes we need specific information about 1 instance and neighbors.

thnks

missing JQ in requirements

I know it's pretty obvious it should be already installed but on my brand new install, it was missing :-)

Add version

In order to better resolve issues, I should have a --version flag to provide the version.

Collect data from Python

Instead of running collect_data.sh, have the ability to collect this data via an argument like python cloudmapper.py gather

Ununtu 16.04 ImportError: No module named six.moves.urllib (and other packages)

On Ubuntu 16.04 Server, ran:

python cloudmapper.py prepare --config config.production.json --account production

The following error was returned:

Traceback (most recent call last):
File "cloudmapper.py", line 32, in
from cloudmapper.webserver import run_webserver
File "/home/juan/cloudmapper/cloudmapper/webserver.py", line 27, in
import six.moves.urllib as urllib
ImportError: No module named six.moves.urllib

Resolved by installing pip:

sudo apt install python-pip

Then installing six package:

pip install --user six

Similar issues with other package import errors:

ImportError: No module named pyjq
ImportError: No module named netaddr

Resolved with pip as well:

pip install --user pyjq
pip install --user netaddr

Restrict map based on tag key:value pair

I tried running this on one of my VPC,s but... well, apparently I have way too much stuff (reported over 1 million connections). I tried to re-run using tag grouping which got it down to about 40k connections (which was still too high for it to render).

It would be great if I could run the collector against a specific key:value pair filter to reduce the data and connectivity map to a specific subset of resources.

Feature request: additional visible information, and cropping

Appending CidrBlocks, and not cropping long names makes the diagram easier to read without having to drill into the details.

VPCs: add the CidrBlock value in parentheses ()

image

becomes dot1 (10.0.0.0/0)

Subnets: don't crop subnet names, and append CidrBlock in parentheses

image

becomes dot1_private_eu-west-1 (10.0.0.10/20)

VPC & Subnets

Add option to show tag (key:value) list down left-hand edge of container.

e.g.

--------------someVPC----
| tier: edge
| access: public
---------------------------

Improve layout

Regions and other compound nodes sometimes overlap on top of other structures and there are various other ways in which these look "bad".

For example minimizing regions for some reason often ends up causing one of the worst layouts, where things get spread very far apart vertically.

Some ideas for improvements:

  • The bad layouts are largely due to the graphs being too complex, which is due to too many nodes and edges. To resolve this, we could allow more filtering, and make that easier to do. Also compress nodes in the initial layout.
  • We are using a compound layout to allow nodes (ex. EC2's) to have parent nodes (ex. EC2's are in subnets, which are in AZ's, etc.). We could allow for non-compound layouts, which would allow us to use algorithms other than cose-bilkent, which may look better.
  • Improve cose-bilkent to score and hill climb. cose-bilkent works by randomly laying out the diagram and then applying spring and gravity forces over iterations to bring things to a state that matches those forces. This could be improved by making multiple layout attempts and choosing the "best" where a scoring algorithm would need to be created to decide on the "best" layout. This would need to do things like counting the number of over-lapping edges and nodes, and find the area of the layout (ex. to avoid the layout being too spread out). Ideally, this scoring would be incorporated into the forces that are applied to bring them toward better states. Additionally, I think the "final" states are sometimes local maxima and could benefit from some hill climbing techniques to "shake" the state a little on each iteration.

Create Python package

The end result would be the ability to run:

pip install cloudmapper
cloudmapper configure
cloudmapper gather
cloudmapper prepare
cloudmapper serve

The most difficult issue I see with creating a setup.py file is how I handle the web directory. Right now, when you run prepare it is hardcoded to write web/data.json then the web server code is hard-coded to read this data.json file.

I also need to:

  • Convert the collect_data.sh script into something runnable from python.
  • Add a configure command so you don't have to edit the config.json file.
  • Allow for default settings, such as setting an account to be the default account.

For the webserver files, see https://stackoverflow.com/questions/6028000/how-to-read-a-static-file-from-inside-a-python-package/20885799#20885799

Support Python3

With only 2 years left for python 2.7 and with many upstream modules dropping new feature support for 2.7 soon this should support python 3.5+

There is no contributor guide, but I will volunteer for this task if you can provide some style guidelines.

Set default account

Instead of constantly specifying --account prod be able to just define a default account.

Account named _______ not found.

This tool works perfectly up until the "prepare" phase, when I get the following error:

$ python cloudmapper.py prepare --account production
Traceback (most recent call last):
  File "cloudmapper.py", line 146, in <module>
    main()
  File "cloudmapper.py", line 134, in main
    run_prepare(arguments)
  File "cloudmapper.py", line 109, in run_prepare
    account = get_account(args.account_name, config)
  File "cloudmapper.py", line 41, in get_account
    raise Exception("Account named \"{}\" not found".format(account_name))
Exception: Account named "production" not found

I used the same account name in the previous step without issue.

VPC peering not handled correctly (unverified)

I have configured my config.json to contain all my CIDRs yet the diagram shows my data-vpc as being disconnected from the other 2 VPCs despite there being peering connections and route tables to ensure connectivity between all 3 VPCs.

Am I missing something here?

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.