Git Product home page Git Product logo

dmarc-elk-stack's Introduction

dmarc-elk-stack

This repository contains logstash config and a kibana dashboard used to analyze DMARC reports.

The architecure is a classical ELK stack. The only specific part is the python script used to fetch and extract DMARC reports for logstash.

Architecture

As said before, the python script dmarc-imap-downloader.py fetches DMARC reports over IMAP and extracts them into a specific directory organized by date. A cron task can be preiodicly scheduled:

0,30 * * * * root /var/lib/dmarc-imap-downloader/virtualenv/bin/python /var/lib/dmarc-imap-downloader/dmarc-imap-downloader.py -s <imap_mailserver> -u <account_user> -p <account_password> -f <imap_folder_or_gmail_tag> -D /var/cache/dmarc-reports -l /var/log/dmarc-imap-downloader.log >/var/log/dmarc-imap-downloader.cron.log 2>&1

Then, logstash scans periodicly fo new files in /var/cache/dmarc-reports. The new xml files are ingested and:

  • splitted on each record found,
  • data type is enforced for date and integers values,
  • reverse DNS records are filled,
  • geoip localization is added,
  • and finally records are sent to the daily index in elasticsearch.

The kibana dashboard looks like that:

DMARC statistics

Contribution

Feel free to reuse and modify as you wish. Contribution is welcomed too.

dmarc-elk-stack's People

Contributors

limhud avatar boutetnico avatar

Stargazers

CARBONNEAUX Mathieu avatar  avatar Cybervitexus avatar Hannes avatar Pierre-Yves Dubreucq avatar  avatar Colin Stubbs avatar danitfk avatar Colter Bowman avatar Mojo Dev Agent Two avatar Nicola avatar

Watchers

James Cloos avatar  avatar Kevin Hatry avatar

Forkers

braveh4rt

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.