πŸ”’ Automated weekly security audit reports with Gmail delivery

⚑ 474 views Β· πŸ”’ SecOps & Security Automation

Description

πŸ”’ 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:

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


✨ Key Features

πŸ“Š Smart Risk Assessment

🌍 Bilingual Support

πŸ“§ Beautiful HTML Email


πŸš€ Quick Setup (5 minutes)

1️⃣ Configure Credentials

2️⃣ Set Your Variables

Edit the β€œSet Config Variables” node:

{
  "email_to": "your.email@domain.com",
  "project_name": "My-N8N-Project",
  "server_url": "https://n8n.yourdomain.com",  // NO trailing slash!
  "Language": "EN"  // or "FR"
}

3️⃣ Test & Activate


πŸ“§ 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:

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:


πŸ’‘ 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


πŸ› 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:


🀝 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!

πŸ”— Nodes Used

Cron, Gmail, n8n

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup