Automating OpenDMARC reports securely using SystemD units.
The instructions on OpenDMARC/reports/README are a bit open and suggest using cron jobs. The risk with this approach is passing credentials as command line arguments, which is not secure.
This example is tested on Debian 11 & Ubuntu 20.04.
-
OpenDMARC
- installed with reporting tools.
- configured to keep history;
HistoryFile /var/run/opendmarc/opendmarc.datinopendmarc.conf.
-
MySQL or MariaDB
- a database with the [schema][2] from trusteddomainproject / OpenDMARC.
- a password authenticated user (e.g.
'opendmarc'@'localhost') with read/write access to the database.
- Read the
install.shto ensure it fits your requirements. - Run
sudo ./install.shon the root directory of this repository. - Complete the setup by editing the installed
opendmarc.private.env.
The uninstall.sh helps reversing the changes made by the installation script in the correct order.