Skip to main content

A Python package which wanders across your AWS account and records resources in multiple databases

Project description

https://user-images.githubusercontent.com/803607/101322139-7111b800-385e-11eb-9277-c6bf3a580987.png

PyPI GitHub Workflow Status (branch) Documentation Status

A Python package which allows you to enumerate and store your AWS Resources in AWS Neptune (or Gremlin for local execution) in order to be able to ask questions like:

  1. What EC2 instances do I have that are in Public Subnets that have roles and are accessible from the internet?

  2. How old are my IAM users access keys?

  3. What lambda functions do I have that are connected to VPCs that have access to the internet via a NAT gateway?

  4. How many untagged VPCs do I have across all regions?

AWS resources represented on a graph

Installation

pip install cloudwanderer

Local Quickstart

Spin up a local Gremlin Graph Database server and a Jupyter Notebook.

$ git clone https://github.com/CloudWanderer-io/docker-graph-notebook.git
$ cd docker-graph-notebook
$ docker-compose up

Look in the output for something that looks like:

jupyter-notebook_1  |     Or copy and paste one of these URLs:
jupyter-notebook_1  |         http://localhost:8888/?token=88dc054886e3ea73480de91066937a33c9bc8bd484eb395c

Open the URL in question in a tab in your browser.

Open up Python in your preferred IDE and import and initialise CloudWanderer

>>> import logging
>>> from cloudwanderer import CloudWanderer
>>> from cloudwanderer.storage_connectors import GremlinStorageConnector
>>> storage_connector = GremlinStorageConnector(
...     endpoint_url="ws://localhost:8182"
... )
>>> wanderer = CloudWanderer(storage_connectors=[storage_connector])
>>> logging.basicConfig(level='INFO')

Get all the resources from your AWS account and save them to your local Gremlin graph database.

>>> wanderer.write_resources()

Go to the Jupyter Notebook link you opened earlier and, create a new notebook by hitting ‘new’ on the top right, and type the following into a new cell to get a list of VPCs.

%%gremlin
g.V().hasLabel('aws_ec2_vpc').out().path().by(valueMap(true))

Voila!

Example Query and graph output

You can learn more Gremlin (the language that’s supported by the local setup here) by reading Kevin Lawrence’s amazing book on Gremlin OR you can get stuck in to the much more straightforward OpenCypher language by following the Neptune Quickstart guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudwanderer-0.27.2.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudwanderer-0.27.2-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file cloudwanderer-0.27.2.tar.gz.

File metadata

  • Download URL: cloudwanderer-0.27.2.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for cloudwanderer-0.27.2.tar.gz
Algorithm Hash digest
SHA256 7fe90d847ae561f47995e9cbbb8849290264cab2d27cc954fb9ee0af0c82ed50
MD5 c4b83669c36d79f002a87362d5925e9b
BLAKE2b-256 d800b68eeaf7f44e12b981928b559de212bdd6df06f116621565ca4df690bde9

See more details on using hashes here.

File details

Details for the file cloudwanderer-0.27.2-py3-none-any.whl.

File metadata

  • Download URL: cloudwanderer-0.27.2-py3-none-any.whl
  • Upload date:
  • Size: 67.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for cloudwanderer-0.27.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43738869c9b1f9a1738f27fb90e9c7f8111c0ddc7d09ec23042df80ad67ac441
MD5 a66f8a778fb47b2534df209c616ab407
BLAKE2b-256 2c30823388b231f31941418483c757b634787e7179b1a81dd281517fb5a79f97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page