Skip to main content

Auto remediate endpoint infections with Wazuh, ClamAV, and GPT-4

Workflow preview

Workflow preview
100%
Auto remediate endpoint infections with Wazuh, ClamAV, and GPT-4 preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Reduce human delays between malware detection and remediation in MSSP/SOC environments. This workflow automates full endpoint antivirus scanning immediately after high severity endpoint infection w...

Best for

  • SecOps automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.noop, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.chainsummarization, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.ssh, n8n-nodes-base.telegram

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by mariskarthick.

Original n8n.io source

1.1 Workflow description

Title
Auto remediate endpoint infections with Wazuh, ClamAV, and GPT-4
Workflow name
Auto remediate endpoint infections with Wazuh, ClamAV, and GPT-4

Reduce human delays between malware detection and remediation in MSSP/SOC environments. This workflow automates full endpoint antivirus scanning immediately after high-severity endpoint infection wazuh alerts, closing the gap between alerting and action.

Why Use This Workflow?

Malware alerts are only effective if acted upon swiftly. Manual follow-ups are slow or often missed, letting threats persist.

Automates detection, triage, scan initiation, and notification—all within one minute of alerting.

Ensures consistent, auditable actions across endpoints running Linux or Windows.


🔑 Key Features

Listens for high-severity Wazuh AV infection alerts (e.g., rule 52502).

Uses GPT-4 for AI-powered alert summaries to speed triage and decision making.

Extracts exact infected file paths using AI and regex for targeted scanning.

Runs ClamAV/defender scans directly on endpoints via SSH with least-privilege credentials.

Sends real-time scan results and remediation updates through Telegram, Slack, or email.

Runs locally with limited permissions—no need for elevated Wazuh manager access.


🎯 Impact

Eliminates manual lag—scans start automatically and immediately.

Standardizes response playbooks for reliable, repeatable remediation.

Reduces threat dwell time, minimizing risk exposure.

Provides full event-to-remediation visibility via logs and notifications.


🚀 Get Started

Configure Wazuh Manager to forward AV alerts to this n8n webhook.

Import this workflow JSON into your n8n instance.

Set up required credentials: OpenAI API, SSH access for ClamAV scanning, notification channels (Telegram/Slack/email).

Activate the workflow and monitor alerts triggering automated scans and reports.


📂 Enjoy customizing

Swap ClamAV with your preferred antivirus commands (e.g., Defender) as needed.

Integrate with your existing communication or ticketing systems.

Extend or adapt for multi-endpoint orchestration or other alert rules.


Created by Mariskarthick M Senior Security Analyst | Detection Engineer | Threat Hunter | Open-Source Enthusiast

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Wazuh Alert

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 2 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 3 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 4 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 5 - Check High Severity

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 6 - Summarize Alert

Type / Role
@n8n/n8n-nodes-langchain.chainSummarization - chainSummarization
Config choices
Version 2.1

Block 7 - Extract Path

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 8 - Run AV Scan

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 9 - Notify Stateholders via Telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

3. Summary Table

Workflow Auto remediate endpoint infections with Wazuh, ClamAV, and GPT-4
Complexity intermediate
Nodes 9
Categories SecOps, AI Summarization
Author mariskarthick
Published 05 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7022/7022.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Auto remediate endpoint infections with Wazuh, ClamAV, and GPT-4 do?

Reduce human delays between malware detection and remediation in MSSP/SOC environments. This workflow automates full endpoint antivirus scanning immediately after high severity endpoint infection w...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your SecOps, AI Summarization use case.