Splunk Security Log Analysis Lab

This guide documents a practical Splunk security log analysis lab focused on collecting, searching, and reviewing security events from Windows and Linux systems. The lab covered Splunk Enterprise setup, log forwarding, SPL searches, dashboard ideas, alert logic, and reporting.

The aim was to understand how security logs can be centralised and analysed to improve visibility into authentication activity, account changes, SSH access, system events, and possible security incidents.

View GitHub Lab Repository

Lab Scope and Objective

Lab Objectives

  • Install and run Splunk Enterprise.
  • Collect Windows security logs.
  • Forward Linux syslog and auditd events.
  • Create a dedicated security index.
  • Search failed logins, SSH access, and account changes.
  • Build dashboard and alert ideas.
  • Document findings and reporting notes.

Technologies Used

  • Splunk Enterprise
  • Splunk Universal Forwarder
  • Windows Event Logs
  • Linux syslog
  • Linux auditd
  • SPL searches
  • SIEM-style investigation workflow

Lab Note

This was a controlled security monitoring lab. The goal was to practise log collection, searching, alert logic, and reporting methods using lab or sample security events.

Installing Splunk Enterprise

Splunk Enterprise was installed as the central platform for collecting and analysing security logs. After installation, Splunk was started and configured so it could be used as the main search and monitoring interface.

Example Installation Flow

Splunk Enterprise • Linux • Installation

# Download Splunk Enterprise from the official Splunk downloads page
# Example package name:
# splunk-<version>-Linux-x86_64.tgz

tar -xvzf splunk-<version>-Linux-x86_64.tgz -C /opt
cd /opt/splunk/bin
./splunk start --accept-license

Splunk was also configured to start automatically when the system boots.

cd /opt/splunk/bin
./splunk enable boot-start

After Splunk was running, the web interface could be accessed through the browser.

http://splunk-server:8000

Log Collection Design

The lab used Splunk as a central log analysis platform. Windows and Linux machines were treated as log sources, and their events were forwarded into Splunk for search, investigation, and reporting.

Example Lab Flow

Log Sources • Forwarding • Splunk Indexing

Windows machine  ── Universal Forwarder ──► Splunk Enterprise
Linux machine    ── syslog / auditd ─────► Splunk Enterprise

Splunk Enterprise
├── receives logs
├── indexes events
├── runs SPL searches
├── creates dashboards
└── triggers alert logic

Data Sources

  • Windows Security logs
  • Windows System logs
  • Linux syslog events
  • Linux authentication logs
  • Linux auditd events

Security Visibility

  • Failed logins
  • Successful logins
  • SSH access
  • User account changes
  • Command execution activity
  • Repeated suspicious patterns

Windows Security Log Forwarding

Windows security logs were collected using the Splunk Universal Forwarder. This allowed important Windows events, such as logon activity and account-related events, to be sent into Splunk for centralised searching.

Windows Logs Collected

  • Security event logs
  • System event logs
  • Authentication events
  • Failed logon activity
  • Successful logon activity
  • Account-related events

Why This Was Useful

  • Centralised Windows security visibility.
  • Made authentication events searchable.
  • Allowed failed logon patterns to be reviewed.
  • Created a base for security dashboards.
  • Made reporting easier.

Example Windows Log Monitoring

Windows Event Logs • Universal Forwarder • Security Index

splunk add monitor 'WinEventLog://Security'
splunk add monitor 'WinEventLog://System'

Example inputs.conf Entry

inputs.conf • WinEventLog • Security Logs

