Giter Site home page Giter Site logo

francisguchie / cloudmapper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from duo-labs/cloudmapper

0.0 1.0 0.0 8.95 MB

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

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

Makefile 0.01% HTML 1.36% Python 15.42% Shell 0.08% CSS 1.91% JavaScript 81.20% Dockerfile 0.03%

cloudmapper's Introduction

CloudMapper

Build Status

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

Commands

  • api_endpoints: List the URLs that can be called via API Gateway.
  • 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 and spot potential IAM issues. More details here.
  • find_unused: Look for unused resources in the account. Finds unused Security Groups, Elastic IPs, network interfaces, and volumes.
  • 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 libtool jq awscli python3 pipenv
cd cloudmapper/
pipenv install --skip-lock
pipenv shell

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/
pipenv install --skip-lock
pipenv shell

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.

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 .
aws-vault exec YOUR_PROFILE --server --
docker run -p 8000:8000 -it cloudmapper /bin/bash

You shoudl replace YOUR_PROFILE with the profile you've configured for aws-vult. Inside the container run aws sts get-caller-identity to confirm this was setup correctly.

pipenv shell
python cloudmapper.py report --accout demo
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

Alternatives

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

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

Licenses

cloudmapper's People

Contributors

0xdabbad00 avatar aioue avatar alanquillin avatar almogcohen avatar amaturehr avatar asloan7 avatar bubbapuryear avatar eugenechang avatar falco694 avatar heikkivertasc avatar joeykrim avatar julesdt avatar kylelady avatar landsman avatar laurrentt avatar myoung34 avatar paralax avatar paweldefee avatar rderewianko avatar schosterbarak avatar sethmccombs avatar soffensive avatar strml avatar syucream avatar takuma-watanabe avatar tpoindessous avatar tsaxon13 avatar williambherman avatar yannvanhalewyn avatar yoava333 avatar

Watchers

 avatar

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.