Skip to main content

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:

  1. Evaluates precision and recall before and after a proposed filter
  2. Clusters false positives by field to surface the dominant pattern
  3. Attack-injects synthetic true positives to test filter safety
  4. Perturbs labels (10% flip, 3 trials) to check stability under noise
  5. 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 to true_positive/false_positive
  • scanner_ips.csv — known vulnerability scanner IPs
  • service_accounts.csv — known service accounts
from pathlib import Path
import squelch_harness
lookups_dir = Path(squelch_harness.__file__).parent / "lookups"

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

squelch_harness-0.1.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

squelch_harness-0.1.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

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

Hashes for squelch_harness-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abbfc0efbc746a7c0b5bead582ccd685f3d935e9687feb8383dd5a5ef144cbac
MD5 179a561e942d0cca243324431c2ab6b1
BLAKE2b-256 54bf239e467886119db4cc7dfc9d15195a9a59c3c21dc898095faca40d6f98ec

See more details on using hashes here.

File details

Details for the file squelch_harness-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for squelch_harness-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2432f6f01fd2baac271a6800d91d04e241667191b7704f1c17bb4eaf9c63ae67
MD5 c8de643b3671e8d9e0df7e118fb24ffa
BLAKE2b-256 8ab561e5968d55eb5c644be51ca03ab546e35b2ddc5d49cf48a13731cf9be26b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page