All Projects → aidan- → cloudtrailbeat

aidan- / cloudtrailbeat

Licence: MIT License
Easily export AWS CloudTrail events to ElasticSearch

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to cloudtrailbeat

ansible-role-elasticsearch-curator
Ansible Role - Elasticsearch Curator
Stars: ✭ 31 (+0%)
Mutual labels:  elk
dockerX
Examples of amazing Docker/Docker-Compose/Docker Swarm technologies
Stars: ✭ 17 (-45.16%)
Mutual labels:  elk
elk-in-docker
ELK cluster in docker
Stars: ✭ 23 (-25.81%)
Mutual labels:  elk
terraform-aws-cloudtrail
Terraform module to provision an AWS CloudTrail and an encrypted S3 bucket with versioning to store CloudTrail logs
Stars: ✭ 78 (+151.61%)
Mutual labels:  cloudtrail
graylog-plugin-aws
Several bundled Graylog plugins to integrate with different AWS services like CloudTrail and FlowLogs.
Stars: ✭ 88 (+183.87%)
Mutual labels:  cloudtrail
Online-Testing-Platform
在线考试系统 colleges online examination system base on spring-boot and MyBatis
Stars: ✭ 21 (-32.26%)
Mutual labels:  elk
cognipy
In-memory Graph Database and Knowledge Graph with Natural Language Interface, compatible with Pandas
Stars: ✭ 31 (+0%)
Mutual labels:  elk
docker-repo
A repository stores some dockerfiles or docker-compose files for quickly starting service or service cluster.
Stars: ✭ 26 (-16.13%)
Mutual labels:  elk
xelogstash
Send SQL Server Extended Events to Logstash, Elastic Search, or JSON
Stars: ✭ 22 (-29.03%)
Mutual labels:  elk
shell-scripts
my-scripts
Stars: ✭ 87 (+180.65%)
Mutual labels:  elk
elastalert-tutorial
Get started with Elastalert from Yelp
Stars: ✭ 27 (-12.9%)
Mutual labels:  elk
eslog tutorial
From Raw Logs to Real Insights - A tutorial for getting started with log analytics using Elastic Stack.
Stars: ✭ 28 (-9.68%)
Mutual labels:  elk
logsearch-boshrelease
A BOSH-scalable ELK release
Stars: ✭ 45 (+45.16%)
Mutual labels:  elk
spring-boot-microservice-eureka-zuul-docker-gateway-kubernetes
Spring Boot rest microservices using Kubernetes, ConfigMap, Eureka, Zuul / Spring Boot Gateway, Docker. Monitoring with logstash, logback, elasticsearch, kibana.
Stars: ✭ 86 (+177.42%)
Mutual labels:  elk
tsharkVM
tshark + ELK analytics virtual machine
Stars: ✭ 51 (+64.52%)
Mutual labels:  elk
MyDocs
文档类项目,目前自己技术研究日常所需的文档,自己写的文档汇总
Stars: ✭ 76 (+145.16%)
Mutual labels:  elk
logCollect
日志收集解决方案,动态管理、轻量级日志收集客户端
Stars: ✭ 24 (-22.58%)
Mutual labels:  elk
ansible-role-elasticsearch
Ansible Role - Elasticsearch
Stars: ✭ 144 (+364.52%)
Mutual labels:  elk
blog
Algorithm,WebRTC,Node,Microservices,Golang,ELK,Kubernetes,Istio,JAVA,PHP,MongoDB,Ningx,OpenResty,GraphQL...
Stars: ✭ 19 (-38.71%)
Mutual labels:  elk
aws-support-tickets-aggregator
AWS support tickets aggregation service
Stars: ✭ 37 (+19.35%)
Mutual labels:  cloudtrail

CloudTrailBeat

Current status: beta release

Overview

This is a beat for the Amazon Web Services (AWS) CloudTrail service. CloudTrailBeat relies on a combination of SNS, SQS and S3 to create a processing 'pipeline' to process new log events quickly and efficiently. The beat polls the SQS queue for notification of when a new CloudTrail log file is available for download in S3. Each log file is then downloaded, processed and sent to the configured receiver (logstash, elasticsearch, etc). You are then able to query the data using Kibana (or any other tool) to analyse events involving API calls and IAM authentications.

Getting Started

Requirements

Building

These steps assume you already have a working Go environment.

git clone https://github.com/aidan-/cloudtrailbeat.git
cd cloudtrailbeat
glide install
make

AWS Configuration

Pipeline configuration

Confguring CloudTrail is relatively straight forward and can be done quite easily through the AWS web console. The official documentation outlines the steps required to configure everything, just ensure you complete the optional step 3.

If you would prefer to use CloudFormation to configure your environment, you can use the provided template which will configure all of the neccessary services (CloudTrail, S3, SQS).

Once configured, you can confirm everything is working by inspecting the configured S3 bucket as well as the SQS queue.

Access control configuration

CloudTrailBeat supports usage of both IAM roles and API keys, but as per AWS best practices, if CloudTrailBeat is being run from an EC2 you should be using IAM roles. The following IAM Policy provides the minimal access required to process new CloudTrail events and initiate backfilling. Make sure you replace the S3 and SQS ARN's with the values appropriate to your configuration.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowS3BucketAccess",
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::<bucket name here>"
            ]
        },
        {
            "Sid": "AllowObjectRetrieval",
            "Effect": "Allow",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::<bucket name here>/*"
            ]
        },
        {
            "Sid": "AllowSQS",
            "Effect": "Allow",
            "Action": [
                "sqs:DeleteMessage",
                "sqs:ReceiveMessage",
                "sqs:SendMessage"
            ],
            "Resource": [
                "arn:aws:sqs:<sqs arn here>"
            ]
        }
    ]
}

Running CloudTrailBeat

  1. Build CloudTrailBeat using the steps list above
  2. Modify the included cloudtrailbeat.yml file as required
  3. Change the sqs_url field under the input section with the appropriate SQS url
  4. Configure the output section to send the events to your logstash/elasticsearch instance. More information on Beat output configuration can be found in the official documentation.
  5. If you are not using IAM Roles to grant access to the SQS and S3 buckets, you will also need to configure ~/.aws/credentials with the an appropriate key and secret. The AWS docs give a thorough explanation on setting up the required credentials files.
  6. Run CloudTrailBeat in debug mode: cloudtrailbeat -c /path/to/cloudtrailbeat.yml -d "*"

You should now see a bunch of events scrolling through your terminal and in your output source.

If you are happy with the output, you will need to edit the configuration file to set no_purge to false (or delete the line).

Backfilling

If you would like to backfill events that have been cleared from the SQS or expired, you can run CloudTrailBeat with the -b flag the name of the bucket that contains the CloudTrail logs. Example:

cloudtrailbeat -c /path/to/cloudtrailbeat.yml -d "*" -b example-cloudtrail-bucket

If you would like to backfill only a subset of a bucket, you can also include the flag -p with the desired bucket prefix. Example:

cloudtrailbeat -c /path/to/cloudtrailbeat.yml -d "*" -b example-cloudtrail-bucket -f AWSLogs/xxxxx/CloudTrail/ap-northeast-1/2016/05

Thanks

This beat is heavily inspired by AppliedTrust/traildash with some updates and additional functionality.

Todo

  • Test cases
  • Example Kibana configurations and Elasticsearch templates
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].