Skip to content
RipLiquidPublic

About

Python, SQL, and Splunk SIEM project for detecting brute-force attacks, credential stuffing, and suspicious authentication activity.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AuthWatch

AuthWatch CI

AuthWatch generates synthetic sign-in logs for testing authentication detections. It analyzes the events in SQLite and Splunk and shows suspicious sign-in activity on a Splunk dashboard.


Dashboard

AuthWatch SOC Dashboard

Splunk Dashboard Studio shows sign-in volume, failed-login trends, source IPs, and detection results.


Key Features

  • Generate 50,064 synthetic sign-in events and store them in SQLite.
  • Run SQL and Splunk detections for brute force, credential stuffing, and failed-to-success login sequences.
  • Inspect authentication trends, failed-login sources, and detection results in the Splunk dashboard.

Technologies

  • Python generates events, loads the database, and runs the tests.
  • SQLite and SQL support local analysis.
  • Splunk Enterprise and SPL power the dashboard and detections.
  • GitHub Actions runs CI and packages releases.

Project Architecture

The Python generator writes synthetic sign-ins to the same CSV used by both paths. The SQLite loader imports the file for local SQL analysis. Import the CSV into Splunk to run the SPL searches and dashboard against the same events.


Project Structure

AuthWatch/
├── .github/
│   └── workflows/
│       ├── ci.yml
│       └── release.yml
│
├── images/
│   ├── authwatch_soc_dashboard.png
│   ├── authwatch_detections.png
│   └── splunk_portal.png
│
├── sql/
│   └── detection_queries.sql
│
├── src/
│   ├── generate_logs.py
│   ├── init_db.py
│   └── run_detections.py
│
├── tests/
│   └── test_pipeline.py
│
├── .gitignore
└── README.md

The data/ directory is created locally when the project runs.

Generated files such as:

data/authentication_logs.csv
data/authwatch.db

are excluded from version control because they can be recreated using the included Python scripts.


Dataset

The generator creates 50,064 synthetic authentication events covering normal sign-ins and simulated suspicious activity. Each CSV row records a timestamp, username, source IP, country, event type, status, device, and an attack label.

The attack label is ground truth for validation. The SQL and SPL detectors use observed login behavior such as failed attempts within a time window, the number of distinct accounts, and failures followed by a success.


Threat Detection

1. Brute-Force Detection

Flag five or more failed sign-ins for the same username and source IP in one hourly bucket. In the synthetic example, admin has 30 failures from 198.51.100.41.

View the SPL search.


2. Credential-Stuffing Detection

Flag failed attempts against five or more distinct usernames from one source IP in one hourly bucket. The synthetic example has 30 failures across 10 accounts.

View the SPL search.


3. Possible Account Compromise

Flag a successful login after at least five failures by the same username and source IP in one hourly bucket. In the synthetic example, the success follows the last of 30 failures by 13 seconds.

View the SPL search.


Detection Results

AuthWatch Threat Detections

AuthWatch successfully identifies three major suspicious authentication patterns:

Detection Source IP Target Result
Brute Force 198.51.100.41 admin 30 failed attempts
Credential Stuffing 203.0.113.80 10 accounts 30 failed attempts
Possible Account Compromise 198.51.100.41 admin 30 failures followed by successful authentication

SOC Dashboard

The AuthWatch SOC Dashboard was created using Splunk Dashboard Studio.

The dashboard provides both high-level security metrics and detailed detection results.

Authentication Overview

The dashboard displays:

Total Authentication Events: 50,064

Successful Logins: 48,008

Failed Logins: 2,056

Authentication Activity

The dashboard visualizes:

  • Total authentication activity over time
  • Successful authentication activity
  • Failed authentication activity
  • Failed-login trends
  • Authentication spikes

These visualizations provide context for investigating unusual authentication behaviour.


Failed Login Sources

A horizontal bar chart compares failed authentication activity across source IP addresses.

An important observation from the dataset is that some legitimate internal IP addresses accumulate more failed logins over the entire dataset than the simulated attacker IPs.

This demonstrates why raw failed-login counts alone are not sufficient for reliable threat detection.

AuthWatch therefore combines multiple behavioural indicators:

Time Window
     +
Source IP
     +
Username
     +
Distinct Accounts
     +
Authentication Status
     +
Event Sequence

This reduces false positives and produces more meaningful security detections.


Threat Detection Panels

The dashboard contains dedicated investigation tables for:

  • Brute-Force Detection
  • Credential-Stuffing Detection
  • Possible Account Compromise

These panels allow an analyst to quickly identify:

When the activity occurred
Which source IP generated it
Which account was targeted
How many failures occurred
Whether a successful authentication followed

Splunk Configuration

Import the generated CSV into the authwatch index using the authwatch:authentication source type. Splunk setup lists the field and timestamp settings.


SQL Analysis

Detection queries analyze the same synthetic sign-ins in SQLite. For example, the brute-force query groups failures by hour, source IP, and username, returning groups with at least five attempts. The local detection runner prints the results for brute force, credential stuffing, and possible account compromise.


Automated Testing

AuthWatch includes automated tests using Python's built-in unittest framework.

The test suite validates the expected security behaviour of the pipeline.

Current tests verify:

Total Event Count
        |
        v
Expected: 50,064 events


Brute-Force Detection
        |
        v
198.51.100.41
admin
30 failed attempts


Credential-Stuffing Detection
        |
        v
203.0.113.80
10 targeted accounts
30 failed attempts


Account Compromise Sequence
        |
        v
Successful authentication after brute-force activity

Run the tests locally using:

python -m unittest discover -s tests -v

Expected result:

test_account_compromise_sequence ... ok
test_brute_force_detection ... ok
test_credential_stuffing_detection ... ok
test_total_event_count ... ok

----------------------------------------------------------------------
Ran 4 tests

OK

Continuous Integration and Releases

CI runs the pipeline and tests with Python 3.12, 3.13, and 3.14 on pushes and pull requests targeting main. The release workflow validates version tags beginning with v and publishes a ZIP to GitHub Releases.


Running AuthWatch

Use Python 3.12, 3.13, or 3.14 and run these commands from a terminal.

git clone https://github.com/RipLiquid/AuthWatch.git
cd AuthWatch
python src/generate_logs.py
python src/init_db.py
python src/run_detections.py
python -m unittest discover -s tests -v

The generator writes data/authentication_logs.csv, and the loader writes data/authwatch.db. The detection runner prints its findings in the terminal.


Synthetic Data and Safety

All authentication activity used by AuthWatch is synthetic and was generated specifically for educational and portfolio purposes.

No real:

  • User accounts
  • Passwords
  • Credentials
  • Enterprise authentication systems
  • Production systems
  • Attack infrastructure

are used.

The project uses private and documentation-only IP address ranges to avoid representing real-world attack infrastructure.


Results

AuthWatch successfully processes:

50,064 Authentication Events

and identifies:

Brute Force

198.51.100.41
        |
        v
      admin
        |
        v
30 Failed Attempts

Credential Stuffing

203.0.113.80
        |
        v
10 Accounts Targeted
        |
        v
30 Failed Attempts

Possible Account Compromise

198.51.100.41
        |
        v
      admin
        |
        v
30 Failed Attempts
        |
        v
Successful Authentication
13 Seconds Later

The same attack behaviours can be analyzed through both:

SQL / SQLite
     +
Splunk / SPL

and the complete Python pipeline is automatically validated through GitHub Actions.


About

Python, SQL, and Splunk SIEM project for detecting brute-force attacks, credential stuffing, and suspicious authentication activity.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages