Giter Club home page Giter Club logo

dmarc-rs's Introduction

dmarc-rs

Command-line analyze and display of DMARC reports

Build Status Crates.io Docs GitHub release GitHub issues dmarc-rs: 1.56+ SemVer License

Licensed under the MIT.

  1. About
  2. Installation
  3. Usage
  4. Output format
  5. References
  6. Contributing

About

dmarc-rs is a small command-line utility to analyze and display in a usable manner the content of the DMARC XML reports sent by the various email providers around the globe. Should work properly on UNIX (FreeBSD, Linux, etc.) and Windows systems. This is a Rust port of the Go version utility.

Supported platforms

  • Unix (tested on FreeBSD, Linux and macOS)
  • Windows
    • cmd.exe
    • Powershell

Notes

The package is named dmarc_rs to distinguish it from the Go version but the binary will remain the same (dmarc-cat) and can totally replace it.

Installation

As with many Rust utilities, a simple

cargo install dmarc-rs

is enough to fetch, build and install.

On Windows systems, the above cargo command should work directly in a Powershell window.

Packaging

I will insert here references to the binary packages in different distributions when available.

Dependencies

The main XML parsing stuff is done by serde & associates and CLI handling is done with clap:

dmarc-rs uses the following crates to enable reading zip & gzip files:

It also use the following crates for DNS resolving/threading from the report.

and a few other helper crates, especially if you want to run the tests.

Usage

SYNOPSIS

dmarc-cat 0.2.0
Ollivier Robert <[email protected]>
Rust utility to decode and display DMARC reports.

USAGE:
    dmarc-cat [OPTIONS] [FILES]...

ARGS:
    <FILES>...    Filenames (possibly none or -)

OPTIONS:
    -D, --debug                 debug mode
    -h, --help                  Print help information
    -j, --jobs <JOBS>           Use this many parallel jobs for resolving IP [default: 6]
    -N, --no-resolve            Do not resolve IP to names
    -t, --input-type <ITYPE>    Specify the type of input data
    -v, --verbose               Verbose mode
    -V, --version               Display version and exit

Example:

$ dmarc-cat /tmp/yahoo.com\!keltia.net\!1518912000\!1518998399.xml

Reporting by: Yahoo! Inc. โ€” [email protected]
From 2018-02-18 01:00:00 +0100 CET to 2018-02-19 00:59:59 +0100 CET

Domain: keltia.net
Policy: p=none; dkim=r; spf=r

Reports(1):
IP            Count   From       RFrom      RDKIM   RSPF
88.191.250.24 1       keltia.net keltia.net neutral pass

Columns

The full XML grammar is available here and there is a local copy in the doc/ directory in the source.

The report has several columns:

  • IP is matching IP address
  • Count is the number of times this IP was present
  • From is the From: header value
  • RFrom is the envelope From value
  • RDKIM is the result from DKIM checking
  • RSPF is the result from SPF checking

Supported formats

The file sent by MTAs can differ in format, some providers send zip files with both csv and XML files, some directly send compressed XML files. This utility should handle the different format but you will have to use -t TYPE if you want to read from standard input.

Tests

Tests are available as unit-tests for the library part and as integration tests for the CLI interaction (see tests/cli.rs).

References

Contributing

Please see CONTRIBUTING.md for some simple rules.

I use Git Flow for this package so please use something similar or the usual github workflow.

  1. Fork it ( https://github.com/keltia/dmarc-rs/fork )
  2. Checkout the develop branch (git checkout develop)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

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.