n8nflow.net logo

Automated Weekly Security Audit Reports with Gmail Delivery

by Matthieuโ€ขUpdated: Last update 2 days agoโ€ขSource: n8n.io
Loading workflow viewer...

Tags

Getting Started

๐Ÿ”’ N8N Security Audit Report - Automated Weekly Email

๐ŸŽฏ What does this workflow do?

This workflow automatically generates and emails a comprehensive security audit report for your N8N instance every week. It identifies potential security risks related to:

  • Credentials ๐Ÿ”‘ : Exposed or insecure credentials
  • Nodes ๐Ÿงฉ : Sensitive nodes (Code, HTTP Request, SSH, FTP, etc.)
  • Instance settings ๐Ÿข : Global security configuration
  • Community nodes ๐Ÿ“ฆ : Third-party nodes that may pose risks

The report includes direct links to affected workflows, execution statuses, and actionable recommendations.


โœจ Key Features

๐Ÿ“Š Smart Risk Assessment

  • Calculates overall risk level: ๐ŸŸฉ Low / ๐ŸŸง Moderate / ๐ŸŸฅ High
  • Tracks unique credentials (not just total occurrences)
  • Provides detailed breakdown by node type

๐Ÿ”— Direct Workflow Links

  • Clickable links to each workflow mentioned
  • Shows last execution status (๐ŸŸข success / ๐Ÿ”ด failed)
  • Displays execution timestamps

๐ŸŒ Bilingual Support

  • Full support for French and English
  • Switch language with a single variable

๐Ÿ“ง Beautiful HTML Email

  • Clean, professional formatting
  • Color-coded risk levels
  • Emoji icons for easy scanning

๐Ÿš€ Quick Setup (5 minutes)

1๏ธโƒฃ Configure Credentials

  • N8N API : Generate an API key in your N8N settings
  • Gmail OAuth2 : Set up OAuth2 for Gmail sending

2๏ธโƒฃ Set Your Variables

Edit the "Set Config Variables" node:

{
  "email_to": "[[emailย protected]](/cdn-cgi/l/email-protection)",
  "project_name": "My-N8N-Project",
  "server_url": "https://n8n.yourdomain.com",  // NO trailing slash!
  "Language": "EN"  // or "FR"
}

3๏ธโƒฃ Test & Activate

  • Click "Execute Workflow" to test
  • Check your email inbox
  • Activate for weekly automation

๐Ÿ“ง Example Report Output

Subject : ๐Ÿ”’ Audit Report My-Project โ€“ Risk ๐ŸŸง Moderate

Content :

๐Ÿ“Š Summary
โ€ข Credentials involved: 8 (5 unique)
โ€ข Nodes involved: 12
  - ๐Ÿ’ป code: 4
  - ๐ŸŒ httpRequest: 3
  - ๐Ÿ” ssh: 2
โ€ข Community nodes: 1
โ€ข Overall risk level: ๐ŸŸง Moderate

๐Ÿ” Credentials Risk Report
๐Ÿ”น Credentials with full access
- ๐Ÿ”‘ My AWS Credentials
- ๐Ÿ”‘ Database Admin

๐Ÿ“‹ Workflow: Data Processing Pipeline ๐ŸŸข (25-10-2024 06:15 โ†’ 06:16)
  - ๐Ÿ’ป Process Data
  - ๐ŸŒ API Call

๐Ÿงฉ Nodes Risk Report
[...detailed node analysis...]

๐ŸŽจ Customization Options

Change Schedule

Modify the "Schedule Trigger" node to run:

  • Daily at 8 AM
  • Monthly on the 1st
  • Custom cron expression

Add Recipients

Add multiple emails in the Gmail node's toList parameter

Adjust Risk Thresholds

Edit the JavaScript in "Format Audit Report" nodes to customize when risk levels change

Use Different Email Service

Replace Gmail node with:

  • SMTP
  • Microsoft Outlook
  • SendGrid
  • Any email service N8N supports

๐Ÿ’ก Use Cases

โœ… Compliance Monitoring : Track security posture for audits
โœ… Team Awareness : Keep your team informed of security status
โœ… Change Detection : Notice when new risky nodes are added
โœ… Best Practices : Get recommendations to improve security
โœ… Multi-Environment : Run separate instances for dev/staging/prod


๐Ÿ”ง Technical Details

Nodes Used : 8
Credentials Required : 2 (N8N API + Gmail OAuth2)
External Dependencies : None
N8N Version : Compatible with latest N8N versions
Execution Time : ~10-20 seconds


๐Ÿ“‹ Requirements

  • N8N instance with API access
  • Gmail account (or other email service)
  • N8N API key with audit permissions
  • Valid SSL certificate for workflow links (recommended)

๐Ÿ› Troubleshooting

Empty report?
โ†’ Check your N8N API key has audit permissions

Workflow links don't work?
โ†’ Verify server_url is correct and has no trailing slash

No execution status shown?
โ†’ Workflows must have been executed at least once

Wrong language displayed?
โ†’ Set Language to exactly "FR" or "EN" (uppercase)


๐ŸŒŸ Why This Template?

Unlike basic monitoring tools, this workflow:

  • โœ… Provides context-aware security analysis
  • โœ… Links directly to affected workflows
  • โœ… Shows real execution data (not just theoretical risks)
  • โœ… Calculates unique credential exposure (not just counts)
  • โœ… Supports bilingual reports
  • โœ… Delivers actionable recommendations

๐Ÿค Feedback & Support

Found this helpful? Please rate the template!
Have suggestions? Drop a comment below.

Pro tip : Combine this with N8N's native alerting for real-time incident response!


Tags : #security #audit #monitoring #compliance #automation #email #reporting #credentials #governance


๐Ÿ“œ License

MIT - Feel free to modify and share!