Adversarial eval harness for Splunk detections — ships standalone, no agent required
Project description
squelch-harness
Adversarial eval harness for Splunk detections. Measures precision, recall, and label stability — without requiring the Squelch agent, an LLM, or any cloud services.
Part of the Squelch project.
Install
pip install squelch-harness
Requires a running Splunk instance and splunk-sdk.
What it does
Given a detection SPL and a labeled notable index, the harness:
- Evaluates precision and recall before and after a proposed filter
- Clusters false positives by field to surface the dominant pattern
- Attack-injects synthetic true positives to test filter safety
- Perturbs labels (10% flip, 3 trials) to check stability under noise
- Temporal holdout (70/30 split) to check for overfitting
Quick start
import splunklib.client as client
from squelch_harness import evaluate_detection, cluster_fps
svc = client.connect(host="localhost", port=8089,
username="admin", password="changeme",
scheme="https", verify=False)
# Evaluate a detection
result = evaluate_detection(
service=svc,
detection_name="DNS_TunnelExfil_Heuristic",
detection_spl='search index=notable search_name="DNS_TunnelExfil_Heuristic"',
golden_query='search index=notable sourcetype=squelch_notable',
earliest="-30d", latest="now",
)
print(f"precision: {result.precision:.2%}, recall: {result.recall:.2%}")
# Cluster FPs to find the dominant pattern
events = [...] # list of event dicts from your notable index
clusters = cluster_fps(events, fields=("src_ip", "dest", "user"))
print(clusters.winner)
Bundled lookups
The package ships three reference lookups used by the Squelch demo:
disposition_normalization.csv— maps 6 SOC label formats totrue_positive/false_positivescanner_ips.csv— known vulnerability scanner IPsservice_accounts.csv— known service accounts
from pathlib import Path
import squelch_harness
lookups_dir = Path(squelch_harness.__file__).parent / "lookups"
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file squelch_harness-0.1.0.tar.gz.
File metadata
- Download URL: squelch_harness-0.1.0.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abbfc0efbc746a7c0b5bead582ccd685f3d935e9687feb8383dd5a5ef144cbac
|
|
| MD5 |
179a561e942d0cca243324431c2ab6b1
|
|
| BLAKE2b-256 |
54bf239e467886119db4cc7dfc9d15195a9a59c3c21dc898095faca40d6f98ec
|
File details
Details for the file squelch_harness-0.1.0-py3-none-any.whl.
File metadata
- Download URL: squelch_harness-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2432f6f01fd2baac271a6800d91d04e241667191b7704f1c17bb4eaf9c63ae67
|
|
| MD5 |
c8de643b3671e8d9e0df7e118fb24ffa
|
|
| BLAKE2b-256 |
8ab561e5968d55eb5c644be51ca03ab546e35b2ddc5d49cf48a13731cf9be26b
|