GithubHelp home page GithubHelp logo

dmarc-demo-data's Introduction

DMARC Aggregate Reports

A Python/Jinja2-based DMARC aggregate report generator and validator (schema version 0.1).

The repo also provides a script to generate DMARC aggregate reports for demo purposes, with half-sensible random values, including options to generate sender IP addresses based on countries.

Installation

git clone https://github.com/lukpueh/dmarc-demo-data
cd dmarc-demo-data
# TIP: Use virtual environments
pip install -r requirements.txt

Report Generation And Validation Example

Use the following Python snippet to generate, validate and store a single DMARC aggregate report under its corresponding name, using sample data. See data.sample_report to learn more about the dictionary structure required by generate_report.

from rua import generate_report, validate_report
from data import sample_report

# Generate a DMARC aggregate report passing it some sample data
report, report_name = generate_report(sample_report)

# Verify that report follows the right schema.
validate_report(report)

# Write to file using the typical report filename format
with open(report_name, "w") as f:
  f.write(report)

Demo Data Generation

Run the following script to generate some opinionated demo DMARC aggregate reports for three domains, i.e. "your" domain and two foreign domains, which makes four daily report exchanges, i.e. two that you send and two that you receive, over the year 2017.

Although the script was written for a specific purpose, it should be very easy to tweak the hardcoded parameters to generate demo data that fits other use cases (see demo_reports.main

# Writes reports to `reports/incoming` and `reports/outgoing`
python demo_reports.py

dmarc-demo-data's People

Contributors

lukpueh avatar

Stargazers

 avatar  avatar  avatar Santiago Torres avatar

Watchers

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