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
Metadata
Release files for squelch-harness 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| squelch_harness-0.1.0.tar.gz | 25.0 kB | Without provenance | Details for squelch_harness-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| squelch_harness-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for squelch_harness-0.1.0-py3-none-any.whl |
Total release size: 54.0 kB
Release files / squelch_harness-0.1.0.tar.gz
| Download URL | squelch_harness-0.1.0.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abbfc0efbc746a7c0b5bead582ccd685f3d935e9687feb8383dd5a5ef144cbac
|
|
BLAKE2b-256 checksum How to use checksums |
54bf239e467886119db4cc7dfc9d15195a9a59c3c21dc898095faca40d6f98ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / squelch_harness-0.1.0-py3-none-any.whl
| Download URL | squelch_harness-0.1.0-py3-none-any.whl |
|---|---|
| Size | 29.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2432f6f01fd2baac271a6800d91d04e241667191b7704f1c17bb4eaf9c63ae67
|
|
BLAKE2b-256 checksum How to use checksums |
8ab561e5968d55eb5c644be51ca03ab546e35b2ddc5d49cf48a13731cf9be26b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Security for squelch-harness 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.