[WinEventLog://Security]
disabled = 0
index = security

[WinEventLog://System]
disabled = 0
index = security

Linux Syslog and Auditd Collection

Linux logs were included so the lab covered more than one operating system. Syslog forwarding was used for general Linux event collection, and auditd was used to record command execution activity.

Linux Sources

  • Syslog events
  • Authentication logs
  • SSH access events
  • Auditd command execution events
  • User account activity

Security Value

  • Reviewed SSH access activity.
  • Tracked accepted and failed authentication events.
  • Recorded command execution events.
  • Added Linux visibility into the same Splunk workflow.

Example Syslog Forwarding

Linux • rsyslog • Log Forwarding

sudo nano /etc/rsyslog.conf

# Example forwarding rule:
*.* @@splunk-server:514

sudo systemctl restart rsyslog

Example auditd Rule

Linux • auditd • Command Execution

sudo auditctl -a always,exit -F arch=b64 -S execve -k command_exec

Security Index and Data Inputs

A dedicated security index was used so security events could be searched more easily. Keeping logs in a consistent index made searches cleaner and helped separate security events from unrelated data.

Data Input Areas

  • Windows Event Logs
  • Linux syslog
  • Linux auditd
  • Files and directories
  • Forwarded endpoint logs

Indexing Benefits

  • Cleaner searches.
  • Consistent query structure.
  • Better dashboard organisation.
  • Easier reporting.
  • Improved investigation workflow.

Example Security Index Search

Splunk • Index • Security Logs

index=security

Failed Login Detection

Failed login activity was one of the main areas reviewed. Repeated failed logins can indicate incorrect saved credentials, user mistakes, brute-force attempts, or password spraying. Splunk searches were used to group events by account and source address.

Windows Failed Login Search

Windows Security Logs • EventCode 4625 • Failed Logins

index=security sourcetype="WinEventLog:Security" EventCode=4625
| stats count by Account_Name, Source_Network_Address
| sort - count

What This Search Shows

  • Accounts with failed logins.
  • Source addresses linked to failures.
  • Repeated authentication failures.
  • Possible brute-force or password spraying patterns.

Investigation Questions

  • Is one account failing repeatedly?
  • Are many accounts failing from the same source?
  • Is the source expected?
  • Did a successful login happen after many failures?

SSH Access Tracking

SSH access was reviewed to understand which users authenticated successfully and which source addresses were involved. This is useful for checking expected administration activity and identifying unusual remote access patterns.

SSH Successful Access Search

Linux • SSH • Authentication Logs

index=security sourcetype=linux_secure "Accepted password"
| stats count by user, src_ip
| sort - count

SSH Failed Access Search

Linux • Failed Passwords • SSH Monitoring

index=security sourcetype=linux_secure "Failed password"
| stats count by src_ip, user
| sort - count

SSH Fields Reviewed

  • User
  • Source IP address
  • Authentication result
  • Host
  • Time of access

Useful Checks

  • Unexpected source addresses.
  • Repeated SSH activity.
  • Root or admin-style access.
  • Access outside expected time windows.

User Account Change Monitoring

Account changes were included because user creation, deletion, or privilege changes can be important during security investigations.

Linux User Account Change Search

Linux Audit • User Changes • Security Monitoring

index=security sourcetype=linux_audit action=add_user OR action=delete_user
| stats count by user, host
| sort - count

Events To Review

  • User creation
  • User deletion
  • Privilege changes
  • Unexpected account activity
  • Changes on sensitive systems

Why It Matters

  • Helps detect unauthorised account changes.
  • Creates an audit trail.
  • Improves visibility into admin activity.
  • Helps with incident investigation.

Dashboard Ideas

Dashboards were planned to make security activity easier to review at a glance. Instead of running every search manually, dashboard panels can summarise login activity, failed logins, source addresses, affected users, and account changes.

Dashboard Panels

  • Real-time login activity
  • Failed login counts
  • Top source addresses
  • Top affected users
  • Admin privilege escalation events
  • Firewall or malware-related events

Dashboard Value

  • Faster review of repeated events.
  • Clearer visibility for investigations.
  • Useful summaries for reporting.
  • Better understanding of normal and abnormal activity.

Example Dashboard Search

Dashboard Panel • Failed Logins • Top Sources

index=security (EventCode=4625 OR "Failed password")
| stats count by host
| sort - count

Security Alert Logic

Alert logic was included to show how searches can move from manual review to detection logic. One example was detecting repeated failed SSH login attempts from the same source or against the same user.

Example Brute Force Alert Search

Alerting • Failed Passwords • Brute Force Detection

index=security sourcetype=linux_secure "Failed password"
| stats count by src_ip, user
| where count > 5

Alert Ideas

  • Multiple failed login attempts.
  • Admin or root login from a new IP address.
  • Changes to sensitive files such as /etc/passwd.
  • Repeated failed SSH activity.
  • Unusual account changes.

Alert Review

  • Check whether the source is expected.
  • Review the affected account.
  • Check for successful login after failures.
  • Confirm whether the event is normal lab activity.
  • Document the investigation decision.

Compliance and Reporting Notes

Reporting was included to show how security logs can be used for audit and review activities. The lab connected log retention, incident monitoring, investigation notes, and reporting ideas with frameworks such as ISO 27001 and NIST.

Reporting Areas

  • Login activity reports
  • Failed authentication summaries
  • Security incident summaries
  • Account change reports
  • Dashboard exports
  • Investigation notes

Why Reporting Matters

  • Creates evidence of monitoring activity.
  • Helps with security reviews.
  • Makes incidents easier to explain.
  • Links technical logs to security controls.
  • Improves repeatability of investigations.

Example Investigation Record

A useful Splunk lab should not only show searches. It should also show how findings would be documented during an investigation or review.

Example Finding Note

Security Notes • Log Analysis • Documentation

Finding: Repeated failed SSH login attempts
Source: Linux authentication logs
Search Used: index=security sourcetype=linux_secure "Failed password"
Review: Check source IP, affected user, time range, and follow-up successful logins
Next Step: Confirm whether the source is expected or should be blocked / investigated

What Was Documented

  • Search queries
  • Fields used for filtering
  • Event patterns observed
  • Possible explanations
  • Follow-up checks
  • Lessons learned

Why Documentation Matters

  • Makes searches reusable.
  • Explains investigation decisions.
  • Creates a record of findings.
  • Improves future analysis.
  • Turns lab work into portfolio evidence.

Future Enhancements

The lab can be extended by adding more data sources, threat intelligence, anomaly detection, and automated response workflows.

Possible Enhancements

  • Threat intelligence feeds
  • More Windows event sources
  • Firewall logs
  • Endpoint security logs
  • Anomaly detection
  • SOAR-style response actions

Learning Value

  • Improves SIEM understanding.
  • Builds stronger SPL skills.
  • Creates better detection logic.
  • Connects logs with security operations.
  • Improves investigation documentation.

Key Takeaways

This lab showed how Splunk can centralise security events and turn raw logs into useful investigation data. The key skill is not only collecting logs, but knowing how to search, filter, summarise, and document what the events mean.

Technical Takeaways

  • Splunk Enterprise can collect and search security logs centrally.
  • Universal Forwarder can send Windows events into Splunk.
  • Linux syslog and auditd add useful visibility.
  • SPL searches can reveal repeated failures and account activity.
  • Dashboards make recurring review easier.

Security Takeaways

  • Failed logins need context before conclusions are made.
  • SSH activity should be reviewed for unusual sources.
  • Account changes are important security events.
  • Alerts need thresholds to reduce noise.
  • Reporting turns technical logs into useful records.

Skills Demonstrated

Splunk Enterprise • Splunk Universal Forwarder • Windows Event Logs • Linux Syslog • Auditd • SIEM Basics • Security Logs • SPL • Failed Login Detection • SSH Monitoring • Account Change Monitoring • Dashboards • Alert Logic • Compliance Reporting • Security Documentation

Back to Guides