Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 36 ยท Projects and Practice

Splunk Project: Build a Security Monitoring Dashboard

A Splunk security project: normalize authentication logs, accelerate a data model, write failed-login and rare-process detections, build a monitoring dashboard and tune with allow-lists.

This project gives you the work of a junior security analyst: a small company wants visibility into logins and suspicious sign-in behavior from its VPN, its Linux servers and its Windows domain. You will normalize the data, build a model, write detections, assemble a dashboard and tune it. The product cannot run here, so the SPL blocks are read-only; the Python stand-ins let you test the detection logic on generated events. If you have not read it yet, review Splunk for security detections first.

The scenario and the plan

Three sources feed an index called auth:

Source Sourcetype Key fields (raw names)
VPN gateway vpn:login user_name, remote_ip, result=OK/DENIED
Linux servers linux:secure user, rhost, Accepted/Failed
Windows domain controllers WinEventLog:Security Account_Name, Source_Network_Address, EventCode=4624/4625

Plan:

  1. Normalize the fields to the CIM Authentication model.
  2. Accelerate the model for seven days.
  3. Write four detections.
  4. Build the dashboard and a daily report.
  5. Tune with an allow-list and document.

Step 1: normalize

In an add-on app (apps and add-ons) create props.conf entries with aliases and an EVAL that maps vendor results to action:

INI
[vpn:login]
FIELDALIAS-cim_user = user_name AS user
FIELDALIAS-cim_src = remote_ip AS src
EVAL-action = case(result=="OK","success", result=="DENIED","failure", true(),"unknown")

[WinEventLog:Security]
FIELDALIAS-cim_user = Account_Name AS user
FIELDALIAS-cim_src = Source_Network_Address AS src
EVAL-action = case(EventCode==4624,"success", EventCode==4625,"failure", true(),"unknown")

Then, in eventtypes.conf and tags.conf, define vpn_login, linux_login, win_login and tag them authentication (CIM lesson). Check the result:

SPL
| datamodel Authentication Authentication search
| stats count by Authentication.action, sourcetype

Try it: normalization test (stand-in)

Python Stand-in: three vendors, one schema

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Step 2: accelerate

Open the Authentication data model (Settings > Data models), choose Edit > Edit Acceleration, tick Accelerate and set 7 days. Watch the Rebuild status reach 100%. Test the fast path:

SPL
| tstats summariesonly=true count from datamodel=Authentication
  where Authentication.action=* by Authentication.action, _time span=1h

Step 3: four detections

D1: password spraying (many users from one source):

SPL
| tstats summariesonly=true count, dc(Authentication.user) AS users
  from datamodel=Authentication where Authentication.action=failure
  by Authentication.src, _time span=10m
| where users >= 10

D2: brute force then success (see the detection lesson).

D3: login outside business hours by privileged accounts:

SPL
| tstats summariesonly=true count from datamodel=Authentication
  where Authentication.action=success by Authentication.user, Authentication.src, _time span=1h
| rename Authentication.* AS *
| eval hour=tonumber(strftime(_time,"%H")), dow=strftime(_time,"%a")
| lookup privileged_accounts user OUTPUT is_admin
| where is_admin="true" AND (hour<6 OR hour>=20 OR dow="Sat" OR dow="Sun")

D4: new source country for a user with iplocation and a baseline lookup (| inputlookup user_countries) updated by a scheduled search that appends each user's countries over the last 30 days.

Try it: password spraying (stand-in)

Python Stand-in: many users failing from one source

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Step 4: the dashboard

Build Security - Authentication:

  • A time input and an action dropdown.
  • Single values: failed logins (24 h), successful logins, distinct users failing, sources over threshold.
  • Line chart: successes versus failures per hour (timechart).
  • Table: top sources by failures with dc(user), and a drilldown setting the src_tok token.
  • Map: failed-login sources with iplocation and geostats.
  • Panel with depends="$src_tok$": raw events for the selected source.

Use a base search over tstats for speed and post-process panels, as in building dashboards. Schedule a daily report of detections, sent as PDF to the security mailbox, and alerts for D1 and D2 with throttling per src.

Step 5: tune and document

Run the detections for two weeks in report-only mode. List the sources that fire most, and decide:

  • Allow-list known scanners and monitoring hosts in a lookup (| lookup allowlist src OUTPUT allowed | where isnull(allowed)).
  • Raise thresholds from baselines (use eventstats avg() and stdev()).
  • Document each detection: purpose, ATT&CK technique, data source, thresholds, false-positive handling, response steps.

Try it: allow-list tuning (stand-in)

Python Stand-in: reduce false positives with an allow-list

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. What does the EVAL that maps EventCode 4624 and 4625 achieve?

    Normalized action values let a single detection work for all authentication sources.
  2. 2. Which pattern separates password spraying from a single-user brute force?

    Spraying tries one or few passwords across many users; brute force hammers one user.
  3. 3. Why run new detections in report-only mode first?

    Tuning with real data prevents alert fatigue.

Summary

  • Normalize every login source to CIM user, src and action and tag it authentication.
  • Accelerate the model and write detections with tstats.
  • Build a dashboard from base and post-process searches, with drilldowns for investigation.
  • Tune with allow-lists and baselines, then document each detection.

Next: Project: license usage and capacity planning