๐Ÿ”’ Automated failed login detection with Jira tasks, Slack alerts & Notion logging

โšก 116 views ยท ๐Ÿ”’ SecOps & Security Automation

Description

Automated Failed Login Detection with Jira Security Tasks, Slack Notifications

Webhook: Failed Login Attempts โ†’ Jira Security Case โ†’ Slack Warnings


This n8n workflow monitors failed login attempts from any application, normalizes incoming data, detects repeated attempts within a configurable time window and automatically:

It ensures fast, structured and automated responses to potential account compromise or brute-force attempts while maintaining persistent records.

Quick Implementation Steps

  1. Import this JSON workflow into n8n.
  2. Connect your application to the failed-login webhook endpoint.
  3. Add Jira Cloud API credentials.
  4. Add Slack API credentials.
  5. Add Notion API credentials and configure the database for storing login attempts.
  6. Enable the workflow โ€” done!

What It Does

  1. Receives Failed Login Data
    • Accepts POST requests containing failed login information.
    • Normalizes the data, ensuring consistent fields: username, ip, timestamp and error.
  2. Validates Input
    • Checks for missing username or IP.
    • Sends a Slack alert if any required field is missing.
  3. Detects Multiple Attempts
    • Uses a sliding time window (default: 5 minutes) to detect multiple failed login attempts from the same username + IP.
    • Single attempts โ†’ standard Jira task + Slack notification.
    • Multiple attempts โ†’ grouped Jira task + detailed Slack notification.
  4. Logs Attempts in Notion
    • Records all failed login events into a Notion database with fields: Username, IP, Total Attempts, Attempt List, Attempt Type.
  5. Formats Slack Alerts
    • Single attempt โ†’ lightweight notification.
    • Multiple attempts โ†’ summary including timestamps, errors, total attempts, and Jira ticket link.

Whoโ€™s It For

This workflow is ideal for:

Requirements

How It Works

  1. Webhook Trigger: Workflow starts when a failed-login event is sent to the failed-login webhook.
  2. Normalization:
    • Converts single objects or arrays into a uniform format.
    • Ensures username, IP, timestamp and error are present.
    • Prepares a logMessage for Slack and Jira nodes.
  3. Validation:
    • IF node checks whether username and IP exist.
    • If missing โ†’ Slack alert for missing information.
  4. Multiple Attempt Detection:
    • Function node detects repeated login attempts within a 5-minute sliding window.
    • Flags attempts as multiple: true or false.
  5. Branching:
    • Multiple attempts โ†’ build summary, create Jira ticket, format Slack message, store in Notion.
    • Single attempts โ†’ create Jira ticket, format Slack message, store in Notion.
  6. Slack Alerts:
    • Single attempt โ†’ concise message
    • Multiple attempts โ†’ detailed summary with timestamps and Jira ticket link
  7. Notion Logging:
    • Stores username, IP, total attempts, attempt list, attempt type in a dedicated database for recordkeeping.

How To Set Up

  1. Import Workflow โ†’ Workflows โ†’ Import from File in n8n.
  2. Webhook Setup โ†’ copy the URL from Faield Login Trigger node and integrate with your application.
  3. Jira Credentials โ†’ connect your Jira account to both Jira nodes and configure project/issue type.
  4. Slack Credentials โ†’ connect your Slack Bot and select the alert channel.
  5. Notion Credentials โ†’ connect your Notion account and select the database for storing login attempts.
  6. Test the Workflow โ†’ send sample events: missing fields, single attempts, multiple attempts.
  7. Enable Workflow โ†’ turn on workflow once testing passes.

Logic Overview

Step NodeDescription
Normalize inputNormalize Login Event โ€” Ensures each event has required fields and prepares a logMessage.
Validate fieldsCheck Username & IP present โ€” IF node โ†’ alerts Slack if data is incomplete.
Detect repeatsDetect Multiple Attempts โ€” Finds multiple attempts within a 5-minute window; sets multiple flag.
Multiple attemptsIF - Multiple Attempts + Build Multi-Attempt Summary โ€” Prepares grouped summary for Slack & Jira.
Single attemptCreate Ticket - Single Attempt โ€” Creates Jira task & Slack alert for one-off events.
Multiple attempt ticketCreate Ticket - Multiple Attempts โ€” Creates detailed Jira task.
Slack alert formattingFormat Fields For Single/Multiple Attempt โ€” Prepares structured message for Slack.
Slack alert deliverySlack Alert - Single/Multiple Attempts โ€” Posts alert in selected Slack channel.
Notion loggingLogin Attempts Data Store in DB โ€” Stores structured attempt data in Notion database.

Customization Options

Optional Enhancements:

Use Case Examples

  1. Detect brute-force attacks targeting user accounts.
  2. Identify credential stuffing across multiple users.
  3. Monitor admin portal access failures with Jira task creation.
  4. Alert security teams instantly when login attempts originate from unusual locations.
  5. Centralize failed login monitoring across multiple applications with Notion logging.

Troubleshooting Guide

IssuePossible CauseSolution
Workflow not receiving dataWebhook misconfiguredVerify webhook URL & POST payload format
Jira ticket creation failsInvalid credentials or insufficient permissionsUpdate Jira API token and project access
Slack alert not sentIncorrect channel ID or missing bot scopesFix Slack credentials and permissions
Multiple attempts not detectedSliding window logic misalignedAdjust Detect Multiple Attempts node code
Notion logging failsIncorrect database ID or missing credentialsUpdate Notion node credentials and database configuration
Errors in normalizationPayload format mismatchUpdate Normalize Login Event function code

Need Help?

If you need help setting up, customizing or extending this workflow, WeblineIndia can assist with full n8n development, workflow automation, security event processing and custom integrations.

๐Ÿ”— Nodes Used

Function, Slack, Webhook, Jira Software, Notion

๐Ÿ“ฅ Import

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

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup