Parse DMARC Reports
detail.loadingPreview
Automates the parsing of DMARC reports received via email, extracts relevant data, and stores it in a MySQL database.
About This Workflow
This workflow monitors an IMAP mailbox for DMARC report emails. Upon receiving an email with DMARC reports as attachments, it extracts, unzips, and parses the XML data. It then processes and maps the relevant fields to a structured format for database insertion into a MySQL table. The workflow also includes conditional logic to flag and notify about DMARC evaluations that fail DKIM or SPF checks.
Key Features
- Email Monitoring: Connects to an IMAP server to fetch DMARC report emails.
- Attachment Handling: Downloads and processes attachments, specifically zip files containing DMARC reports.
- XML Parsing: Extracts and parses XML data from DMARC reports.
- Data Mapping & Transformation: Selects and formats key data points from the DMARC reports for database insertion.
- Date Formatting: Converts date values to a MySQL-compatible format.
- Database Integration: Inserts processed DMARC data into a MySQL database.
- Conditional Notifications: Triggers notifications (Slack and/or email) for failed DKIM or SPF evaluations.
How To Use
- Email Trigger (IMAP): Configure your IMAP account credentials to connect to the mailbox where DMARC reports are received. Ensure
downloadAttachmentsis set totrue. - Unzip File: This node automatically handles the unzipping of the attachment. The
binaryPropertyNameshould match the output of the IMAP node (e.g.,attachment_0). - Extract XML data: Extracts data from the unzipped file. The
binaryPropertyNameshould be the output of the previousUnzip Filenode (e.g.,file_0). - Parse XML data to JSON: Converts the extracted XML data into a JSON format that n8n can process.
- If multiple records to parse: This
Ifnode checks if there are multiple records within the DMARC report. The condition{{ $json.feedback.record[0] }}checks for the existence of the first record.- If True (Multiple Records): The flow goes to
Split Out For Separate Entries. - If False (Single Record or No Record): The flow goes to
Rename column for consistency.
- If True (Multiple Records): The flow goes to
- Split Out For Separate Entries: Splits the
feedback.recordfield into individual entries if multiple DMARC records are present. - Rename Keys: Renames the
feedback.recordtofbrfor easier access in subsequent nodes. This node is crucial for handling multiple DMARC records. - Rename column for consistency: This node ensures the
feedback.recordis available under thefbrkey, even ifSplit Out For Separate Entrieswas bypassed. - Map fields for DB input and parse: This
Setnode maps and transforms the parsed DMARC data into fields suitable for database insertion. It also prepares date fields for formatting. - Begin format date: Formats the
date_range_beginfield intoyyyy-MM-dd hh:mm:ssformat. - End date format: Formats the
date_range_endfield intoyyyy-MM-dd hh:mm:ssformat. - Input into database: Connects to your MySQL database and inserts the processed DMARC data into the
dmarctable. Ensure your MySQL credentials and database table are correctly configured. - If issue with DKIM or SPF: This
Ifnode checks if theevaluated_dkimorevaluated_spffields are not 'pass'.- If True (Issue Found): The flow proceeds to the notification nodes.
- Slack Post Message On Channel: (Disabled by default) If enabled, this node posts a notification message to a Slack channel detailing the DMARC evaluation failure. Configure your Slack credentials and channel.
- Send Error Notification Email: (Disabled by default) If enabled, this node sends an email notification detailing the DMARC evaluation failure. Configure your email sending credentials and recipient.
Setup Reminders:
- Ensure your IMAP mailbox is correctly set up and accessible.
- Configure your MySQL database credentials and ensure the
dmarctable exists with the necessary columns. - Set up Slack or email notification channels if you wish to receive alerts.
Apps Used
Workflow JSON
{
"id": "c3ae2ffa-1933-4fd3-a5a1-1c305aff9cb3",
"name": "Parse DMARC Reports",
"nodes": 24,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: c3ae2ffa-1933...
About the Author
Crypto_Watcher
Web3 Developer
Automated trading bots and blockchain monitoring workflows.
Statistics
Related Workflows
Discover more workflows you might like
Effortless Bug Reporting: Slack Slash Command to Linear Issue
Streamline your bug reporting process by instantly creating Linear issues directly from Slack using a simple slash command. This workflow enhances team collaboration by providing immediate feedback and a structured approach to logging defects, saving valuable time for development and QA teams.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.