WAZUH - Gemini AI

 

WAZUH - AMBASSADORS

🤖 Integración de Gemini AI en Wazuh para Enriquecimiento Automático de Alertas Críticas

En esta práctica se implementará la integración de Gemini AI dentro del ecosistema Wazuh con el fin de enriquecer la información de los eventos de seguridad de forma automática. Para ello se utilizará una API Key gratuita de Gemini, que permitirá enviar el contenido de las alertas a la inteligencia artificial y recibir una descripción ampliada, contextualizada y más fácil de interpretar.

Cada vez que Wazuh genere una alerta de nivel 12 o superior, se activará un proceso automático que enviará los datos del evento a Gemini. Con la respuesta generada, Wazuh construirá una alerta enriquecida, mucho más completa y útil para la toma de decisiones.
Además, se configurará un script personalizado para enviar un correo electrónico con toda la información original de la alerta junto con el análisis generado por la inteligencia artificial.

🎯 Objetivos de la práctica

  • Integrar una API Key gratuita de Gemini AI en Wazuh.

  • Configurar un flujo automático para procesar alertas de nivel 12 o superior.

  • Enviar información del evento a Gemini y recibir un análisis enriquecido.

  • Crear una alerta secundaria que incluya la interpretación generada por IA.

  • Implementar un script que envíe un correo con formato profesional.

  • Validar todo el proceso generando una alerta real de nivel 12.

🧩 Aspectos clave de la práctica

🔐 Uso de la API Key de Gemini AI

Gemini ofrece un nivel gratuito que permite enviar texto a la inteligencia artificial para obtener:

  • Explicaciones detalladas del evento.

  • Recomendaciones iniciales de mitigación.

  • Clasificación contextual.

  • Una interpretación clara orientada a seguridad.

Esta API Key será almacenada de forma segura y utilizada en el flujo de automatización de Wazuh.

🚨 Detección de alertas de nivel 12 o superior

Wazuh genera alertas con niveles del 0 al 15.
En esta práctica se utilizarán únicamente:

  • Alertas de nivel 12

  • Alertas críticas (niveles 13, 14 y 15)

Estas alertas indican incidentes confirmados, amenazas graves o comportamientos maliciosos muy significativos.
Cuando una de estas alertas aparezca, se activará automáticamente el proceso de enriquecimiento con IA.

🧠 Enriquecimiento del evento con Gemini AI

Una vez generada la alerta crítica, un proceso automatizado extraerá:

  • La descripción del evento.

  • Los datos técnicos relevantes.

  • El origen de la alerta.

  • Los campos importantes del análisis de Wazuh.

Con esa información se enviará una consulta a Gemini AI utilizando la API Key configurada.

La inteligencia artificial devolverá un texto que puede incluir:

  • Explicación detallada del evento en lenguaje claro.

  • Contexto adicional sobre la amenaza.

  • Riesgos potenciales.

  • Impacto posible.

  • Pasos sugeridos para remediar o investigar.

  • Comparación con patrones comunes de ataque.

Este texto será incorporado directamente a una nueva alerta enriquecida dentro de Wazuh.

📨 Envío automático de email con la alerta enriquecida

Además del enriquecimiento en el sistema, se configurará un script para enviar un correo electrónico automático que incluirá:

  • Información completa de la alerta original.

  • Campos relevantes del evento.

  • El análisis detallado generado por Gemini AI.

  • Una estructura clara, ordenada y lista para revisión o escalado.

Este correo permitirá recibir, en tiempo real, información útil y ampliada sobre incidentes críticos sin necesidad de acceder inmediatamente al panel de Wazuh.

🧪 Prueba: Generación de una alerta de nivel 12

Al finalizar la configuración, se provocará una alerta real de nivel 12 (por ejemplo, mediante un evento de cuarentena, detección de malware o cualquier otro incidente crítico).

La prueba permitirá verificar:

  • Que Wazuh detecta la alerta correctamente.

  • Que el proceso de enriquecimiento se activa.

  • Que Gemini procesa el evento y devuelve un análisis completo.

  • Que Wazuh genera la alerta secundaria con la información ampliada.

  • Que el email se envía con el contenido formateado y toda la información relevante.

Es la validación final del flujo de detección + enriquecimiento + notificación.

🔍 ¿Por qué es importante esta práctica?

Esta práctica muestra cómo integrar inteligencia artificial en un entorno de seguridad real, permitiendo:

  • Mejorar la comprensión de eventos complejos.

  • Obtener análisis automatizados sin intervención humana.

  • Aumentar la velocidad de respuesta ante incidentes críticos.

  • Enriquecer alertas para facilitar decisiones informadas.

  • Reducir el tiempo de investigación inicial (time-to-triage).

  • Modernizar y profesionalizar el entorno Wazuh con capacidades de IA.

