Skip to main content

dmarc-import 📯 📫

Build Status Coverage Status

dmarc-import is a tool for parsing DMARC aggregate reports. The expected format of these aggregate reports is described in RFC 7489.

Installation of the Python package

From PyPI

pip install dmarc-import

From your local checkout

After using git to clone the repository, you can install dmarc-import using pip:

pip install /path/to/dmarc-import

From GitHub

Or, if you prefer, you can install directly from the GitHub repository:

pip install git+https://github.com/cisagov/dmarc-import.git

Building the Docker image

As an alternative to installing the Python package, you can instead choose to build the Docker image:

docker-compose build

Usage

Usage:
  dmarc-import --schema=SCHEMA --s3-bucket=BUCKET [--s3-keys=KEYS] [--domains=FILE] [--reports=DIRECTORY] [--elasticsearch=URL] [--es-region=REGION] [--log-level=LEVEL] [--dmarcian-token=FILE] [--delete]
  dmarc-import (-h | --help)

Options:
  -h --help               Show this message.
  --log-level=LEVEL       If specified, then the log level will be set to the
                          specified value.  Valid values are "debug", "info",
                          "warn", and "error".
  --schema=SCHEMA         The XSD file against which the DMARC aggregate
                          reports are to be be verified.
  --s3-bucket=BUCKET      The AWS S3 bucket containing the DMARC aggregate
                          reports.
  --s3-keys=KEYS          A comma-separated list of DMARC aggregate report
                          keys.  If specified, only the specified DMARC
                          aggregate reports will be processed.  Otherwise all
                          reports in the AWS S3 bucket will be processed.
  --domains=FILE          A file to which to save a list of all domains for
                          which DMARC aggregate reports were received.  If not
                          specified then no such file will be created.
  --reports=DIRECTORY     A directory to which to write files containing DMARC
                          aggregate report contents.  If not specified then no
                          such files will be created.
  --elasticsearch=URL     A URL corresponding to an AWS Elasticsearch
                          instance, including the index where the DMARC
                          aggregate reports should be written.
  --es-region=REGION      The AWS region where the Elasticsearch instance
                          is located.
  --dmarcian-token=FILE   A simple text file whose only contents are the
                          Dmarcian API token.  If specified then the
                          Dmarcian API will be queried to determine what
                          commercial mail-sending organization (if any) is
                          associated with the IP in the aggregate report.
  --delete                If present then the reports will be deleted after
                          processing.

Setting up Docker secrets

Before attempting to run this project via docker-compose, you must create a secrets directory and a few files inside it that contain credentials for the Docker container to use. These files are:

License

This project is in the worldwide public domain.

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

Release files for dmarc-import 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmarc-import 1.1.1
File Size Uploaded
dmarc-import-1.1.1.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dmarc-import 1.1.1
File Interpreter ABI Platform
dmarc_import-1.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 33.9 kB

Release files / dmarc-import-1.1.1.tar.gz

Download URL dmarc-import-1.1.1.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c585a89145496a58a8d26445df73cd206a465e0f0cbc8e4234b8fcafc89f93
BLAKE2b-256 checksum
How to use checksums
d66e5c02685720060ec5e9801e64d475abfe66b097fd42d9a9f6c57b0da10428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / dmarc_import-1.1.1-py2.py3-none-any.whl

Download URL dmarc_import-1.1.1-py2.py3-none-any.whl
Size 18.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bd688764b913ec4d1c05bbbd2c9124e2a1272eea9a8d6634c5b706453cbab5b9
BLAKE2b-256 checksum
How to use checksums
00f036950f3d21e9a47bf895db0abb13c53619eedbff0d125746d150fb17f477
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page