Skip to main content

RedGap

Find the red gaps in your detection coverage.

RedGap is an automated, MITRE ATT&CK-mapped offense↔detection coverage harness. It runs a small set of benign ATT&CK techniques against its own disposable local lab, collects real telemetry with an independent collector, and then deterministically — from logs and Sigma rules, with no AI in the loop — decides whether each technique was detected or is a gap. The output is a coverage report (technique → detected? → gap type) plus an ATT&CK Navigator layer.

The name is the output: in the coverage grid, detected techniques are green and gaps are red. RedGap finds the red.

CI

v0.1 — what this is and is not. RedGap v0.1 is a deterministic harness over a fixed set of techniques. It is not an autonomous agent that continuously attacks and adapts. Adaptive, gap-driven technique chaining (the agent choosing its next attack from the last result) is the honest next step, tracked on the roadmap. Precise scope on purpose.

Status. RedGap's own parser + evaluator ingests all 122 real SigmaHQ linux/process_creation rules with zero parser errors and zero evaluator crashes — that ruleset is vendored under tests/corpus/ and checked by test_sigmahq_corpus.py, so the claim is reproducible, not asserted. 290 tests run fully offline in CI. Coverage is computed from 5 committed real-telemetry captures — one per technique, each with a raw log + parsed events + sha256 provenance — not authored logs. See docs/architecture.md · committed output in docs/samples/.


The one idea: the verdict is not the AI's to make

Every detected verdict is a pure function of (logs, rules), computed and written to disk before any language model is ever called. An optional LLM planner may (a) choose the order of techniques and decide when to stop, and (b) narrate the report. It cannot decide whether something was detected — both the deterministic and the LLM planner return the engine's coverage, never model text. A test asserts the coverage report is byte-identical with and without the LLM.

This is deliberate. LLMs hallucinate confident verdicts; a coverage tool whose ground truth an LLM can fabricate is worthless. RedGap draws the trust boundary in code.

RedGap architecture — the deterministic pipeline, with the optional LLM planner drawn outside the verdict path

The verdict is a pure function of logs and rules, written to disk before any model runs. The LLM (dashed red) can only order techniques and narrate — it sits outside the verdict path.


Quickstart (offline, no API key, no cloud)

The default path is REPLAY: it re-evaluates real telemetry captured from a prior live run (committed as fixtures with provenance) through the exact same engine used in LIVE mode. No Docker, no key, no network.

pip install redgap
redgap run            # REPLAY: prints the coverage table + writes out/coverage.{json,md} + navigator-layer.json

From source instead (or before the first PyPI release):

git clone https://github.com/befnoz/redgap && cd redgap
pip install -e .
redgap run

Live dashboard: the same coverage, as an interactive web page — https://befnoz.github.io/redgap/ (see docs/DEPLOY.md to switch it on).

To run the real thing against the local Docker lab:

redgap run --live     # brings up the disposable lab, executes techniques, captures fresh telemetry

To try the optional LLM planner (needs the llm extra and ANTHROPIC_API_KEY):

pip install -e ".[llm]"    # adds the optional anthropic SDK
redgap run --llm           # equivalently: COVERAGE_LLM=1 redgap run

The committed coverage.json is identical whichever planner ran — a test asserts it.


What a run shows

A v0.1 run is a five-technique mini kill-chain that deliberately produces both detections and gaps — and two different kinds of gap, because a coverage tool that is all-green is just a checklist:

# ATT&CK Tactic Result
1 T1087.001 Account Discovery: Local Discovery detected
2 T1057 Process Discovery Discovery gap (base-rate) — too noisy for a single-event rule; needs correlation (roadmap)
3 T1136.001 Create Account: Local Persistence detected
4 T1548.001 Setuid/Setgid Priv. Esc / Defense Evasion detected (matches a shipped SigmaHQ rule)
5 T1070.006 Timestomp Defense Evasion gap (rule) → closed live in the remediation round-trip

The remediation round-trip is the point: technique 5 fires but no rule catches it (a rule gap). Write one Sigma rule, re-run the same command, and watch the verdict flip red→green. Both the before and after coverage reports are committed — RedGap is a tool that finds a real blind spot and closes it, not a status printer.


Ethics & scope

⚠️ RedGap attacks only its own disposable local lab. There is deliberately no free-form target flag; the live lab runs with no network, and every container launch is gated at runtime by an allowlist (assert_lab_only) that the test suite proves cannot be widened. Every technique is a benign, published Atomic-Red-Team-derived detection test with no exploit payload, no off-box action, and no runtime downloads. See ETHICS.md, SCOPE.md, and SECURITY.md.

Not shipped: weaponizable breadth, real exploits, credential material, or anything that runs against a system you do not own.


Roadmap (honest next steps)

  • Adaptive, gap-driven technique chaining (agent picks the next attack from the last verdict).
  • Effect / syscall-level detection (e.g. utimensat for timestomp) via a higher-fidelity collector.
  • Correlation rules (turn the base-rate gap into a real detection).
  • Portability: the rules are standard Sigma, so they already run unchanged in Zircolite or any SIEM.

License

MIT — see LICENSE. Third-party attributions in NOTICE. ATT&CK® is a registered trademark of The MITRE Corporation.

Download files

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

Source Distribution

redgap-0.1.0.tar.gz (109.5 kB view details)

Uploaded Source

Built Distribution

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

redgap-0.1.0-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

Details for the file redgap-0.1.0.tar.gz.

File metadata

  • Download URL: redgap-0.1.0.tar.gz
  • Upload date:
  • Size: 109.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for redgap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c74592d03cc23582c12188d7cb429d527ce91be04a71082268e54b56fe413ffb
MD5 f48f45f8b2e867abdb20bfcc9dc76f7b
BLAKE2b-256 4e8f82b44986946558e08b951929a678221f29f8f3993919b915130e27bc9a64

See more details on using hashes here.

Provenance

The following attestation bundles were made for redgap-0.1.0.tar.gz:

Publisher: publish.yml on befnoz/redgap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: redgap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 63.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for redgap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9faed2f25f8fa35b23fcecdb06fe384e0e20eeffae14930066b5b5c16b05eb61
MD5 4acbf6a1f1537feb0c8e61a2d16e4537
BLAKE2b-256 244ba74446dcb9217f8dda3cd1ea6b59ab3bb24745c7a6a4cf908fb833d60af8

See more details on using hashes here.

Provenance

The following attestation bundles were made for redgap-0.1.0-py3-none-any.whl:

Publisher: publish.yml on befnoz/redgap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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