GithubHelp home page GithubHelp logo

zorrofox / aws-config-to-elasticsearch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awslabs/aws-config-to-elasticsearch

0.0 1.0 0.0 39 KB

Generates an AWS Config Snapshot and ingests it into ElasticSearch for further analysis using Kibana

Home Page: https://aws.amazon.com/blogs/developer/how-to-analyze-aws-config-snapshots-with-elasticsearch-and-kibana/

License: Apache License 2.0

Python 100.00%

aws-config-to-elasticsearch's Introduction

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 [email protected]: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

aws-config-to-elasticsearch's People

Contributors

hyandell avatar vbudilov 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.