Generates an AWS Config Snapshot and ingests it into ElasticSearch for further analysis using Kibana
Clone or download
Latest commit ef476ff Oct 31, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
aws_config_to_es changed the default python bin from 3 to 2 May 4, 2016
.gitignore Formatted the code to fit the PEP8 conventions May 3, 2016
LICENSE Initial commit Apr 27, 2016
NOTICE.txt Added the licensing information Apr 27, 2016
README.md Update README.md Oct 31, 2018
requirements.txt more PEP8 corrections May 4, 2016

README.md

Import your AWS Config Snapshots into ElasticSearch

Author: Vladimir Budilov

What problem does this app solve?

You have a lot of resources in your AWS account and want to search and visualize them. For example, you'd like to know your EC2 Avaiability Zone distribution or how many EC2 instances are uzing a particular Security Group

What does this app do?

It will ingest your AWS Config Snapshots into ElasticSearch for further analysis with Kibana. Please refer to this blog post for a more in-depth explanation of this solution.

Getting the code

git clone --depth 1 git@github.com:awslabs/aws-config-to-elasticsearch.git

The code

Prerequisites

  • Python 2.7
  • An ELK stack, up and running
  • Install the required packages. The requirements.txt file is included with this repo.
pip install -r ./requirements.txt

The command

./esingest.py
usage: esingest.py [-h] [--region REGION] --destination DESTINATION [--verbose]
  1. Let's say that you have your ElasticSearch node running on localhost:9200 and you want to import only your us-east-1 snapshot, then you'd run the following command:
./esingest.py -d localhost:9200 -r us-east-1
  1. If you want to import Snapshots from all of your AWS Config-enabled regions, run the command without the '-r' parameter:
./esingest.py -d localhost:9200
  1. To run the command in verbose mode, use the -v parameter
./esingest.py -v -d localhost:9200 -r us-east-1

Cleanup

####DON'T RUN THESE COMMANDS IF YOU DON'T WANT TO LOSE EVERYTHING IN YOUR ELASTICSEARCH NODE!

#####THIS COMMAND WILL ERASE EVERYTHING FROM YOUR ES NODE --- BE CAREFUL BEFORE RUNNING

curl -XDELETE localhost:9200/_all

In order to avoid losing all of your data, you can just iterate over all of your indexes and delete them that way. The below command will print out all of your indexes that contain 'aws::'. You can then run a DELETE on just these indexes.

curl 'localhost:9200/_cat/indices' | awk '{print $3}' | grep "aws::"

Also delete the template which allows for creationg of a 'raw' string value alongside every 'analyzed' one

curl -XDELETE localhost:9200/_template/configservice