Es una aproximación realista a cómo se aplican tecnologías de IA en SOC modernos.

✅ Resultados esperados

  • API Key de Gemini integrada en Wazuh correctamente.

  • Flujo automatizado activo para alertas nivel 12+.

  • Envío de eventos a Gemini y recepción de análisis enriquecido.

  • Generación automática de alertas ampliadas en Wazuh.

  • Envío de correos con formato profesional y contenido completo.

  • Validación satisfactoria mediante una alerta crítica real.

  • Comprensión completa del ciclo alerta → IA → enriquecimiento → notificación.

⚙️ Estructura de red


DESCARGAR COMANDOS



🤖Integrating Gemini AI into Wazuh for Automatic Enrichment of Critical Alerts

In this practice, Gemini AI will be integrated into the Wazuh ecosystem to automatically enrich security event information. A free API Key from Gemini will be used to send alert data to the AI engine, which will return an expanded, contextualized, and easier-to-understand explanation of the incident.

Whenever Wazuh generates an alert with level 12 or higher, an automated process will send the event details to Gemini. The response will be used to create an enriched alert, offering deeper insights and clearer interpretation.
Additionally, a custom script will be configured to send an email containing the full alert details along with Gemini’s enriched analysis, formatted for readability and incident response.

🎯 Objectives of the Practice

  • Integrate a free Gemini AI API Key into Wazuh.

  • Configure an automated workflow to process alerts with level 12 or higher.

  • Send event information to Gemini and receive enriched analysis.

  • Generate a secondary enriched alert inside Wazuh.

  • Implement a script that sends a well-formatted email including all alert details.

  • Validate the entire workflow by generating a real level-12 alert.

🧩 Key Aspects of the Practice

🔐 Using the Gemini AI API Key

Gemini AI’s free tier allows text-based interactions that can produce:

  • Detailed explanations of security events.

  • Initial mitigation recommendations.

  • Contextual classification of the incident.

  • Clear descriptions suitable for rapid triage.

The API Key will be securely stored and used within Wazuh’s automated alert-processing flow.

🚨 Detecting Level-12 or Higher Alerts

Wazuh assigns alert levels from 0 to 15.
For this practice, the workflow will activate for:

  • Level 12 alerts

  • Critical alerts (levels 13, 14, and 15)

These alerts represent confirmed threats, high-risk situations, or severe security anomalies.
As soon as such an alert is generated, the enrichment process with Gemini AI will begin.

🧠 Enriching Events with Gemini AI

Once a critical alert appears, an automated process extracts:

  • The event description

  • Key technical details

  • Source information

  • Relevant fields from the Wazuh analysis

This information is sent to Gemini AI using the configured API Key.

The AI model will return text that may include:

  • A detailed explanation of the event in clear language

  • Additional threat context

  • Potential risks and impact

  • Suggested initial response steps

  • Comparisons with known attack patterns

This enriched content will be inserted into a new, dedicated alert inside Wazuh.

📨 Automatic Email Notification with Enriched Content

Beyond generating the enriched alert in Wazuh, a custom script will send an email containing:

  • The full details of the original alert

  • All relevant fields extracted from the event

  • The enriched analysis provided by Gemini AI

  • A professional and readable email format

This ensures real-time delivery of critical incident information without needing to immediately access the Wazuh dashboard.

🧪 Validation: Generating a Level-12 Alert

Once the integration is complete, a real level-12 alert will be generated (for example, through a malware quarantine event or any critical security detection).

This test will confirm:

  • Wazuh detects the alert correctly

  • The enrichment workflow is triggered

  • Gemini receives the event and returns meaningful analysis

  • Wazuh generates the enriched alert

  • An email is sent including all formatted information

This end-to-end validation demonstrates that the detection → enrichment → notification workflow is functioning as intended.

🔍 Why This Practice Is Important

This practice demonstrates how artificial intelligence can be integrated into a real security environment to:

  • Improve understanding of complex alerts

  • Automate contextual analysis

  • Accelerate triage and incident response decisions

  • Enrich alerts with meaningful insights

  • Reduce investigation time for high-severity events

  • Modernize Wazuh with AI-powered capabilities similar to those used in SOCs

It’s a practical, real-world example of AI-driven security workflows.

✅ Expected Results

  • Gemini API Key successfully integrated into Wazuh.

  • Automated workflow triggered for level-12+ alerts.

  • Event information sent to Gemini and enriched analysis received.

  • Automatic creation of enriched alerts within Wazuh.

  • Email notifications sent with complete, formatted details.

  • Successful validation using a real critical alert.

  • Full understanding of the alert → AI → enrichment → notification cycle.

Comentarios

Entradas populares